svn commit: samba r15705 - branches/SAMBA_3_0/source/nsswitch trunk/source/nsswitch

2006-05-19 Thread vlendec
Author: vlendec
Date: 2006-05-19 07:01:53 + (Fri, 19 May 2006)
New Revision: 15705

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15705

Log:
Fix bug number 3788. Thanks to Jeff Wright.

Volker

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbind_nss_aix.c
   trunk/source/nsswitch/winbind_nss_aix.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbind_nss_aix.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbind_nss_aix.c2006-05-18 
22:34:16 UTC (rev 15704)
+++ branches/SAMBA_3_0/source/nsswitch/winbind_nss_aix.c2006-05-19 
07:01:53 UTC (rev 15705)
@@ -360,6 +360,9 @@
 
logit(getgrset '%s'\n, r_user);
 
+ZERO_STRUCT(response);
+ZERO_STRUCT(request);
+
STRCPY_RETNULL(request.data.username, r_user);
 
if (*user == WB_AIX_ENCODED) {

Modified: trunk/source/nsswitch/winbind_nss_aix.c
===
--- trunk/source/nsswitch/winbind_nss_aix.c 2006-05-18 22:34:16 UTC (rev 
15704)
+++ trunk/source/nsswitch/winbind_nss_aix.c 2006-05-19 07:01:53 UTC (rev 
15705)
@@ -360,6 +360,9 @@
 
logit(getgrset '%s'\n, r_user);
 
+ZERO_STRUCT(response);
+ZERO_STRUCT(request);
+
STRCPY_RETNULL(request.data.username, r_user);
 
if (*user == WB_AIX_ENCODED) {



svn commit: samba r15706 - in branches/SAMBA_4_0/source/torture/basic: .

2006-05-19 Thread vlendec
Author: vlendec
Date: 2006-05-19 07:47:28 + (Fri, 19 May 2006)
New Revision: 15706

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15706

Log:
This is a very specific test that helps me in making sure I don't screw up too
badly in getting rid of set_saved_ntstatus in Samba3. If this is not the
appropriate place to put it, please tell me.

Volker

Modified:
   branches/SAMBA_4_0/source/torture/basic/base.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/basic/base.c
===
--- branches/SAMBA_4_0/source/torture/basic/base.c  2006-05-19 07:01:53 UTC 
(rev 15705)
+++ branches/SAMBA_4_0/source/torture/basic/base.c  2006-05-19 07:47:28 UTC 
(rev 15706)
@@ -1608,9 +1608,158 @@
return ret;
 }
 
+/*
+ * This is a test to excercise some weird Samba3 error paths.
+ */
 
+static BOOL torture_samba3_errorpaths(struct torture_context *torture)
+{
+   BOOL nt_status_support;
+   struct smbcli_state *cli_nt = NULL, *cli_dos = NULL;
+   BOOL result = False;
+   int fnum;
+   const char *os2_fname = .+,;=[].;
+   const char *dirname = samba3_errordir;
+   union smb_open io;
+   TALLOC_CTX *mem_ctx = talloc_init(NULL);
+   NTSTATUS status;
 
+   if (mem_ctx == NULL) {
+   printf(talloc_init failed\n);
+   return False;
+   }
 
+   nt_status_support = lp_nt_status_support();
+
+   if (!lp_set_cmdline(nt status support, yes)) {
+   printf(Could not set 'nt status support = yes'\n);
+   goto fail;
+   }
+
+   if (!torture_open_connection(cli_nt)) {
+   goto fail;
+   }
+
+   if (!lp_set_cmdline(nt status support, no)) {
+   printf(Could not set 'nt status support = yes'\n);
+   goto fail;
+   }
+
+   if (!torture_open_connection(cli_dos)) {
+   goto fail;
+   }
+
+   if (!lp_set_cmdline(nt status support,
+   nt_status_support ? yes:no)) {
+   printf(Could not reset 'nt status support = yes');
+   goto fail;
+   }
+
+   smbcli_unlink(cli_nt-tree, os2_fname);
+   smbcli_rmdir(cli_nt-tree, dirname);
+
+   if (!NT_STATUS_IS_OK(smbcli_mkdir(cli_nt-tree, dirname))) {
+   printf(smbcli_mkdir(%s) failed: %s\n, dirname,
+  smbcli_errstr(cli_nt-tree));
+   goto fail;
+   }
+
+   io.generic.level = RAW_OPEN_NTCREATEX;
+   io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED;
+   io.ntcreatex.in.root_fid = 0;
+   io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
+   io.ntcreatex.in.alloc_size = 1024*1024;
+   io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_DIRECTORY;
+   io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_NONE;
+   io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
+   io.ntcreatex.in.create_options = 0;
+   io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
+   io.ntcreatex.in.security_flags = 0;
+   io.ntcreatex.in.fname = dirname;
+
+   status = smb_raw_open(cli_nt-tree, mem_ctx, io);
+   if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
+   printf((%s) incorrect status %s should be %s\n,
+  __location__, nt_errstr(status),
+  nt_errstr(NT_STATUS_OBJECT_NAME_COLLISION));
+   goto fail;
+   }
+   status = smb_raw_open(cli_dos-tree, mem_ctx, io);
+   if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS, ERRfilexists))) {
+   printf((%s) incorrect status %s should be %s\n,
+  __location__, nt_errstr(status),
+  nt_errstr(NT_STATUS_DOS(ERRDOS, ERRfilexists)));
+   goto fail;
+   }
+
+   status = smbcli_mkdir(cli_nt-tree, dirname);
+   if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
+   printf((%s) incorrect status %s should be %s\n,
+  __location__, nt_errstr(status),
+  nt_errstr(NT_STATUS_OBJECT_NAME_COLLISION));
+   goto fail;
+   }
+   status = smbcli_mkdir(cli_dos-tree, dirname);
+   if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS, ERRnoaccess))) {
+   printf((%s) incorrect status %s should be %s\n,
+  __location__, nt_errstr(status),
+  nt_errstr(NT_STATUS_DOS(ERRDOS, ERRnoaccess)));
+   goto fail;
+   }
+
+   if (!lp_parm_bool(-1, target, samba3, False)) {
+   goto done;
+   }
+
+   fnum = smbcli_open(cli_dos-tree, os2_fname, 
+  O_RDWR | O_CREAT | O_TRUNC,
+  DENY_NONE);
+   if (fnum != -1) {
+   printf(Open(%s) succeeded -- expected failure\n,
+  os2_fname);
+   smbcli_close(cli_dos-tree, fnum);
+ 

svn commit: samba r15707 - in trunk/source/smbd: .

2006-05-19 Thread vlendec
Author: vlendec
Date: 2006-05-19 12:43:32 + (Fri, 19 May 2006)
New Revision: 15707

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15707

Log:
set_saved_error_triple(0, 0, status); has the same meaning as
set_saved_ntstatus(status);...

Volker


Modified:
   trunk/source/smbd/open.c


Changeset:
Modified: trunk/source/smbd/open.c
===
--- trunk/source/smbd/open.c2006-05-19 07:47:28 UTC (rev 15706)
+++ trunk/source/smbd/open.c2006-05-19 12:43:32 UTC (rev 15707)
@@ -1918,7 +1918,7 @@
 Error was %s\n, fname, strerror(errno) ));
/* Ensure we return the correct NT status to the
 * client. */
-   set_saved_error_triple(0, 0, status);
+   set_saved_ntstatus(status);
return NULL;
}
 



svn commit: samba r15708 - in branches/SAMBA_4_0/source/smb_server/smb: .

2006-05-19 Thread metze
Author: metze
Date: 2006-05-19 13:32:17 + (Fri, 19 May 2006)
New Revision: 15708

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15708

Log:
setup count is 8bit and param_count and data_count are 32bit

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/smb/nttrans.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb/nttrans.c
===
--- branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-05-19 12:43:32 UTC 
(rev 15707)
+++ branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-05-19 13:32:17 UTC 
(rev 15708)
@@ -42,8 +42,8 @@
 /* setup a nttrans reply, given the data and params sizes */
 static NTSTATUS nttrans_setup_reply(struct nttrans_op *op, 
struct smb_nttrans *trans,
-   uint16_t param_size, uint16_t data_size,
-   uint16_t setup_count)
+   uint32_t param_size, uint32_t data_size,
+   uint8_t setup_count)
 {
trans-out.setup_count = setup_count;
if (setup_count != 0) {



svn commit: samba r15709 - in branches/SAMBA_4_0/source/smb_server/smb: .

2006-05-19 Thread metze
Author: metze
Date: 2006-05-19 13:37:43 + (Fri, 19 May 2006)
New Revision: 15709

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15709

Log:
- return an error is better than ignoring a non supported request
- zero nttrans output fields before calling the backends

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/smb/nttrans.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb/nttrans.c
===
--- branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-05-19 13:32:17 UTC 
(rev 15708)
+++ branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-05-19 13:37:43 UTC 
(rev 15709)
@@ -626,9 +626,11 @@
if (param_total  param_count ||
data_total  data_count) {
DEBUG(0,(REWRITE: not handling partial nttrans requests!\n));
+   smbsrv_send_error(req, NT_STATUS_FOOBAR);
return;
}
 
+   ZERO_STRUCT(trans-out);
SMBSRV_CALL_NTVFS_BACKEND(nttrans_backend(req, op));
 }
 



svn commit: samba r15710 - in branches/SAMBA_4_0/source/smb_server/smb: .

2006-05-19 Thread metze
Author: metze
Date: 2006-05-19 13:44:39 + (Fri, 19 May 2006)
New Revision: 15710

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15710

Log:
- we no longer need to set the nttrans out fields to zero
  in the backends
- some whitespace cleanups

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/smb/nttrans.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb/nttrans.c
===
--- branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-05-19 13:37:43 UTC 
(rev 15709)
+++ branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-05-19 13:44:39 UTC 
(rev 15710)
@@ -275,11 +275,6 @@
  
(ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
NT_STATUS_NOT_OK_RETURN(status);
 
-   trans-out.setup_count = 0;
-   trans-out.setup   = NULL;
-   trans-out.params  = data_blob(NULL, 0);
-   trans-out.data= data_blob(NULL, 0);
-
return ntvfs_setfileinfo(req-ntvfs, io);
 }
 
@@ -355,7 +350,6 @@
 
status = nttrans_setup_reply(op, op-trans, size, 0, 0);
NT_STATUS_NOT_OK_RETURN(status);
-
p = op-trans-out.params.data;
 
/* construct the changes buffer */
@@ -589,17 +583,17 @@
op-op_info = NULL;
op-send_fn = NULL;
 
-   trans-in.max_setup   = CVAL(req-in.vwv, 0);
+   trans-in.max_setup  = CVAL(req-in.vwv, 0);
param_total  = IVAL(req-in.vwv, 3);
data_total   = IVAL(req-in.vwv, 7);
-   trans-in.max_param   = IVAL(req-in.vwv, 11);
-   trans-in.max_data= IVAL(req-in.vwv, 15);
+   trans-in.max_param  = IVAL(req-in.vwv, 11);
+   trans-in.max_data   = IVAL(req-in.vwv, 15);
param_count  = IVAL(req-in.vwv, 19);
param_ofs= IVAL(req-in.vwv, 23);
data_count   = IVAL(req-in.vwv, 27);
data_ofs = IVAL(req-in.vwv, 31);
-   trans-in.setup_count = CVAL(req-in.vwv, 35);
-   trans-in.function   = SVAL(req-in.vwv, 36);
+   trans-in.setup_count= CVAL(req-in.vwv, 35);
+   trans-in.function   = SVAL(req-in.vwv, 36);
 
if (req-in.wct != 19 + trans-in.setup_count) {
smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRerror));



svn commit: samba r15711 - in branches/SAMBA_4_0/source/smb_server/smb: .

2006-05-19 Thread metze
Author: metze
Date: 2006-05-19 13:58:06 + (Fri, 19 May 2006)
New Revision: 15711

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15711

Log:
- make use of nttrans_setup_reply()

metze 
Modified:
   branches/SAMBA_4_0/source/smb_server/smb/nttrans.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb/nttrans.c
===
--- branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-05-19 13:44:39 UTC 
(rev 15710)
+++ branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-05-19 13:58:06 UTC 
(rev 15711)
@@ -68,14 +68,11 @@
 {
union smb_open *io = talloc_get_type(op-op_info, union smb_open);
uint8_t *params;
+   NTSTATUS status;
 
-   op-trans-out.setup_count = 0;
-   op-trans-out.setup   = NULL;
-   op-trans-out.params  = data_blob_talloc(op, NULL, 69);
-   op-trans-out.data= data_blob(NULL, 0);
-
+   status = nttrans_setup_reply(op, op-trans, 69, 0, 0);
+   NT_STATUS_NOT_OK_RETURN(status);
params = op-trans-out.params.data;
-   NT_STATUS_HAVE_NO_MEMORY(params);
 
SSVAL(params,0, io-ntcreatex.out.oplock_level);
SSVAL(params,2, io-ntcreatex.out.file.fnum);
@@ -197,22 +194,20 @@
  */
 static NTSTATUS nttrans_query_sec_desc_send(struct nttrans_op *op)
 {
-   struct smb_nttrans *trans = op-trans;
union smb_fileinfo *io = talloc_get_type(op-op_info, union 
smb_fileinfo);
+   uint8_t *params;
NTSTATUS status;
 
-   trans-out.setup_count = 0;
-   trans-out.setup   = NULL;
-   trans-out.params  = data_blob_talloc(op, NULL, 4);
-   trans-out.data= data_blob(NULL, 0);
-   NT_STATUS_HAVE_NO_MEMORY(trans-out.params.data);
+   status = nttrans_setup_reply(op, op-trans, 4, 0, 0);
+   NT_STATUS_NOT_OK_RETURN(status);
+   params = op-trans-out.params.data;
 
-   status = ndr_push_struct_blob(trans-out.data, op, 
+   status = ndr_push_struct_blob(op-trans-out.data, op, 
  io-query_secdesc.out.sd, 
  
(ndr_push_flags_fn_t)ndr_push_security_descriptor);
NT_STATUS_NOT_OK_RETURN(status);
 
-   SIVAL(trans-out.params.data, 0, trans-out.data.length);
+   SIVAL(params, 0, op-trans-out.data.length);
 
return NT_STATUS_OK;
 }



svn commit: samba r15712 - branches/SAMBA_3_0/source/smbd trunk/source/smbd

2006-05-19 Thread jerry
Author: jerry
Date: 2006-05-19 14:00:12 + (Fri, 19 May 2006)
New Revision: 15712

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15712

Log:
BUG 3435: patch from volker to fix 'msdfs root = yes' in [homes]
Modified:
   branches/SAMBA_3_0/source/smbd/msdfs.c
   trunk/source/smbd/msdfs.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/msdfs.c
===
--- branches/SAMBA_3_0/source/smbd/msdfs.c  2006-05-19 13:58:06 UTC (rev 
15711)
+++ branches/SAMBA_3_0/source/smbd/msdfs.c  2006-05-19 14:00:12 UTC (rev 
15712)
@@ -419,7 +419,10 @@
return False;
}

-   if (!strequal(dp.servicename, lp_servicename(SNUM(conn)) )) {
+   if ( !( strequal(dp.servicename, lp_servicename(SNUM(conn))) 
+   || ( strequal(dp.servicename, HOMES_NAME) 
+ strequal(lp_servicename(SNUM(conn)), 
get_current_username()) )) ) 
+   {
return False;
}
 

Modified: trunk/source/smbd/msdfs.c
===
--- trunk/source/smbd/msdfs.c   2006-05-19 13:58:06 UTC (rev 15711)
+++ trunk/source/smbd/msdfs.c   2006-05-19 14:00:12 UTC (rev 15712)
@@ -419,7 +419,10 @@
return False;
}

-   if (!strequal(dp.servicename, lp_servicename(SNUM(conn)) )) {
+   if ( !( strequal(dp.servicename, lp_servicename(SNUM(conn))) 
+   || ( strequal(dp.servicename, HOMES_NAME) 
+ strequal(lp_servicename(SNUM(conn)), 
get_current_username()) )) ) 
+   {
return False;
}
 



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

2006-05-19 Thread metze
Author: metze
Date: 2006-05-19 14:10:14 + (Fri, 19 May 2006)
New Revision: 15713

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15713

Log:
- initialize ntioctl.in.max_data and ntioctl.in.blob
- use define instead of hex value

metze
Modified:
   branches/SAMBA_4_0/source/torture/torture_util.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/torture_util.c
===
--- branches/SAMBA_4_0/source/torture/torture_util.c2006-05-19 14:00:12 UTC 
(rev 15712)
+++ branches/SAMBA_4_0/source/torture/torture_util.c2006-05-19 14:10:14 UTC 
(rev 15713)
@@ -22,6 +22,7 @@
 #include smb.h
 #include lib/cmdline/popt_common.h
 #include libcli/raw/libcliraw.h
+#include libcli/raw/ioctl.h
 #include libcli/libcli.h
 #include system/shmem.h
 #include system/time.h
@@ -385,10 +386,12 @@
}
 
nt.ntioctl.level = RAW_IOCTL_NTIOCTL;
-   nt.ntioctl.in.function = 0x900c4;
+   nt.ntioctl.in.function = FSCTL_SET_SPARSE;
nt.ntioctl.in.file.fnum = fnum;
nt.ntioctl.in.fsctl = True;
nt.ntioctl.in.filter = 0;
+   nt.ntioctl.in.max_data = 0;
+   nt.ntioctl.in.blob = data_blob(NULL, 0);
 
status = smb_raw_ioctl(tree, mem_ctx, nt);
 



svn commit: samba r15714 - in branches/SAMBA_4_0/source/smb_server/smb: .

2006-05-19 Thread metze
Author: metze
Date: 2006-05-19 14:15:21 + (Fri, 19 May 2006)
New Revision: 15714

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15714

Log:
fix async handling of ntioctl calls and push the DATA_BLOB into the reply

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/smb/nttrans.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb/nttrans.c
===
--- branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-05-19 14:10:14 UTC 
(rev 15713)
+++ branches/SAMBA_4_0/source/smb_server/smb/nttrans.c  2006-05-19 14:15:21 UTC 
(rev 15714)
@@ -283,6 +283,28 @@
 }
 
 /* 
+   parse NTTRANS_IOCTL send
+ */
+static NTSTATUS nttrans_ioctl_send(struct nttrans_op *op)
+{
+   union smb_ioctl *info = talloc_get_type(op-op_info, union smb_ioctl);
+   NTSTATUS status;
+
+   /* 
+* we pass 0 as data_count here,
+* because we reuse the DATA_BLOB from the smb_ioctl
+* struct
+*/
+   status = nttrans_setup_reply(op, op-trans, 0, 0, 1);
+   NT_STATUS_NOT_OK_RETURN(status);
+
+   op-trans-out.setup[0] = 0;
+   op-trans-out.data = info-ntioctl.out.blob;
+
+   return NT_STATUS_OK;
+}
+
+/* 
parse NTTRANS_IOCTL request
  */
 static NTSTATUS nttrans_ioctl(struct smbsrv_request *req, 
@@ -290,11 +312,6 @@
 {
struct smb_nttrans *trans = op-trans;
union smb_ioctl *nt;
-   uint32_t function;
-   uint16_t fnum;
-   uint8_t filter;
-   BOOL fsctl;
-   NTSTATUS status;
 
/* should have at least 4 setup words */
if (trans-in.setup_count != 4) {
@@ -304,24 +321,17 @@
nt = talloc(op, union smb_ioctl);
NT_STATUS_HAVE_NO_MEMORY(nt);

-   function  = IVAL(trans-in.setup, 0);
-   fnum  = SVAL(trans-in.setup, 4);
-   fsctl = CVAL(trans-in.setup, 6);
-   filter = CVAL(trans-in.setup, 7);
+   nt-ntioctl.level   = RAW_IOCTL_NTIOCTL;
+   nt-ntioctl.in.function = IVAL(trans-in.setup, 0);
+   nt-ntioctl.in.file.fnum= SVAL(trans-in.setup, 4);
+   nt-ntioctl.in.fsctl= CVAL(trans-in.setup, 6);
+   nt-ntioctl.in.filter   = CVAL(trans-in.setup, 7);
+   nt-ntioctl.in.max_data = trans-in.max_data;
+   nt-ntioctl.in.blob = trans-in.data;
 
-   nt-ntioctl.level = RAW_IOCTL_NTIOCTL;
-   nt-ntioctl.in.file.fnum = fnum;
-   nt-ntioctl.in.function = function;
-   nt-ntioctl.in.fsctl = fsctl;
-   nt-ntioctl.in.filter = filter;
-   nt-ntioctl.in.max_data = trans-in.max_data;
-   nt-ntioctl.in.blob = trans-in.data;
+   op-op_info = nt;
+   op-send_fn = nttrans_ioctl_send;
 
-   status = nttrans_setup_reply(op, trans, 0, 0, 1);
-   NT_STATUS_NOT_OK_RETURN(status);
-
-   trans-out.setup[0] = 0;
-   
return ntvfs_ioctl(req-ntvfs, nt);
 }
 



svn commit: samba r15715 - in branches/SAMBA_4_0/source/smb_server: .

2006-05-19 Thread metze
Author: metze
Date: 2006-05-19 14:25:15 + (Fri, 19 May 2006)
New Revision: 15715

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15715

Log:
add my copyright

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/session.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/session.c
===
--- branches/SAMBA_4_0/source/smb_server/session.c  2006-05-19 14:15:21 UTC 
(rev 15714)
+++ branches/SAMBA_4_0/source/smb_server/session.c  2006-05-19 14:25:15 UTC 
(rev 15715)
@@ -3,7 +3,8 @@
Password and authentication handling
Copyright (C) Andrew Tridgell 1992-2005
Copyright (C) Andrew Bartlett [EMAIL PROTECTED] 2005
-   
+   Copyright (C) Stefan Metzmacher 2005-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



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

2006-05-19 Thread metze
Author: metze
Date: 2006-05-19 14:32:42 + (Fri, 19 May 2006)
New Revision: 15716

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15716

Log:
disable the cifs_posix ntvfs backend as it will not be updated
with coming ntvfs subsystem changes

metze
Modified:
   branches/SAMBA_4_0/source/ntvfs/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/config.mk
===
--- branches/SAMBA_4_0/source/ntvfs/config.mk   2006-05-19 14:25:15 UTC (rev 
15715)
+++ branches/SAMBA_4_0/source/ntvfs/config.mk   2006-05-19 14:32:42 UTC (rev 
15716)
@@ -31,6 +31,7 @@
 
 # Start MODULE ntvfs_cifs_posix_cli
 [MODULE::ntvfs_cifs_posix]
+ENABLE = NO
 INIT_FUNCTION = ntvfs_cifs_posix_init
 SUBSYSTEM = ntvfs
 PRIVATE_PROTO_HEADER = cifs_posix_cli/proto.h



svn commit: samba r15717 - branches/SAMBA_3_0/source/script/tests trunk/source/script/tests

2006-05-19 Thread jerry
Author: jerry
Date: 2006-05-19 14:44:50 + (Fri, 19 May 2006)
New Revision: 15717

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15717

Log:
BUG 3711: patch fromLeonid Kabanov [EMAIL PROTECTED] for some solaris 
sheel scripting bugs with 'make test'
Modified:
   branches/SAMBA_3_0/source/script/tests/selftest.sh
   trunk/source/script/tests/selftest.sh


Changeset:
Modified: branches/SAMBA_3_0/source/script/tests/selftest.sh
===
--- branches/SAMBA_3_0/source/script/tests/selftest.sh  2006-05-19 14:32:42 UTC 
(rev 15716)
+++ branches/SAMBA_3_0/source/script/tests/selftest.sh  2006-05-19 14:44:50 UTC 
(rev 15717)
@@ -15,7 +15,7 @@
 mkdir -p $PREFIX || exit $?
 OLD_PWD=`pwd`
 cd $PREFIX || exit $?
-export PREFIX_ABS=`pwd`
+PREFIX_ABS=`pwd`
 cd $OLD_PWD
 
 if [ -z $TORTURE_MAXTIME ]; then
@@ -29,7 +29,7 @@
 
 SERVER=localhost2
 SERVER_IP=127.0.0.2
-USERNAME=`whoami`
+USERNAME=`PATH=/usr/ucb:$PATH whoami`
 PASSWORD=test
 
 SRCDIR=`pwd`

Modified: trunk/source/script/tests/selftest.sh
===
--- trunk/source/script/tests/selftest.sh   2006-05-19 14:32:42 UTC (rev 
15716)
+++ trunk/source/script/tests/selftest.sh   2006-05-19 14:44:50 UTC (rev 
15717)
@@ -15,7 +15,7 @@
 mkdir -p $PREFIX || exit $?
 OLD_PWD=`pwd`
 cd $PREFIX || exit $?
-export PREFIX_ABS=`pwd`
+PREFIX_ABS=`pwd`
 cd $OLD_PWD
 
 if [ -z $TORTURE_MAXTIME ]; then
@@ -29,7 +29,7 @@
 
 SERVER=localhost2
 SERVER_IP=127.0.0.2
-USERNAME=`whoami`
+USERNAME=`PATH=/usr/ucb:$PATH whoami`
 PASSWORD=test
 
 SRCDIR=`pwd`



svn commit: samba r15718 - in branches/SAMBA_4_0/source: libcli/raw ntvfs/nbench ntvfs/posix ntvfs/simple smb_server/smb torture/basic torture/nbench torture/raw

2006-05-19 Thread metze
Author: metze
Date: 2006-05-19 15:10:39 + (Fri, 19 May 2006)
New Revision: 15718

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15718

Log:
- split the SMBflush with the 0x wildcard fnum into a different level

metze
Modified:
   branches/SAMBA_4_0/source/libcli/raw/interfaces.h
   branches/SAMBA_4_0/source/libcli/raw/rawfile.c
   branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c
   branches/SAMBA_4_0/source/ntvfs/simple/vfs_simple.c
   branches/SAMBA_4_0/source/smb_server/smb/reply.c
   branches/SAMBA_4_0/source/torture/basic/delaywrite.c
   branches/SAMBA_4_0/source/torture/nbench/nbio.c
   branches/SAMBA_4_0/source/torture/raw/close.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/interfaces.h
===
--- branches/SAMBA_4_0/source/libcli/raw/interfaces.h   2006-05-19 14:44:50 UTC 
(rev 15717)
+++ branches/SAMBA_4_0/source/libcli/raw/interfaces.h   2006-05-19 15:10:39 UTC 
(rev 15718)
@@ -1725,13 +1725,20 @@
} ntioctl;
 };
 
+enum smb_flush_level {RAW_FLUSH_FLUSH, RAW_FLUSH_ALL};
+
 /* struct for SMBflush */
 union smb_flush {
struct {
+   enum smb_ioctl_level level;
struct {
union smb_handle file;
} in;
} flush, generic;
+
+   struct {
+   enum smb_ioctl_level level;
+   } flush_all;
 };
 
 

Modified: branches/SAMBA_4_0/source/libcli/raw/rawfile.c
===
--- branches/SAMBA_4_0/source/libcli/raw/rawfile.c  2006-05-19 14:44:50 UTC 
(rev 15717)
+++ branches/SAMBA_4_0/source/libcli/raw/rawfile.c  2006-05-19 15:10:39 UTC 
(rev 15718)
@@ -849,9 +849,19 @@
 struct smbcli_request *smb_raw_flush_send(struct smbcli_tree *tree, union 
smb_flush *parms)
 {
struct smbcli_request *req; 
+   uint16_t fnum;
 
+   switch (parms-generic.level) {
+   case RAW_FLUSH_FLUSH:
+   fnum = parms-flush.in.file.fnum;
+   break;
+   case RAW_FLUSH_ALL:
+   fnum = 0x;
+   break;
+   }
+
SETUP_REQUEST(SMBflush, 1, 0);
-   SSVAL(req-out.vwv, VWV(0), parms-flush.in.file.fnum);
+   SSVAL(req-out.vwv, VWV(0), fnum);
 
if (!smbcli_request_send(req)) {
smbcli_request_destroy(req);

Modified: branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c
===
--- branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c 2006-05-19 14:44:50 UTC 
(rev 15717)
+++ branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c 2006-05-19 15:10:39 UTC 
(rev 15718)
@@ -534,10 +534,19 @@
 static void nbench_flush_send(struct ntvfs_request *req)
 {
union smb_flush *io = req-async_states-private_data;
+   uint16_t fnum;
 
+   switch (io-generic.level) {
+   case RAW_FLUSH_FLUSH:
+   fnum = io-flush.in.file.fnum;
+   break;
+   case RAW_FLUSH_ALL:
+   fnum = 0x;
+   break;
+   }
+
nbench_log(req, Flush %d %s\n,
-  io-flush.in.file.fnum,
-  get_nt_error_c_code(req-async_states-status));
+  fnum, get_nt_error_c_code(req-async_states-status));
 
PASS_THRU_REP_POST(req);
 }

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c  2006-05-19 14:44:50 UTC 
(rev 15717)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c  2006-05-19 15:10:39 UTC 
(rev 15718)
@@ -46,23 +46,27 @@
struct pvfs_state *pvfs = ntvfs-private_data;
struct pvfs_file *f;
 
-   if (io-flush.in.file.fnum != 0x) {
+   switch (io-generic.level) {
+   case RAW_FLUSH_FLUSH:
f = pvfs_find_fd(pvfs, req, io-flush.in.file.fnum);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}
pvfs_flush_file(pvfs, f);
return NT_STATUS_OK;
-   }
 
-   if (!(pvfs-flags  PVFS_FLAG_STRICT_SYNC)) {
+   case RAW_FLUSH_ALL:
+   if (!(pvfs-flags  PVFS_FLAG_STRICT_SYNC)) {
+   return NT_STATUS_OK;
+   }
+
+   /* they are asking to flush all open files */
+   for (f=pvfs-files.list;f;f=f-next) {
+   pvfs_flush_file(pvfs, f);
+   }
+
return NT_STATUS_OK;
}
 
-   /* they are asking to flush all open files */
-   for (f=pvfs-files.list;f;f=f-next) {
-   pvfs_flush_file(pvfs, f);
-   }
-
-   return NT_STATUS_OK;
+   return NT_STATUS_INVALID_LEVEL;
 }

Modified: branches/SAMBA_4_0/source/ntvfs/simple/vfs_simple.c

svn commit: samba r15719 - in branches/SAMBA_4_0/source/lib/replace: .

2006-05-19 Thread jmcd
Author: jmcd
Date: 2006-05-19 18:37:35 + (Fri, 19 May 2006)
New Revision: 15719

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15719

Log:
Fix build on systems (AIX) that don't have vsyslog or strcasestr, with
--enable-developer on.  syslog() and toupper() required more includes.

Someone more familiar with samba4 builds should verify this, please.

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===
--- branches/SAMBA_4_0/source/lib/replace/replace.c 2006-05-19 15:10:39 UTC 
(rev 15718)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c 2006-05-19 18:37:35 UTC 
(rev 15719)
@@ -19,10 +19,12 @@
 */
 
 #include includes.h
+#include system/locale.h
 #include system/wait.h
 #include system/time.h
 #include system/network.h
 #include system/filesys.h
+#include system/syslog.h
 
  void replace_dummy(void);
  void replace_dummy(void) {}



svn commit: samba r15720 - in trunk/source: include smbd

2006-05-19 Thread vlendec
Author: vlendec
Date: 2006-05-19 19:50:33 + (Fri, 19 May 2006)
New Revision: 15720

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15720

Log:
Steal the NT_STATUS_DOS trick to stash forced DOS error codes into NTSTATUS
from Samba4.

Get rid of set_saved_error_triple. The places where DOS and NTSTATUS codes are
actually not mappable are made explicit in the code by looking at what kind of
code is required.

Volker

Modified:
   trunk/source/include/nt_status.h
   trunk/source/include/nterr.h
   trunk/source/include/smb_macros.h
   trunk/source/smbd/error.c
   trunk/source/smbd/open.c
   trunk/source/smbd/process.c
   trunk/source/smbd/reply.c


Changeset:
Modified: trunk/source/include/nt_status.h
===
--- trunk/source/include/nt_status.h2006-05-19 18:37:35 UTC (rev 15719)
+++ trunk/source/include/nt_status.h2006-05-19 19:50:33 UTC (rev 15720)
@@ -56,7 +56,6 @@
 
 #define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0)
 #define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x)  0xc000) == 0xc000)
-#define NT_STATUS_IS_INVALID(x) (NT_STATUS_V(x) == 0x)
 #define NT_STATUS_EQUAL(x,y) (NT_STATUS_V(x) == NT_STATUS_V(y))
 #define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0)
 #define W_ERROR_EQUAL(x,y) (W_ERROR_V(x) == W_ERROR_V(y))
@@ -67,4 +66,12 @@
 }\
 } while (0)
 
+/* this defines special NTSTATUS codes to represent DOS errors.  I
+   have chosen this macro to produce status codes in the invalid
+   NTSTATUS range */
+#define NT_STATUS_DOS(class, code) NT_STATUS(0xF100 | ((class)16) | code)
+#define NT_STATUS_IS_DOS(status) ((NT_STATUS_V(status)  0xFF00) == 
0xF100)
+#define NT_STATUS_DOS_CLASS(status) ((NT_STATUS_V(status)  16)  0xFF)
+#define NT_STATUS_DOS_CODE(status) (NT_STATUS_V(status)  0x)
+
 #endif

Modified: trunk/source/include/nterr.h
===
--- trunk/source/include/nterr.h2006-05-19 18:37:35 UTC (rev 15719)
+++ trunk/source/include/nterr.h2006-05-19 19:50:33 UTC (rev 15720)
@@ -37,9 +37,6 @@
 #define STATUS_NOTIFY_ENUM_DIRNT_STATUS(0x010c)
 #define ERROR_INVALID_DATATYPE   NT_STATUS(0x070c)
 
-/* Special invalid NT status code. */
-#define NT_STATUS_INVALIDNT_STATUS(0x)
-
 /* Win32 Error codes extracted using a loop in smbclient then printing a
netmon sniff to a file. */
 

Modified: trunk/source/include/smb_macros.h
===
--- trunk/source/include/smb_macros.h   2006-05-19 18:37:35 UTC (rev 15719)
+++ trunk/source/include/smb_macros.h   2006-05-19 19:50:33 UTC (rev 15720)
@@ -182,7 +182,6 @@
 #define CACHED_ERROR(fsp) cached_error_packet(outbuf,fsp,__LINE__,__FILE__)
 
 #define ERROR_DOS(class,code) 
error_packet(outbuf,class,code,NT_STATUS_OK,__LINE__,__FILE__)
-#define ERROR_FORCE_DOS(class,code) 
error_packet(outbuf,class,code,NT_STATUS_INVALID,__LINE__,__FILE__)
 #define ERROR_NT(status) error_packet(outbuf,0,0,status,__LINE__,__FILE__)
 #define ERROR_FORCE_NT(status) 
error_packet(outbuf,-1,-1,status,__LINE__,__FILE__)
 #define ERROR_BOTH(status,class,code) 
error_packet(outbuf,class,code,status,__LINE__,__FILE__)

Modified: trunk/source/smbd/error.c
===
--- trunk/source/smbd/error.c   2006-05-19 18:37:35 UTC (rev 15719)
+++ trunk/source/smbd/error.c   2006-05-19 19:50:33 UTC (rev 15720)
@@ -25,29 +25,11 @@
 
 extern uint32 global_client_caps;
 /* these can be set by some functions to override the error codes */
-static int override_ERR_class;
-static uint32 override_ERR_code;
 static NTSTATUS override_ERR_ntstatus;
 
-/
- Setting eclass and ecode only and status to NT_STATUS_INVALID forces DOS 
errors.
- Setting status only and eclass and ecode to -1 forces NT errors.
-/
- 
-void set_saved_error_triple(int eclass, int ecode, NTSTATUS status)
-{
-   override_ERR_class = eclass;
-   override_ERR_code = ecode;
-   override_ERR_ntstatus = status;
-}
-
 void set_saved_ntstatus(NTSTATUS status)
 {
-   uint8 tmp_eclass;   /* Hmmm. override_ERR_class is not uint8... */
override_ERR_ntstatus = status;
-   ntstatus_to_dos(status, tmp_eclass, override_ERR_code);
-   override_ERR_class = tmp_eclass;
-   
 }
 
 /
@@ -103,6 +85,10 @@
return error_packet(outbuf,eclass,ecode,ntstatus,line,file);
 }
 
+BOOL use_nt_status(void)
+{
+   return lp_nt_status_support()  (global_client_caps  CAP_STATUS32);
+}
 
 /
  Create an error packet. Normally called using the ERROR() macro.
@@ -117,18 +103,14 @@

svn commit: samba r15721 - in trunk/source/smbd: .

2006-05-19 Thread vlendec
Author: vlendec
Date: 2006-05-19 19:54:39 + (Fri, 19 May 2006)
New Revision: 15721

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15721

Log:
Make us actually survive BASE-SAMBA3ERROR
Modified:
   trunk/source/smbd/reply.c


Changeset:
Modified: trunk/source/smbd/reply.c
===
--- trunk/source/smbd/reply.c   2006-05-19 19:50:33 UTC (rev 15720)
+++ trunk/source/smbd/reply.c   2006-05-19 19:54:39 UTC (rev 15721)
@@ -3831,6 +3831,17 @@
 
status = mkdir_internal(conn, directory,bad_path);
if (!NT_STATUS_IS_OK(status)) {
+
+   if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION) 
+   !use_nt_status()) {
+   /*
+* Yes, in the DOS error code case we get a
+* ERRDOS:ERRnoaccess here. See BASE-SAMBA3ERROR
+* samba4 torture test.
+*/
+   status = NT_STATUS_DOS(ERRDOS, ERRnoaccess);
+   }
+
END_PROFILE(SMBmkdir);
return ERROR_NT(status);
}



svn commit: samba r15722 - in trunk/source: printing smbd

2006-05-19 Thread vlendec
Author: vlendec
Date: 2006-05-19 20:40:44 + (Fri, 19 May 2006)
New Revision: 15722

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15722

Log:
Lift set_saved_ntstatus from print_fsp_open.

Volker

Modified:
   trunk/source/printing/printfsp.c
   trunk/source/smbd/open.c
   trunk/source/smbd/reply.c


Changeset:
Modified: trunk/source/printing/printfsp.c
===
--- trunk/source/printing/printfsp.c2006-05-19 19:54:39 UTC (rev 15721)
+++ trunk/source/printing/printfsp.c2006-05-19 20:40:44 UTC (rev 15722)
@@ -28,7 +28,8 @@
 print_job_start().
 ***/
 
-files_struct *print_fsp_open(connection_struct *conn, const char *fname)
+NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
+   files_struct **result)
 {
int jobid;
SMB_STRUCT_STAT sbuf;
@@ -38,8 +39,7 @@
 
status = file_new(conn, fsp);
if(!NT_STATUS_IS_OK(status)) {
-   set_saved_ntstatus(status);
-   return NULL;
+   return status;
}
 
fstrcpy( name, Remote Downlevel Document);
@@ -54,8 +54,9 @@
 
jobid = print_job_start(current_user, SNUM(conn), name, NULL);
if (jobid == -1) {
+   status = map_nt_error_from_unix(errno);
file_free(fsp);
-   return NULL;
+   return status;
}
 
/* Convert to RAP id. */
@@ -64,7 +65,7 @@
/* We need to delete the entry in the tdb. */
pjob_delete(lp_const_servicename(SNUM(conn)), jobid);
file_free(fsp);
-   return NULL;
+   return NT_STATUS_ACCESS_DENIED; /* No errno around here */
}
 
/* setup a full fsp */
@@ -91,7 +92,8 @@
 
conn-num_files_open++;
 
-   return fsp;
+   *result = fsp;
+   return NT_STATUS_OK;
 }
 
 /

Modified: trunk/source/smbd/open.c
===
--- trunk/source/smbd/open.c2006-05-19 19:54:39 UTC (rev 15721)
+++ trunk/source/smbd/open.c2006-05-19 20:40:44 UTC (rev 15722)
@@ -1115,7 +1115,11 @@
 
DEBUG(10, (open_file_ntcreate: printer open fname=%s\n, 
fname));
 
-   return print_fsp_open(conn, fname);
+   status = print_fsp_open(conn, fname, fsp);
+   if (!NT_STATUS_IS_OK(status)) {
+   set_saved_ntstatus(status);
+   }
+   return fsp;
}
 
/* We add aARCH to this as this mode is only used if the file is

Modified: trunk/source/smbd/reply.c
===
--- trunk/source/smbd/reply.c   2006-05-19 19:54:39 UTC (rev 15721)
+++ trunk/source/smbd/reply.c   2006-05-19 20:40:44 UTC (rev 15722)
@@ -3591,6 +3591,8 @@
 {
int outsize = 0;
files_struct *fsp;
+   NTSTATUS status;
+   
START_PROFILE(SMBsplopen);

if (!CAN_PRINT(conn)) {
@@ -3599,11 +3601,11 @@
}
 
/* Open for exclusive use, write only. */
-   fsp = print_fsp_open(conn, NULL);
+   status = print_fsp_open(conn, NULL, fsp);
 
-   if (!fsp) {
+   if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBsplopen);
-   return(UNIXERROR(ERRDOS,ERRnoaccess));
+   return(ERROR_NT(status));
}
 
outsize = set_message(outbuf,1,0,True);



svn commit: samba r15724 - in trunk/source/smbd: .

2006-05-19 Thread vlendec
Author: vlendec
Date: 2006-05-19 21:06:28 + (Fri, 19 May 2006)
New Revision: 15724

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15724

Log:
Convert dup_file_fsp not to use set_saved_ntstatus

Volker

Modified:
   trunk/source/smbd/files.c
   trunk/source/smbd/open.c


Changeset:
Modified: trunk/source/smbd/files.c
===
--- trunk/source/smbd/files.c   2006-05-19 20:57:10 UTC (rev 15723)
+++ trunk/source/smbd/files.c   2006-05-19 21:06:28 UTC (rev 15724)
@@ -522,10 +522,11 @@
  Duplicate the file handle part for a DOS or FCB open.
 /
 
-files_struct *dup_file_fsp(files_struct *fsp,
+NTSTATUS dup_file_fsp(files_struct *fsp,
uint32 access_mask,
uint32 share_access,
-   uint32 create_options)
+   uint32 create_options,
+   files_struct **result)
 {
NTSTATUS status;
files_struct *dup_fsp;
@@ -533,8 +534,7 @@
status = file_new(fsp-conn, dup_fsp);
 
if (!NT_STATUS_IS_OK(status)) {
-   set_saved_ntstatus(status);
-   return NULL;
+   return status;
}
 
SAFE_FREE(dup_fsp-fh);
@@ -569,5 +569,6 @@
dup_fsp-aio_write_behind = fsp-aio_write_behind;
 string_set(dup_fsp-fsp_name,fsp-fsp_name);
 
-   return dup_fsp;
+   *result = dup_fsp;
+   return NT_STATUS_OK;
 }

Modified: trunk/source/smbd/open.c
===
--- trunk/source/smbd/open.c2006-05-19 20:57:10 UTC (rev 15723)
+++ trunk/source/smbd/open.c2006-05-19 21:06:28 UTC (rev 15724)
@@ -884,8 +884,8 @@
}
 
/* We need to duplicate this fsp. */
-   dup_fsp = dup_file_fsp(fsp, access_mask, share_access, create_options);
-   if (!dup_fsp) {
+   if (!NT_STATUS_IS_OK(dup_file_fsp(fsp, access_mask, share_access,
+ create_options, dup_fsp))) {
return NULL;
}
 



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

2006-05-19 Thread idra
Author: idra
Date: 2006-05-19 21:12:26 + (Fri, 19 May 2006)
New Revision: 15725

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15725

Log:

First shot at making password_hash async
The async path is not yet enabled by default so it should make no harm


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


Changeset:
Sorry, the patch is too large (1161 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15725


svn commit: samba r15726 - in branches/SAMBA_4_0/source/libnet: .

2006-05-19 Thread mimir
Author: mimir
Date: 2006-05-19 21:28:28 + (Fri, 19 May 2006)
New Revision: 15726

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15726

Log:
Comments and a couple of minor formattings in the code.


rafal


Modified:
   branches/SAMBA_4_0/source/libnet/userman.c


Changeset:
Sorry, the patch is too large (529 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15726


Build status as of Sat May 20 00:00:03 2006

2006-05-19 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2006-05-19 
00:00:53.0 +
+++ /home/build/master/cache/broken_results.txt 2006-05-20 00:00:30.0 
+
@@ -1,17 +1,17 @@
-Build status as of Fri May 19 00:00:03 2006
+Build status as of Sat May 20 00:00:03 2006
 
 Build counts:
 Tree Total  Broken Panic 
-ccache   34 3  0 
-distcc   36 3  0 
-lorikeet-heimdal 35 23 0 
+ccache   33 3  0 
+distcc   34 3  0 
+lorikeet-heimdal 33 23 0 
 ppp  21 0  0 
-rsync37 3  0 
-samba6  2  0 
+rsync36 4  0 
+samba4  2  0 
 samba-docs   0  0  0 
-samba4   42 34 10
-samba_3_039 18 0 
-smb-build31 1  0 
-talloc   28 14 0 
-tdb  28 4  0 
+samba4   42 27 7 
+samba_3_038 14 0 
+smb-build30 1  0 
+talloc   24 11 0 
+tdb  24 3  0 
 


svn commit: samba r15727 - in branches/SAMBA_3_0/source/torture: .

2006-05-19 Thread jra
Author: jra
Date: 2006-05-20 02:04:19 + (Sat, 20 May 2006)
New Revision: 15727

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15727

Log:
Fix msgtest - noticed by Aleksey Fedoseev [EMAIL PROTECTED].
Jeremy.

Modified:
   branches/SAMBA_3_0/source/torture/msgtest.c


Changeset:
Modified: branches/SAMBA_3_0/source/torture/msgtest.c
===
--- branches/SAMBA_3_0/source/torture/msgtest.c 2006-05-19 21:28:28 UTC (rev 
15726)
+++ branches/SAMBA_3_0/source/torture/msgtest.c 2006-05-20 02:04:19 UTC (rev 
15727)
@@ -39,6 +39,8 @@
int i, n;
char buf[12];
 
+   load_case_tables();
+
setup_logging(argv[0],True);

lp_load(dyn_CONFIGFILE,False,False,False,True);



svn commit: samba r15728 - in trunk/source/torture: .

2006-05-19 Thread jra
Author: jra
Date: 2006-05-20 02:05:33 + (Sat, 20 May 2006)
New Revision: 15728

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15728

Log:
Fix msgtest - noticed by Aleksey Fedoseev [EMAIL PROTECTED].
Jeremy.

Modified:
   trunk/source/torture/msgtest.c


Changeset:
Modified: trunk/source/torture/msgtest.c
===
--- trunk/source/torture/msgtest.c  2006-05-20 02:04:19 UTC (rev 15727)
+++ trunk/source/torture/msgtest.c  2006-05-20 02:05:33 UTC (rev 15728)
@@ -39,6 +39,8 @@
int i, n;
char buf[12];
 
+   load_case_tables();
+
setup_logging(argv[0],True);

lp_load(dyn_CONFIGFILE,False,False,False,True);



svn commit: samba r15729 - in branches/SAMBA_3_0/source/torture: .

2006-05-19 Thread jra
Author: jra
Date: 2006-05-20 02:09:35 + (Sat, 20 May 2006)
New Revision: 15729

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15729

Log:
Second part of Aleksey Fedoseev [EMAIL PROTECTED] patch.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/torture/msgtest.c


Changeset:
Modified: branches/SAMBA_3_0/source/torture/msgtest.c
===
--- branches/SAMBA_3_0/source/torture/msgtest.c 2006-05-20 02:05:33 UTC (rev 
15728)
+++ branches/SAMBA_3_0/source/torture/msgtest.c 2006-05-20 02:09:35 UTC (rev 
15729)
@@ -25,6 +25,24 @@
 
 static int pong_count;
 
+
+/* samba4 timeval functions */
+
+double timeval_elapsed2(const struct timeval *tv1, const struct timeval *tv2)
+{
+return (tv2-tv_sec - tv1-tv_sec) +
+   (tv2-tv_usec - tv1-tv_usec)*1.0e-6;
+}
+
+/**
+  return the number of seconds elapsed since a given time
+*/
+double timeval_elapsed(const struct timeval *tv)
+{
+struct timeval tv2 = timeval_current();
+return timeval_elapsed2(tv, tv2);
+}
+
 /
 a useful function for testing the message system
 /
@@ -85,9 +103,44 @@
 
if (pong_count != 2) {
fprintf(stderr, Duplicate filter failed (%d).\n, pong_count);
-   exit(1);
}
 
+   /* Speed testing */
+
+   pong_count = 0;
+
+   {
+   struct timeval tv = timeval_current();
+   size_t timelimit = n;
+   size_t ping_count = 0;
+
+   printf(Sending pings for %d seconds\n, timelimit);
+   while (timeval_elapsed(tv)  timelimit) {  

+   if(message_send_pid(pid_to_procid(pid), MSG_PING,
+   buf, 11, 
False)) ping_count++;
+   if(message_send_pid(pid_to_procid(pid), MSG_PING,
+   NULL, 0, 
False)) ping_count++;
+
+   while (ping_count  pong_count + 20) {
+   message_dispatch();
+   }
+   }
+   
+   printf(waiting for %d remaining replies (done %d)\n, 
+  ping_count - pong_count, pong_count);
+   while (timeval_elapsed(tv)  30  pong_count  ping_count) {
+   message_dispatch();
+   }
+   
+   if (ping_count != pong_count) {
+   fprintf(stderr, ping test failed! received %d, sent 
%d\n, 
+  pong_count, ping_count);
+   }
+   
+   printf(ping rate of %.0f messages/sec\n, 
+  (ping_count+pong_count)/timeval_elapsed(tv));
+   }
+
return (0);
 }
 



svn commit: samba r15731 - in branches/SAMBA_4_0/source/scripting/ejs: .

2006-05-19 Thread tridge
Author: tridge
Date: 2006-05-20 03:08:44 + (Sat, 20 May 2006)
New Revision: 15731

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15731

Log:

module init functions should return NTSTATUS, not void

Modified:
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_config.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_data.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_ldb.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_nbt.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_nss.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rand.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_samba3.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_string.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_sys.c


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c
===
--- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c 2006-05-20 
02:09:38 UTC (rev 15730)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c 2006-05-20 
03:08:44 UTC (rev 15731)
@@ -187,8 +187,9 @@
 /*
   setup C functions that be called from ejs
 */
-void smb_setup_ejs_auth(void)
+NTSTATUS smb_setup_ejs_auth(void)
 {
ejsDefineCFunction(-1, userAuth, ejs_userAuth, NULL, 
MPR_VAR_SCRIPT_HANDLE);
ejsDefineCFunction(-1, system_session, ejs_system_session, NULL, 
MPR_VAR_SCRIPT_HANDLE);
+   return NT_STATUS_OK;
 }

Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_config.c
===
--- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_config.c   2006-05-20 
02:09:38 UTC (rev 15730)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_config.c   2006-05-20 
03:08:44 UTC (rev 15731)
@@ -215,7 +215,8 @@
 /*
   setup C functions that be called from ejs
 */
-void smb_setup_ejs_config(void)
+NTSTATUS smb_setup_ejs_config(void)
 {
ejsDefineCFunction(-1, loadparm_init, ejs_loadparm_init, NULL, 
MPR_VAR_SCRIPT_HANDLE);
+   return NT_STATUS_OK;
 }

Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_data.c
===
--- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_data.c 2006-05-20 
02:09:38 UTC (rev 15730)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_data.c 2006-05-20 
03:08:44 UTC (rev 15731)
@@ -278,7 +278,8 @@
 /*
   setup C functions that be called from ejs
 */
-void smb_setup_ejs_datablob(void)
+NTSTATUS smb_setup_ejs_datablob(void)
 {
ejsDefineCFunction(-1, datablob_init, ejs_datablob_init, NULL, 
MPR_VAR_SCRIPT_HANDLE);
+   return NT_STATUS_OK;
 }

Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_ldb.c
===
--- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_ldb.c  2006-05-20 
02:09:38 UTC (rev 15730)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_ldb.c  2006-05-20 
03:08:44 UTC (rev 15731)
@@ -556,7 +556,8 @@
 /*
   setup C functions that be called from ejs
 */
-void smb_setup_ejs_ldb(void)
+NTSTATUS smb_setup_ejs_ldb(void)
 {
ejsDefineCFunction(-1, ldb_init, ejs_ldb_init, NULL, 
MPR_VAR_SCRIPT_HANDLE);
+   return NT_STATUS_OK;
 }

Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_nbt.c
===
--- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_nbt.c  2006-05-20 
02:09:38 UTC (rev 15730)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_nbt.c  2006-05-20 
03:08:44 UTC (rev 15731)
@@ -87,7 +87,8 @@
 /*
   setup C functions that be called from ejs
 */
-void smb_setup_ejs_nbt(void)
+NTSTATUS smb_setup_ejs_nbt(void)
 {
ejsDefineCFunction(-1, resolveName, ejs_resolve_name, NULL, 
MPR_VAR_SCRIPT_HANDLE);
+   return NT_STATUS_OK;
 }

Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_nss.c
===
--- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_nss.c  2006-05-20 
02:09:38 UTC (rev 15730)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_nss.c  2006-05-20 
03:08:44 UTC (rev 15731)
@@ -154,7 +154,8 @@
 /*
   setup C functions that be called from ejs
 */
-void smb_setup_ejs_nss(void)
+NTSTATUS smb_setup_ejs_nss(void)
 {
ejsDefineCFunction(-1, nss_init, ejs_nss_init, NULL, 
MPR_VAR_SCRIPT_HANDLE);
+   return NT_STATUS_OK;
 }

Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rand.c
===
--- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rand.c 2006-05-20 
02:09:38 UTC (rev 15730)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rand.c 2006-05-20 
03:08:44 UTC (rev 15731)
@@ -98,7 +98,8 @@
 /*
   setup C functions that be called from ejs
 */
-void smb_setup_ejs_random(void)