svn commit: samba r20602 - in branches/SAMBA_3_0/source/smbd: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 08:00:53 + (Mon, 08 Jan 2007)
New Revision: 20602

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20602

Log:
Fix coverity ID 339. SMB_ASSERT does not panic without -DDEVELOPER.

Volker

Modified:
   branches/SAMBA_3_0/source/smbd/notify.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/notify.c
===
--- branches/SAMBA_3_0/source/smbd/notify.c 2007-01-08 04:58:04 UTC (rev 
20601)
+++ branches/SAMBA_3_0/source/smbd/notify.c 2007-01-08 08:00:53 UTC (rev 
20602)
@@ -219,8 +219,11 @@
break;
}
}
-   SMB_ASSERT(req != NULL);
 
+   if (req == NULL) {
+   smb_panic("notify_req not found in fsp's requests\n");
+   }
+
DLIST_REMOVE(fsp->notify->requests, req);
DLIST_REMOVE(notify_changes_by_mid, req->mid_map);
SAFE_FREE(req->mid_map);



svn commit: samba r20603 - in branches/SAMBA_3_0/source/libsmb: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 08:05:49 + (Mon, 08 Jan 2007)
New Revision: 20603

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20603

Log:
Slightly simplify logic
Modified:
   branches/SAMBA_3_0/source/libsmb/namequery.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/namequery.c
===
--- branches/SAMBA_3_0/source/libsmb/namequery.c2007-01-08 08:00:53 UTC 
(rev 20602)
+++ branches/SAMBA_3_0/source/libsmb/namequery.c2007-01-08 08:05:49 UTC 
(rev 20603)
@@ -1505,16 +1505,16 @@
   just return the list of DC's.  Or maybe we just failed. */
   
if ( (num_addresses == 0) ) {
-   if ( !done_auto_lookup ) {
-   if (internal_resolve_name(domain, 0x1C, ip_list, count, 
resolve_order)) {
-   return NT_STATUS_OK;
-   } else {
-   return NT_STATUS_NO_LOGON_SERVERS;
-   }
-   } else {
+   if ( done_auto_lookup ) {
DEBUG(4,("get_dc_list: no servers found\n")); 
return NT_STATUS_NO_LOGON_SERVERS;
}
+   if (internal_resolve_name(domain, 0x1C, ip_list, count,
+ resolve_order)) {
+   return NT_STATUS_OK;
+   } else {
+   return NT_STATUS_NO_LOGON_SERVERS;
+   }
}
 
if ( (return_iplist = SMB_MALLOC_ARRAY(struct ip_service, 
num_addresses)) == NULL ) {



svn commit: samba r20604 - in branches: SAMBA_3_0/source/libsmb SAMBA_3_0_24/source/libsmb

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 08:09:29 + (Mon, 08 Jan 2007)
New Revision: 20604

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20604

Log:
Fix two memleaks, Coverity ID 337, merge to 3_0_24
Modified:
   branches/SAMBA_3_0/source/libsmb/namequery.c
   branches/SAMBA_3_0_24/source/libsmb/namequery.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/namequery.c
===
--- branches/SAMBA_3_0/source/libsmb/namequery.c2007-01-08 08:05:49 UTC 
(rev 20603)
+++ branches/SAMBA_3_0/source/libsmb/namequery.c2007-01-08 08:09:29 UTC 
(rev 20604)
@@ -1507,6 +1507,7 @@
if ( (num_addresses == 0) ) {
if ( done_auto_lookup ) {
DEBUG(4,("get_dc_list: no servers found\n")); 
+   SAFE_FREE(auto_ip_list);
return NT_STATUS_NO_LOGON_SERVERS;
}
if (internal_resolve_name(domain, 0x1C, ip_list, count,
@@ -1519,6 +1520,7 @@
 
if ( (return_iplist = SMB_MALLOC_ARRAY(struct ip_service, 
num_addresses)) == NULL ) {
DEBUG(3,("get_dc_list: malloc fail !\n"));
+   SAFE_FREE(auto_ip_list);
return NT_STATUS_NO_MEMORY;
}
 

Modified: branches/SAMBA_3_0_24/source/libsmb/namequery.c
===
--- branches/SAMBA_3_0_24/source/libsmb/namequery.c 2007-01-08 08:05:49 UTC 
(rev 20603)
+++ branches/SAMBA_3_0_24/source/libsmb/namequery.c 2007-01-08 08:09:29 UTC 
(rev 20604)
@@ -1505,20 +1505,22 @@
   just return the list of DC's.  Or maybe we just failed. */
   
if ( (num_addresses == 0) ) {
-   if ( !done_auto_lookup ) {
-   if (internal_resolve_name(domain, 0x1C, ip_list, count, 
resolve_order)) {
-   return NT_STATUS_OK;
-   } else {
-   return NT_STATUS_NO_LOGON_SERVERS;
-   }
-   } else {
+   if ( done_auto_lookup ) {
DEBUG(4,("get_dc_list: no servers found\n")); 
+   SAFE_FREE(auto_ip_list);
return NT_STATUS_NO_LOGON_SERVERS;
}
+   if (internal_resolve_name(domain, 0x1C, ip_list, count,
+ resolve_order)) {
+   return NT_STATUS_OK;
+   } else {
+   return NT_STATUS_NO_LOGON_SERVERS;
+   }
}
 
if ( (return_iplist = SMB_MALLOC_ARRAY(struct ip_service, 
num_addresses)) == NULL ) {
DEBUG(3,("get_dc_list: malloc fail !\n"));
+   SAFE_FREE(auto_ip_list);
return NT_STATUS_NO_MEMORY;
}
 



svn commit: samba r20605 - in branches/SAMBA_3_0/source/smbd: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 13:05:36 + (Mon, 08 Jan 2007)
New Revision: 20605

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20605

Log:
Simplify logic in reply_setatr slightly
Modified:
   branches/SAMBA_3_0/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 08:09:29 UTC (rev 
20604)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 13:05:36 UTC (rev 
20605)
@@ -999,7 +999,7 @@
RESOLVE_DFSPATH(fname, conn, inbuf, outbuf);
   
unix_convert(fname,conn,0,&bad_path,&sbuf);
-   if (bad_path) {
+   if (bad_path || !check_name(fname, conn)) {
END_PROFILE(SMBsetatr);
return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
}
@@ -1022,9 +1022,7 @@
else
mode &= ~aDIR;
 
-   if (check_name(fname,conn)) {
-   ok = (file_set_dosmode(conn,fname,mode,&sbuf,False) == 
0);
-   }
+   ok = (file_set_dosmode(conn,fname,mode,&sbuf,False) == 0);
} else {
ok = True;
}



svn commit: samba r20606 - in branches/SAMBA_3_0/source/smbd: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 13:18:23 + (Mon, 08 Jan 2007)
New Revision: 20606

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20606

Log:
bad_path == True has been covered further up in reply_setatr.

I'm checking in micro-steps to make them independently checkable. This code
just very severely needs cleanup, but I don't want to break anything. So, be
patient with me, please :-)

Volker

Modified:
   branches/SAMBA_3_0/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 13:05:36 UTC (rev 
20605)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 13:18:23 UTC (rev 
20606)
@@ -1032,7 +1032,8 @@
   
if (!ok) {
END_PROFILE(SMBsetatr);
-   return set_bad_path_error(errno, bad_path, outbuf, ERRDOS, 
ERRnoaccess);
+   return set_bad_path_error(errno, False, outbuf,
+ ERRDOS, ERRnoaccess);
}
  
outsize = set_message(outbuf,0,0,False);



svn commit: samba r20607 - in branches/SAMBA_3_0/source/smbd: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 13:21:43 + (Mon, 08 Jan 2007)
New Revision: 20607

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20607

Log:
Next micro-step for reply_setatr
Modified:
   branches/SAMBA_3_0/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 13:18:23 UTC (rev 
20606)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 13:21:43 UTC (rev 
20607)
@@ -979,7 +979,6 @@
 {
pstring fname;
int outsize = 0;
-   BOOL ok=False;
int mode;
time_t mtime;
SMB_STRUCT_STAT sbuf;
@@ -1022,15 +1021,14 @@
else
mode &= ~aDIR;
 
-   ok = (file_set_dosmode(conn,fname,mode,&sbuf,False) == 0);
-   } else {
-   ok = True;
+   if (file_set_dosmode(conn,fname,mode,&sbuf,False) != 0) {
+   END_PROFILE(SMBsetatr);
+   return set_bad_path_error(errno, False, outbuf,
+ ERRDOS, ERRnoaccess);
+   }
}
 
-   if (ok)
-   ok = set_filetime(conn,fname,mtime);
-  
-   if (!ok) {
+   if (!set_filetime(conn,fname,mtime)) {
END_PROFILE(SMBsetatr);
return set_bad_path_error(errno, False, outbuf,
  ERRDOS, ERRnoaccess);



svn commit: samba r20608 - in branches/SAMBA_3_0/source/smbd: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 14:08:34 + (Mon, 08 Jan 2007)
New Revision: 20608

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20608

Log:
ENOENT->NT_STATUS_OBJECT_NAME_NOT_FOUND is covered in the standard unix error 
mapping table
Modified:
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/trans2.c
===
--- branches/SAMBA_3_0/source/smbd/trans2.c 2007-01-08 13:21:43 UTC (rev 
20607)
+++ branches/SAMBA_3_0/source/smbd/trans2.c 2007-01-08 14:08:34 UTC (rev 
20608)
@@ -2711,12 +2711,8 @@
DEBUG(10,("set_bad_path_error: err = %d bad_path = %d\n",
err, (int)bad_path ));
 
-   if(err == ENOENT) {
-   if (bad_path) {
-   return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
-   } else {
-   return ERROR_NT(NT_STATUS_OBJECT_NAME_NOT_FOUND);
-   }
+   if ((err == ENOENT) && bad_path) {
+   return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
}
return UNIXERROR(def_class,def_code);
 }



svn commit: samba r20609 - in branches/SAMBA_4_0/source/torture/raw: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 14:14:18 + (Mon, 08 Jan 2007)
New Revision: 20609

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20609

Log:
Additional torture test for our bad_path handling. Most of it is disabled for
now, there are calls (for example trans2ffirst) which are quite dubious.

Volker

Modified:
   branches/SAMBA_4_0/source/torture/raw/samba3misc.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/samba3misc.c
===
--- branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-01-08 14:08:34 UTC 
(rev 20608)
+++ branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-01-08 14:14:18 UTC 
(rev 20609)
@@ -25,6 +25,7 @@
 #include "system/filesys.h"
 #include "libcli/libcli.h"
 #include "torture/util.h"
+#include "torture/raw/proto.h"
 
 #define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
@@ -219,10 +220,12 @@
 
 BOOL torture_samba3_badpath(struct torture_context *torture)
 {
-   struct smbcli_state *cli_nt;
-   struct smbcli_state *cli_dos;
+   struct smbcli_state *cli_nt = NULL;
+   struct smbcli_state *cli_dos = NULL;
const char *fname = "test.txt";
const char *dirname = "testdir";
+   const char *invname = "testdir\\notthere.txt";
+   const char *invpath = "test.txt\\test.txt";
char *fpath;
int fnum;
NTSTATUS status;
@@ -263,6 +266,7 @@
goto fail;
}
 
+   smbcli_unlink(cli_nt->tree, fname);
smbcli_deltree(cli_nt->tree, dirname);
 
status = smbcli_mkdir(cli_nt->tree, dirname);
@@ -303,6 +307,14 @@
}
smbcli_close(cli_nt->tree, fnum);
 
+   fnum = smbcli_open(cli_nt->tree, fname, O_RDWR | O_CREAT, DENY_NONE);
+   if (fnum == -1) {
+   d_printf("Could not create file %s: %s\n", fname,
+smbcli_errstr(cli_nt->tree));
+   goto fail;
+   }
+   smbcli_close(cli_nt->tree, fnum);
+
/*
 * Do a whole bunch of error code checks on chkpath
 */
@@ -452,6 +464,201 @@
status = raw_smbcli_open(cli_dos->tree, "<\\bla", O_RDONLY, DENY_NONE, 
NULL);
CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRinvalidname));
 
+   /*
+* Walk the Samba3 unix_convert bad_path handling. Some interesting
+* error paths around...
+*/
+
+   status = smbcli_chkpath(cli_nt->tree, invpath);
+   CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
+   status = smbcli_chkpath(cli_dos->tree, invpath);
+   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
+
+   status = smbcli_getatr(cli_nt->tree, invpath, NULL, NULL, NULL);
+   CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
+   status = smbcli_getatr(cli_dos->tree, invpath, NULL, NULL, NULL);
+   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
+
+   status = smbcli_setatr(cli_nt->tree, invpath, 0, 0);
+   CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
+   status = smbcli_setatr(cli_dos->tree, invpath, 0, 0);
+   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
+
+   status = smbcli_setatr(cli_nt->tree, invpath, FILE_ATTRIBUTE_NORMAL,
+  0);
+   CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
+   status = smbcli_setatr(cli_dos->tree, invpath, FILE_ATTRIBUTE_NORMAL,
+  0);
+   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
+
+   status = smbcli_setatr(cli_nt->tree, invname, 0, 0);
+   CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND);
+   status = smbcli_setatr(cli_dos->tree, invname, 0, 0);
+   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadfile));
+
+   /*
+* reply_search returns STATUS_NO_MORE_FILES on invalid path
+*/
+
+   goto done;  /* We're not yet fully there, but keep it
+* in */
+
+   status = torture_single_search(cli_nt, mem_ctx, invpath,
+  RAW_SEARCH_SEARCH,
+  RAW_SEARCH_DATA_SEARCH, 0, NULL);
+   CHECK_STATUS(status, STATUS_NO_MORE_FILES);
+   status = torture_single_search(cli_dos, mem_ctx, invpath,
+  RAW_SEARCH_SEARCH,
+  RAW_SEARCH_DATA_SEARCH, 0, NULL);
+   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRnofiles));
+
+   /*
+* ... whereas t2search gets you NT_STATUS_INVALID_PARAMETER
+*/
+
+   status = torture_single_search(cli_nt, mem_ctx, dirname,
+  RAW_SEARCH_TRANS2,
+  RAW_SEARCH_DATA_STANDARD, 0xf, NULL);
+   CHECK_STATUS(status, STATUS_NO_MORE_FILES);
+   status = torture_single_search(cli_dos, mem_ctx, dirname,
+   

svn commit: samba r20610 - in branches/SAMBA_3_0/source/libgpo: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 14:16:42 + (Mon, 08 Jan 2007)
New Revision: 20610

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20610

Log:
Fix a Solaris warning
Modified:
   branches/SAMBA_3_0/source/libgpo/gpo_util.c


Changeset:
Modified: branches/SAMBA_3_0/source/libgpo/gpo_util.c
===
--- branches/SAMBA_3_0/source/libgpo/gpo_util.c 2007-01-08 14:14:18 UTC (rev 
20609)
+++ branches/SAMBA_3_0/source/libgpo/gpo_util.c 2007-01-08 14:16:42 UTC (rev 
20610)
@@ -267,7 +267,7 @@
}
dump_gp_ext(&gp_ext, lvl);
}
-};
+}
 
 void dump_gplink(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, struct GP_LINK *gp_link)
 {



svn commit: samba r20611 - in branches/SAMBA_3_0/source/smbd: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 15:26:17 + (Mon, 08 Jan 2007)
New Revision: 20611

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20611

Log:
All but one callers to set_bad_path_error have had the bad_path==True argument
being handled further up.

Volker

Modified:
   branches/SAMBA_3_0/source/smbd/nttrans.c
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/nttrans.c
===
--- branches/SAMBA_3_0/source/smbd/nttrans.c2007-01-08 14:16:42 UTC (rev 
20610)
+++ branches/SAMBA_3_0/source/smbd/nttrans.c2007-01-08 15:26:17 UTC (rev 
20611)
@@ -639,7 +639,8 @@
if (!check_name(fname,conn)) {
restore_case_semantics(conn, file_attributes);
END_PROFILE(SMBntcreateX);
-   return set_bad_path_error(errno, bad_path, outbuf, 
ERRDOS,ERRbadpath);
+   return set_bad_path_error(errno, False, outbuf,
+ ERRDOS,ERRbadpath);
}
 
 #if 0
@@ -1265,7 +1266,7 @@
/* All file access must go through check_name() */
if (!check_name(fname,conn)) {
restore_case_semantics(conn, file_attributes);
-   return set_bad_path_error(errno, bad_path, outbuf, 
ERRDOS,ERRbadpath);
+   return set_bad_path_error(errno, False, outbuf, 
ERRDOS,ERRbadpath);
}
 
 #if 0

Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 14:16:42 UTC (rev 
20610)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 15:26:17 UTC (rev 
20611)
@@ -948,7 +948,8 @@
   
if (!ok) {
END_PROFILE(SMBgetatr);
-   return set_bad_path_error(errno, bad_path, outbuf, 
ERRDOS,ERRbadfile);
+   return set_bad_path_error(errno, False, outbuf,
+ ERRDOS,ERRbadfile);
}
  
outsize = set_message(outbuf,10,0,True);
@@ -4006,7 +4007,8 @@
   
if (!ok) {
END_PROFILE(SMBrmdir);
-   return set_bad_path_error(errno, bad_path, outbuf, ERRDOS, 
ERRbadpath);
+   return set_bad_path_error(errno, False, outbuf,
+ ERRDOS, ERRbadpath);
}
  
outsize = set_message(outbuf,0,0,False);

Modified: branches/SAMBA_3_0/source/smbd/trans2.c
===
--- branches/SAMBA_3_0/source/smbd/trans2.c 2007-01-08 14:16:42 UTC (rev 
20610)
+++ branches/SAMBA_3_0/source/smbd/trans2.c 2007-01-08 15:26:17 UTC (rev 
20611)
@@ -807,7 +807,8 @@
}
 
if (!check_name(fname,conn)) {
-   return set_bad_path_error(errno, bad_path, outbuf, 
ERRDOS,ERRnoaccess);
+   return set_bad_path_error(errno, False, outbuf,
+ ERRDOS, ERRnoaccess);
}
 
if (open_ofun == 0) {
@@ -1725,7 +1726,8 @@
return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
}
if(!check_name(directory,conn)) {
-   return set_bad_path_error(errno, bad_path, outbuf, 
ERRDOS,ERRbadpath);
+   return set_bad_path_error(errno, False, outbuf,
+ ERRDOS,ERRbadpath);
}
 
p = strrchr_m(directory,'/');
@@ -2906,11 +2908,14 @@
/* Always do lstat for UNIX calls. */
if (SMB_VFS_LSTAT(conn,fname,&sbuf)) {
DEBUG(3,("call_trans2qfilepathinfo: 
SMB_VFS_LSTAT of %s failed (%s)\n",fname,strerror(errno)));
-   return set_bad_path_error(errno, 
bad_path, outbuf, ERRDOS,ERRbadpath);
+   return set_bad_path_error(
+   errno, False, outbuf,
+   ERRDOS,ERRbadpath);
}
} else if (SMB_VFS_STAT(conn,fname,&sbuf)) {
DEBUG(3,("call_trans2qfilepathinfo: 
SMB_VFS_STAT of %s failed (%s)\n",fname,strerror(errno)));
-   return set_bad_path_error(errno, bad_path, 
outbuf, ERRDOS,ERRbadpath);
+   return set_bad_path_error(errno, False, outbuf,
+ ERRDOS,ERRbadpath);
}
 
delete_pending = get_delete_on_close_flag(sbuf.st_dev, 
sbuf.st_ino);
@@ -2954,18 +2959,21 @@
}
if (!check_name(fname,conn)) {
DEBUG(3,("call_trans2qfilepathinfo: fileinfo of %s 
failed (%s)\n",fname,strerror(errno)));
-  

svn commit: samba r20612 - in branches/SAMBA_3_0/source/smbd: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 15:36:33 + (Mon, 08 Jan 2007)
New Revision: 20612

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20612

Log:
A checkin I've wanted to do for ages: For bad_path==False set_bad_path_error
is equivalent to UNIX_ERROR. Expand the last reference. Lets see if I can kill
that as well :-)

Volker

Modified:
   branches/SAMBA_3_0/source/smbd/nttrans.c
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/nttrans.c
===
--- branches/SAMBA_3_0/source/smbd/nttrans.c2007-01-08 15:26:17 UTC (rev 
20611)
+++ branches/SAMBA_3_0/source/smbd/nttrans.c2007-01-08 15:36:33 UTC (rev 
20612)
@@ -639,8 +639,7 @@
if (!check_name(fname,conn)) {
restore_case_semantics(conn, file_attributes);
END_PROFILE(SMBntcreateX);
-   return set_bad_path_error(errno, False, outbuf,
- ERRDOS,ERRbadpath);
+   return UNIXERROR(ERRDOS, ERRbadpath);
}
 
 #if 0
@@ -1266,7 +1265,7 @@
/* All file access must go through check_name() */
if (!check_name(fname,conn)) {
restore_case_semantics(conn, file_attributes);
-   return set_bad_path_error(errno, False, outbuf, 
ERRDOS,ERRbadpath);
+   return UNIXERROR(ERRDOS, ERRbadpath);
}
 
 #if 0

Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 15:26:17 UTC (rev 
20611)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 15:36:33 UTC (rev 
20612)
@@ -948,8 +948,7 @@
   
if (!ok) {
END_PROFILE(SMBgetatr);
-   return set_bad_path_error(errno, False, outbuf,
- ERRDOS,ERRbadfile);
+   return UNIXERROR(ERRDOS, ERRbadfile);
}
  
outsize = set_message(outbuf,10,0,True);
@@ -1024,15 +1023,13 @@
 
if (file_set_dosmode(conn,fname,mode,&sbuf,False) != 0) {
END_PROFILE(SMBsetatr);
-   return set_bad_path_error(errno, False, outbuf,
- ERRDOS, ERRnoaccess);
+   return UNIXERROR(ERRDOS, ERRnoaccess);
}
}
 
if (!set_filetime(conn,fname,mtime)) {
END_PROFILE(SMBsetatr);
-   return set_bad_path_error(errno, False, outbuf,
- ERRDOS, ERRnoaccess);
+   return UNIXERROR(ERRDOS, ERRnoaccess);
}
  
outsize = set_message(outbuf,0,0,False);
@@ -1212,7 +1209,10 @@
if (dptr_num < 0) {
if(dptr_num == -2) {
END_PROFILE(SMBsearch);
-   return set_bad_path_error(errno, 
bad_path, outbuf, ERRDOS, ERRnofids);
+   if ((errno == ENOENT) && bad_path) {
+   return 
ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
+   }
+   return UNIXERROR(ERRDOS, ERRnofids);
}
END_PROFILE(SMBsearch);
return ERROR_DOS(ERRDOS,ERRnofids);
@@ -4007,8 +4007,7 @@
   
if (!ok) {
END_PROFILE(SMBrmdir);
-   return set_bad_path_error(errno, False, outbuf,
- ERRDOS, ERRbadpath);
+   return UNIXERROR(ERRDOS, ERRbadpath);
}
  
outsize = set_message(outbuf,0,0,False);

Modified: branches/SAMBA_3_0/source/smbd/trans2.c
===
--- branches/SAMBA_3_0/source/smbd/trans2.c 2007-01-08 15:26:17 UTC (rev 
20611)
+++ branches/SAMBA_3_0/source/smbd/trans2.c 2007-01-08 15:36:33 UTC (rev 
20612)
@@ -807,8 +807,7 @@
}
 
if (!check_name(fname,conn)) {
-   return set_bad_path_error(errno, False, outbuf,
- ERRDOS, ERRnoaccess);
+   return UNIXERROR(ERRDOS, ERRnoaccess);
}
 
if (open_ofun == 0) {
@@ -1726,8 +1725,7 @@
return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
}
if(!check_name(directory,conn)) {
-   return set_bad_path_error(errno, False, outbuf,
- ERRDOS,ERRbadpath);
+   return UNIXERROR(ERRDOS, ERRbadpath);
}
 
p = strrchr_m(directory,'/');
@@ -2704,21 +2702,6 @@
return outsize;
 }
 
-/***

svn commit: samba r20613 - in branches/SAMBA_4_0/source/torture/raw: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 16:11:44 + (Mon, 08 Jan 2007)
New Revision: 20613

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20613

Log:
The individual tests are fine, I did run samba3badpath, but raw-samba3hide
left test.txt with permissions 000 behind...

Volker

Modified:
   branches/SAMBA_4_0/source/torture/raw/samba3hide.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/samba3hide.c
===
--- branches/SAMBA_4_0/source/torture/raw/samba3hide.c  2007-01-08 15:36:33 UTC 
(rev 20612)
+++ branches/SAMBA_4_0/source/torture/raw/samba3hide.c  2007-01-08 16:11:44 UTC 
(rev 20613)
@@ -263,6 +263,9 @@
return False;
}
 
+   smbcli_chmod(cli->tree, fname, UNIX_R_USR|UNIX_W_USR);
+   smbcli_unlink(cli->tree, fname);
+   
return True;
 }
 



svn commit: samba r20614 - in branches/SAMBA_3_0/source/passdb: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 16:52:58 + (Mon, 08 Jan 2007)
New Revision: 20614

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20614

Log:
Dummy-checkin to trigger the build
Modified:
   branches/SAMBA_3_0/source/passdb/passdb.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/passdb.c
===
--- branches/SAMBA_3_0/source/passdb/passdb.c   2007-01-08 16:11:44 UTC (rev 
20613)
+++ branches/SAMBA_3_0/source/passdb/passdb.c   2007-01-08 16:52:58 UTC (rev 
20614)
@@ -1445,10 +1445,11 @@
  pdb_get_username(sampass), (uint32)LastBadPassword, 
duration*60, (uint32)time(NULL)));
 
if (LastBadPassword == (time_t)0) {
-   DEBUG(1,("pdb_update_autolock_flag: Account %s administratively 
locked out with no \
-bad password time. Leaving locked out.\n",
-   pdb_get_username(sampass) ));
-   return True;
+   DEBUG(1,("pdb_update_autolock_flag: Account %s "
+"administratively locked out with no bad password "
+"time. Leaving locked out.\n",
+pdb_get_username(sampass) ));
+   return True;
}
 
if ((time(NULL) > (LastBadPassword + (time_t) duration * 60))) {



svn commit: samba r20615 - in branches/SAMBA_3_0_24/source/libgpo: .

2007-01-08 Thread jra
Author: jra
Date: 2007-01-08 16:57:34 + (Mon, 08 Jan 2007)
New Revision: 20615

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20615

Log:
Janitor for vl Please ensure all obvious fixes
go in both branches.
Jeremy.

Modified:
   branches/SAMBA_3_0_24/source/libgpo/gpo_util.c


Changeset:
Modified: branches/SAMBA_3_0_24/source/libgpo/gpo_util.c
===
--- branches/SAMBA_3_0_24/source/libgpo/gpo_util.c  2007-01-08 16:52:58 UTC 
(rev 20614)
+++ branches/SAMBA_3_0_24/source/libgpo/gpo_util.c  2007-01-08 16:57:34 UTC 
(rev 20615)
@@ -267,7 +267,7 @@
}
dump_gp_ext(&gp_ext, lvl);
}
-};
+}
 
 void dump_gplink(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, struct GP_LINK *gp_link)
 {



svn commit: samba-web r1070 - in trunk/scripts: .

2007-01-08 Thread deryck
Author: deryck
Date: 2007-01-08 16:58:47 + (Mon, 08 Jan 2007)
New Revision: 1070

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-web&rev=1070

Log:
Drop us2 from the js redirect script.

deryck

Modified:
   trunk/scripts/js_redirect.py


Changeset:
Modified: trunk/scripts/js_redirect.py
===
--- trunk/scripts/js_redirect.py2006-12-26 16:18:52 UTC (rev 1069)
+++ trunk/scripts/js_redirect.py2007-01-08 16:58:47 UTC (rev 1070)
@@ -21,7 +21,7 @@
 # Make list of mirror_name/url pairs to preserve web_hosts sort. 
 mirrors.append((parts.group(2), parts.group(1)))
 # While we're here, get the US mirrors on their own
-if re.match('USA (.*)', line):
+if re.match('USA (.*)', line) and not 
line.find('us2') > -1:
 us_mirrors.append(re.match('USA 
(.*)', line).group(1))
 
 # Write all mirrors to drop-down menu



svn commit: samba r20616 - in branches/SAMBA_4_0: .

2007-01-08 Thread jelmer
Author: jelmer
Date: 2007-01-08 17:28:14 + (Mon, 08 Jan 2007)
New Revision: 20616

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20616

Log:
Point at the wiki
Modified:
   branches/SAMBA_4_0/howto.txt


Changeset:
Modified: branches/SAMBA_4_0/howto.txt
===
--- branches/SAMBA_4_0/howto.txt2007-01-08 16:57:34 UTC (rev 20615)
+++ branches/SAMBA_4_0/howto.txt2007-01-08 17:28:14 UTC (rev 20616)
@@ -4,6 +4,9 @@
 [EMAIL PROTECTED], December 2004
 
 
+A more up to date version of this howto can be found in the wiki 
+at http://wiki.samba.org/index.php/Samba4/HOWTO.
+
 This is a very basic document on how to setup a simple Samba4
 server. This is aimed at developers who are already familiar with
 Samba3 and wish to participate in Samba4 development. This is not



svn commit: samba r20617 - in branches/SAMBA_3_0/source/smbd: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 20:06:36 + (Mon, 08 Jan 2007)
New Revision: 20617

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20617

Log:
Do not notify if the delete failed
Modified:
   branches/SAMBA_3_0/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 17:28:14 UTC (rev 
20616)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 20:06:36 UTC (rev 
20617)
@@ -2032,10 +2032,10 @@
 
if (SMB_VFS_UNLINK(conn,directory) == 0) {
count++;
+   notify_fname(conn, orig_name, -1,
+NOTIFY_ACTION_REMOVED);
}
 
-   notify_fname(conn, orig_name, -1, NOTIFY_ACTION_REMOVED);
-
} else {
struct smb_Dir *dir_hnd = NULL;
const char *dname;
@@ -2092,10 +2092,12 @@
if (!NT_STATUS_IS_OK(error)) {
continue;
}
-   if (SMB_VFS_UNLINK(conn,fname) == 0)
+   if (SMB_VFS_UNLINK(conn,fname) == 0) {
count++;
-   notify_action(conn, directory, dname,
- -1, NOTIFY_ACTION_REMOVED);
+   notify_action(
+   conn, directory, dname,
+   -1, NOTIFY_ACTION_REMOVED);
+   }
DEBUG(3,("unlink_internals: succesful unlink 
[%s]\n",fname));
}
CloseDir(dir_hnd);



svn commit: samba r20618 - in branches: SAMBA_3_0/source/smbd SAMBA_4_0/source/torture/raw

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 21:08:31 + (Mon, 08 Jan 2007)
New Revision: 20618

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20618

Log:
Fix a bug in bad_path handling that also exists in 3.0.23: For reply_unlink
under Linux we returned NT_STATUS_NOT_A_DIRECTORY. This is because in the
bad_path==True condition lstat(2) returns ENOTDIR and not ENOENT.

Not sure if we want to necessarily replicate the INVALID_PARAMETER here, but
this is what W2k3 does. 

Jeremy, I tried to call you, but you were not around. So I'll leave it up to
you to merge this.

Volker


Modified:
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_4_0/source/torture/raw/samba3misc.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 20:06:36 UTC (rev 
20617)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 21:08:31 UTC (rev 
20618)
@@ -1995,6 +1995,11 @@
*directory = *mask = 0;

rc = unix_convert(name,conn,0,&bad_path,&sbuf);
+   if (bad_path) {
+   return has_wild
+   ? NT_STATUS_INVALID_PARAMETER
+   : NT_STATUS_OBJECT_PATH_NOT_FOUND;
+   }
 
/*
 * Feel my pain, this code needs rewriting *very* badly! -- vl

Modified: branches/SAMBA_4_0/source/torture/raw/samba3misc.c
===
--- branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-01-08 20:06:36 UTC 
(rev 20617)
+++ branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-01-08 21:08:31 UTC 
(rev 20618)
@@ -496,7 +496,23 @@
status = smbcli_setatr(cli_dos->tree, invname, 0, 0);
CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadfile));
 
+   status = smbcli_unlink(cli_nt->tree, invpath);
+   CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
+   status = smbcli_unlink(cli_dos->tree, invpath);
+   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
+
/*
+* W2k3 returns INVALID_PARAMETER for a wildcard unlink if the
+* directory does not exist. They seem to use the t2ffirst, this also
+* returns INVALID_PARAMETER under this condition.
+*/
+
+   status = smbcli_unlink(cli_nt->tree, "test.txt\\*.*");
+   CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+   status = smbcli_unlink(cli_dos->tree, "test.txt\\*.*");
+   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRinvalidparam));
+
+   /*
 * reply_search returns STATUS_NO_MORE_FILES on invalid path
 */
 
@@ -622,11 +638,6 @@
 #endif
}
 
-   status = smbcli_unlink(cli_nt->tree, invpath);
-   CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
-   status = smbcli_unlink(cli_dos->tree, invpath);
-   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
-
status = smbcli_mkdir(cli_nt->tree, invpath);
CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
status = smbcli_mkdir(cli_dos->tree, invpath);



svn commit: samba r20619 - in branches/SAMBA_3_0/source/smbd: .

2007-01-08 Thread vlendec
Author: vlendec
Date: 2007-01-08 21:13:27 + (Mon, 08 Jan 2007)
New Revision: 20619

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20619

Log:
bad_path is handled somewhere else, so can_delete does not need it anymore
Modified:
   branches/SAMBA_3_0/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 21:08:31 UTC (rev 
20618)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-08 21:13:27 UTC (rev 
20619)
@@ -1899,7 +1899,7 @@
 /
 
 static NTSTATUS can_delete(connection_struct *conn, char *fname,
-  uint32 dirtype, BOOL bad_path)
+  uint32 dirtype)
 {
SMB_STRUCT_STAT sbuf;
uint32 fattr;
@@ -1913,13 +1913,6 @@
}
 
if (SMB_VFS_LSTAT(conn,fname,&sbuf) != 0) {
-   if(errno == ENOENT) {
-   if (bad_path) {
-   return NT_STATUS_OBJECT_PATH_NOT_FOUND;
-   } else {
-   return NT_STATUS_OBJECT_NAME_NOT_FOUND;
-   }
-   }
return map_nt_error_from_unix(errno);
}
 
@@ -2031,7 +2024,7 @@
if (!has_wild) {
pstrcat(directory,"/");
pstrcat(directory,mask);
-   error = can_delete(conn,directory,dirtype,bad_path);
+   error = can_delete(conn,directory,dirtype);
if (!NT_STATUS_IS_OK(error))
return error;
 
@@ -2092,8 +2085,7 @@
}
 
slprintf(fname,sizeof(fname)-1, 
"%s/%s",directory,dname);
-   error = can_delete(conn, fname, dirtype,
-  bad_path);
+   error = can_delete(conn, fname, dirtype);
if (!NT_STATUS_IS_OK(error)) {
continue;
}



svn commit: samba r20620 - in branches/SAMBA_3_0_24/source/smbd: .

2007-01-08 Thread jra
Author: jra
Date: 2007-01-08 23:36:55 + (Mon, 08 Jan 2007)
New Revision: 20620

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20620

Log:
This is definately needed - not sure about mapping to
BAD_PARAMETER if unlink is a wildcard but wildcard
unlinks are so rare in modern clients that doing what
W2K3 does is probably ok. OS/2 is the only client that
may care about this and hopefully we will get test coverage
from our wonderful OS/2 test team on this ! :-).
Jeremy.

Modified:
   branches/SAMBA_3_0_24/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0_24/source/smbd/reply.c
===
--- branches/SAMBA_3_0_24/source/smbd/reply.c   2007-01-08 21:13:27 UTC (rev 
20619)
+++ branches/SAMBA_3_0_24/source/smbd/reply.c   2007-01-08 23:36:55 UTC (rev 
20620)
@@ -1995,6 +1995,11 @@
*directory = *mask = 0;

rc = unix_convert(name,conn,0,&bad_path,&sbuf);
+   if (bad_path) {
+   return has_wild
+   ? NT_STATUS_INVALID_PARAMETER
+   : NT_STATUS_OBJECT_PATH_NOT_FOUND;
+   }

p = strrchr_m(name,'/');
if (!p) {



Build status as of Tue Jan 9 00:00:01 2007

2007-01-08 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-01-08 
00:00:37.0 +
+++ /home/build/master/cache/broken_results.txt 2007-01-09 00:00:30.0 
+
@@ -1,10 +1,10 @@
-Build status as of Mon Jan  8 00:00:02 2007
+Build status as of Tue Jan  9 00:00:01 2007
 
 Build counts:
 Tree Total  Broken Panic 
 SOC  0  0  0 
 build_farm   0  0  0 
-ccache   37 7  0 
+ccache   36 7  0 
 ctdb 0  0  0 
 distcc   2  0  0 
 ldb  36 4  0 
@@ -14,9 +14,9 @@
 rsync37 3  0 
 samba0  0  0 
 samba-docs   0  0  0 
-samba4   34 13 1 
+samba4   34 12 2 
 samba_3_037 9  0 
 smb-build34 2  0 
-talloc   36 0  0 
+talloc   37 0  0 
 tdb  36 2  0 
 


svn commit: samba r20621 - in branches/SAMBA_4_0/source/lib/events: .

2007-01-08 Thread tridge
Author: tridge
Date: 2007-01-09 00:00:30 + (Tue, 09 Jan 2007)
New Revision: 20621

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20621

Log:

- enable the aio events backend on systems that support it

- allow the events backend to be chosen in smb.conf

Modified:
   branches/SAMBA_4_0/source/lib/events/config.mk
   branches/SAMBA_4_0/source/lib/events/events.c
   branches/SAMBA_4_0/source/lib/events/events_aio.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/events/config.mk
===
--- branches/SAMBA_4_0/source/lib/events/config.mk  2007-01-08 23:36:55 UTC 
(rev 20620)
+++ branches/SAMBA_4_0/source/lib/events/config.mk  2007-01-09 00:00:30 UTC 
(rev 20621)
@@ -1,4 +1,12 @@
 ##
+[MODULE::EVENTS_AIO]
+OBJ_FILES = events_aio.o
+PRIVATE_DEPENDENCIES = LIBAIO_LINUX
+SUBSYSTEM = LIBEVENTS
+INIT_FUNCTION = events_aio_init
+##
+
+##
 [MODULE::EVENTS_EPOLL]
 OBJ_FILES = events_epoll.o
 SUBSYSTEM = LIBEVENTS
@@ -24,6 +32,6 @@
 # Start SUBSYSTEM LIBEVENTS
 [SUBSYSTEM::LIBEVENTS]
 OBJ_FILES = events.o events_timed.o
-PUBLIC_DEPENDENCIES = LIBTALLOC EVENTS_STANDARD EVENTS_EPOLL
+PUBLIC_DEPENDENCIES = LIBTALLOC EVENTS_STANDARD EVENTS_AIO EVENTS_EPOLL
 # End SUBSYSTEM LIBEVENTS
 ##

Modified: branches/SAMBA_4_0/source/lib/events/events.c
===
--- branches/SAMBA_4_0/source/lib/events/events.c   2007-01-08 23:36:55 UTC 
(rev 20620)
+++ branches/SAMBA_4_0/source/lib/events/events.c   2007-01-09 00:00:30 UTC 
(rev 20621)
@@ -157,6 +157,10 @@
 
event_backend_init();
 
+   if (name == NULL) {
+   name = "standard";
+   }
+
for (e=event_backends;e;e=e->next) {
if (strcmp(name, e->name) == 0) {
return event_context_init_ops(mem_ctx, e->ops);
@@ -173,7 +177,7 @@
 */
 struct event_context *event_context_init(TALLOC_CTX *mem_ctx)
 {
-   return event_context_init_byname(mem_ctx, "standard");
+   return event_context_init_byname(mem_ctx, NULL);
 }
 
 /*
@@ -246,6 +250,7 @@
return ev->ops->loop_wait(ev);
 }
 
+#if _SAMBA_BUILD_
 /*
   find an event context that is a parent of the given memory context,
   or create a new event context as a child of the given context if
@@ -258,8 +263,10 @@
 struct event_context *event_context_find(TALLOC_CTX *mem_ctx)
 {
struct event_context *ev = talloc_find_parent_bytype(mem_ctx, struct 
event_context);
-   if (ev == NULL) {
-   ev = event_context_init(mem_ctx);
+   if (ev == NULL) {   
+   ev = event_context_init_byname(mem_ctx, 
+  lp_parm_string(-1, "event", 
"backend"));
}
return ev;
 }
+#endif

Modified: branches/SAMBA_4_0/source/lib/events/events_aio.c
===
--- branches/SAMBA_4_0/source/lib/events/events_aio.c   2007-01-08 23:36:55 UTC 
(rev 20620)
+++ branches/SAMBA_4_0/source/lib/events/events_aio.c   2007-01-09 00:00:30 UTC 
(rev 20621)
@@ -268,9 +268,6 @@
uint16_t flags = 0;
int j;
 
-// DEBUG(0,("EVENT finished=%p fde=%p ep=%p\n", finished, 
fde, ep));
-   //printf("GOT %d aio epoll events\n", event->res);
-
aio_ev->is_epoll_set = 0;
 
for (j=0; jres; j++, ep++) {



svn commit: lorikeet r697 - in trunk/heimdal/lib/gssapi/mech: .

2007-01-08 Thread abartlet
Author: abartlet
Date: 2007-01-09 02:48:25 + (Tue, 09 Jan 2007)
New Revision: 697

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=697

Log:
Make it easier to NULL out a mech in the build system.

Andrew Bartlett

Modified:
   trunk/heimdal/lib/gssapi/mech/gss_mech_switch.c


Changeset:
Modified: trunk/heimdal/lib/gssapi/mech/gss_mech_switch.c
===
--- trunk/heimdal/lib/gssapi/mech/gss_mech_switch.c 2007-01-08 01:12:06 UTC 
(rev 696)
+++ trunk/heimdal/lib/gssapi/mech/gss_mech_switch.c 2007-01-09 02:48:25 UTC 
(rev 697)
@@ -169,6 +169,8 @@
 {
 struct _gss_mech_switch *m;
 OM_uint32 minor_status;
+if (!mech) 
+return 0;
 
 m = malloc(sizeof(*m));
 if (m == NULL)



svn commit: samba r20622 - in branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .

2007-01-08 Thread abartlet
Author: abartlet
Date: 2007-01-09 03:45:50 + (Tue, 09 Jan 2007)
New Revision: 20622

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20622

Log:
Add in a hack to avoid permitting searches on the value of protected
attributes.

Andrew Bartlett


Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c   
2007-01-09 00:00:30 UTC (rev 20621)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c   
2007-01-09 03:45:50 UTC (rev 20622)
@@ -147,7 +147,8 @@
 {
struct kludge_acl_context *ac;
struct ldb_request *down_req;
-   int ret;
+   struct kludge_private_data *data;
+   int ret, i;
 
req->handle = NULL;
 
@@ -156,6 +157,8 @@
return LDB_ERR_OPERATIONS_ERROR;
}
 
+   data = talloc_get_type(module->private_data, struct 
kludge_private_data);
+
ac->module = module;
ac->up_context = req->context;
ac->up_callback = req->callback;
@@ -172,6 +175,25 @@
down_req->op.search.tree = req->op.search.tree;
down_req->op.search.attrs = req->op.search.attrs;

+
+   /*  FIXME: I hink we should copy the tree and keep the original
+*  unmodified. SSS */
+   /* replace any attributes in the parse tree that are private,
+  so we don't allow a search for 'sambaPassword=penguin',
+  just as we would not allow that attribute to be returned */
+   switch (ac->user_type) {
+   case SYSTEM:
+   case ADMINISTRATOR:
+   break;
+   default:
+   /* remove password attributes */
+   for (i = 0; data && data->password_attrs && 
data->password_attrs[i]; i++) {
+   ldb_parse_tree_attr_replace(down_req->op.search.tree, 
+   data->password_attrs[i],
+   
"kludgeACLredactedattribute");
+   }
+   }
+
down_req->controls = req->controls;
 
down_req->context = ac;



svn commit: samba r20623 - in branches/SAMBA_4_0/source/lib/events: .

2007-01-08 Thread tridge
Author: tridge
Date: 2007-01-09 03:52:07 + (Tue, 09 Jan 2007)
New Revision: 20623

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20623

Log:

change where the smb.conf parm event:backend is checked to ensure it
affects all event_context_init() calls

Modified:
   branches/SAMBA_4_0/source/lib/events/events.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/events/events.c
===
--- branches/SAMBA_4_0/source/lib/events/events.c   2007-01-09 03:45:50 UTC 
(rev 20622)
+++ branches/SAMBA_4_0/source/lib/events/events.c   2007-01-09 03:52:07 UTC 
(rev 20623)
@@ -157,7 +157,12 @@
 
event_backend_init();
 
+#if _SAMBA_BUILD_
if (name == NULL) {
+   name = lp_parm_string(-1, "event", "backend");
+   }
+#endif
+   if (name == NULL) {
name = "standard";
}
 
@@ -250,7 +255,6 @@
return ev->ops->loop_wait(ev);
 }
 
-#if _SAMBA_BUILD_
 /*
   find an event context that is a parent of the given memory context,
   or create a new event context as a child of the given context if
@@ -264,9 +268,7 @@
 {
struct event_context *ev = talloc_find_parent_bytype(mem_ctx, struct 
event_context);
if (ev == NULL) {   
-   ev = event_context_init_byname(mem_ctx, 
-  lp_parm_string(-1, "event", 
"backend"));
+   ev = event_context_init(mem_ctx);
}
return ev;
 }
-#endif



svn commit: samba r20624 - in branches/SAMBA_4_0/source/ntvfs/posix: .

2007-01-08 Thread tridge
Author: tridge
Date: 2007-01-09 04:04:26 + (Tue, 09 Jan 2007)
New Revision: 20624

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20624

Log:

added AIO read to pvfs backend

Added:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_aio.c
Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/config.m4
   branches/SAMBA_4_0/source/ntvfs/posix/config.mk
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_read.c
   branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
   branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.h


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/config.m4
===
--- branches/SAMBA_4_0/source/ntvfs/posix/config.m4 2007-01-09 03:52:07 UTC 
(rev 20623)
+++ branches/SAMBA_4_0/source/ntvfs/posix/config.m4 2007-01-09 04:04:26 UTC 
(rev 20624)
@@ -29,3 +29,9 @@
AC_DEFINE(HAVE_LIBBLKID,1,[Whether we have blkid support (e2fsprogs)])
SMB_ENABLE(BLKID,YES)
 fi
+
+AC_CHECK_HEADERS(libaio.h)
+SMB_ENABLE(pvfs_aio,NO)
+if test x"$ac_cv_header_libaio_h" = x"yes"; then
+   SMB_ENABLE(pvfs_aio,YES)
+fi

Modified: branches/SAMBA_4_0/source/ntvfs/posix/config.mk
===
--- branches/SAMBA_4_0/source/ntvfs/posix/config.mk 2007-01-09 03:52:07 UTC 
(rev 20623)
+++ branches/SAMBA_4_0/source/ntvfs/posix/config.mk 2007-01-09 04:04:26 UTC 
(rev 20624)
@@ -21,6 +21,13 @@
 
 
 
+[MODULE::pvfs_aio]
+SUBSYSTEM = ntvfs
+OBJ_FILES = pvfs_aio.o
+PRIVATE_DEPENDENCIES = LIBAIO_LINUX
+
+
+
 # Start MODULE ntvfs_posix
 [MODULE::ntvfs_posix]
 SUBSYSTEM = ntvfs
@@ -56,6 +63,6 @@
xattr_system.o \
xattr_tdb.o
 #PRIVATE_DEPENDENCIES = pvfs_acl_xattr pvfs_acl_nfs4
-PUBLIC_DEPENDENCIES = NDR_XATTR WRAP_XATTR BLKID ntvfs_common MESSAGING
+PUBLIC_DEPENDENCIES = NDR_XATTR WRAP_XATTR BLKID ntvfs_common MESSAGING 
pvfs_aio
 # End MODULE ntvfs_posix
 

Added: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_aio.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_aio.c2007-01-09 03:52:07 UTC 
(rev 20623)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_aio.c2007-01-09 04:04:26 UTC 
(rev 20624)
@@ -0,0 +1,96 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   POSIX NTVFS backend - Linux AIO calls
+
+   Copyright (C) Andrew Tridgell 2006
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+#include "vfs_posix.h"
+#include "lib/events/events.h"
+#include "system/aio.h"
+
+struct pvfs_aio_read_state {
+   struct ntvfs_request *req;
+   union smb_read *rd;
+   struct pvfs_file *f;
+   struct aio_event *ae;
+};
+
+/*
+  called when an aio read has finished
+*/
+static void pvfs_aio_handler(struct event_context *ev, struct aio_event *ae, 
+int ret, void *private)
+{
+   struct pvfs_aio_read_state *state = talloc_get_type(private, 
+   struct 
pvfs_aio_read_state);
+   struct pvfs_file *f = state->f;
+   union smb_read *rd = state->rd;
+
+   if (ret < 0) {
+   /* errno is -ret on error */
+   state->req->async_states->status = pvfs_map_errno(f->pvfs, 
-ret);
+   state->req->async_states->send_fn(state->req);
+   return;
+   }
+
+   f->handle->position = f->handle->seek_offset = rd->readx.in.offset + 
ret;
+
+   rd->readx.out.nread = ret;
+   rd->readx.out.remaining = 0x;
+   rd->readx.out.compaction_mode = 0; 
+
+   talloc_steal(ev, state->ae);
+
+   state->req->async_states->status = NT_STATUS_OK;
+   state->req->async_states->send_fn(state->req);
+}
+
+
+/*
+  read from a file
+*/
+NTSTATUS pvfs_aio_pread(struct ntvfs_request *req, union smb_read *rd,
+   struct pvfs_file *f, uint32_t maxcnt)
+{
+   struct iocb iocb;
+   struct pvfs_aio_read_state *state;
+
+   state = talloc(req, struct pvfs_aio_read_state);
+   NT_STATUS_HAV

svn commit: samba r20625 - in branches/SAMBA_4_0/source/pidl: . lib/Parse/Pidl tests

2007-01-08 Thread jelmer
Author: jelmer
Date: 2007-01-09 06:02:41 + (Tue, 09 Jan 2007)
New Revision: 20625

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20625

Log:
Fix couple of warnings.

Modified:
   branches/SAMBA_4_0/source/pidl/expr.yp
   branches/SAMBA_4_0/source/pidl/idl.yp
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Expr.pm
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/IDL.pm
   branches/SAMBA_4_0/source/pidl/tests/Util.pm
   branches/SAMBA_4_0/source/pidl/tests/util.pl


Changeset:
Sorry, the patch is too large (1626 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20625