svn commit: samba r14921 - in branches/SAMBA_4_0/source/librpc/idl: .

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-05 06:25:32 + (Wed, 05 Apr 2006)
New Revision: 14921

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

Log:

I forgot to commit the IDL change for the subdir_filter

Modified:
   branches/SAMBA_4_0/source/librpc/idl/notify.idl


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/notify.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/notify.idl 2006-04-05 05:54:10 UTC 
(rev 14920)
+++ branches/SAMBA_4_0/source/librpc/idl/notify.idl 2006-04-05 06:25:32 UTC 
(rev 14921)
@@ -16,8 +16,8 @@
/* structure used in the notify database */
typedef [public] struct {
uint32 server;
-   uint32 filter;
-   boolean32 recursive;
+   uint32 filter; /* filter to apply in this directory */
+   uint32 subdir_filter; /* filter to apply in child directories */
utf8string path;
pointer private;
} notify_entry;



svn commit: samba r14922 - branches/SAMBA_3_0/source/param trunk/source/param

2006-04-05 Thread lmuelle
Author: lmuelle
Date: 2006-04-05 07:29:22 + (Wed, 05 Apr 2006)
New Revision: 14922

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

Log:
Use BOOL for the returned value.

Modified:
   branches/SAMBA_3_0/source/param/loadparm.c
   trunk/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_0/source/param/loadparm.c
===
--- branches/SAMBA_3_0/source/param/loadparm.c  2006-04-05 06:25:32 UTC (rev 
14921)
+++ branches/SAMBA_3_0/source/param/loadparm.c  2006-04-05 07:29:22 UTC (rev 
14922)
@@ -3877,7 +3877,8 @@
 BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal)
 {
service * pService = ServicePtrs[snum];
-   int i, result = False;
+   int i;
+   BOOL result = False;
parm_class p_class;
unsigned flag = 0;
fstring local_parm_name;

Modified: trunk/source/param/loadparm.c
===
--- trunk/source/param/loadparm.c   2006-04-05 06:25:32 UTC (rev 14921)
+++ trunk/source/param/loadparm.c   2006-04-05 07:29:22 UTC (rev 14922)
@@ -3877,7 +3877,8 @@
 BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal)
 {
service * pService = ServicePtrs[snum];
-   int i, result = False;
+   int i;
+   BOOL result = False;
parm_class p_class;
unsigned flag = 0;
fstring local_parm_name;



svn commit: samba r14923 - branches/SAMBA_3_0/source/param trunk/source/param

2006-04-05 Thread lmuelle
Author: lmuelle
Date: 2006-04-05 07:44:14 + (Wed, 05 Apr 2006)
New Revision: 14923

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

Log:
Return False in the case a parametrical option is not configured in
the config file.

For a somesettings: foo =  we still return an empty line.

Modified:
   branches/SAMBA_3_0/source/param/loadparm.c
   trunk/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_0/source/param/loadparm.c
===
--- branches/SAMBA_3_0/source/param/loadparm.c  2006-04-05 07:29:22 UTC (rev 
14922)
+++ branches/SAMBA_3_0/source/param/loadparm.c  2006-04-05 07:44:14 UTC (rev 
14923)
@@ -3883,6 +3883,7 @@
unsigned flag = 0;
fstring local_parm_name;
char *parm_opt;
+   const char *parm_opt_value;
 
/* check for parametrical option */
fstrcpy( local_parm_name, parm_name);
@@ -3892,9 +3893,12 @@
*parm_opt = '\0';
parm_opt++;
if (strlen(parm_opt)) {
-   printf( %s\n, lp_parm_const_string( snum,
-   local_parm_name, parm_opt, ));
-   result = True;
+   parm_opt_value = lp_parm_const_string( snum,
+   local_parm_name, parm_opt, NULL);
+   if (parm_opt_value) {
+   printf( %s\n, parm_opt_value);
+   result = True;
+   }
}
return result;
}

Modified: trunk/source/param/loadparm.c
===
--- trunk/source/param/loadparm.c   2006-04-05 07:29:22 UTC (rev 14922)
+++ trunk/source/param/loadparm.c   2006-04-05 07:44:14 UTC (rev 14923)
@@ -3883,6 +3883,7 @@
unsigned flag = 0;
fstring local_parm_name;
char *parm_opt;
+   const char *parm_opt_value;
 
/* check for parametrical option */
fstrcpy( local_parm_name, parm_name);
@@ -3892,9 +3893,12 @@
*parm_opt = '\0';
parm_opt++;
if (strlen(parm_opt)) {
-   printf( %s\n, lp_parm_const_string( snum,
-   local_parm_name, parm_opt, ));
-   result = True;
+   parm_opt_value = lp_parm_const_string( snum,
+   local_parm_name, parm_opt, NULL);
+   if (parm_opt_value) {
+   printf( %s\n, parm_opt_value);
+   result = True;
+   }
}
return result;
}



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

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-05 08:50:33 + (Wed, 05 Apr 2006)
New Revision: 14924

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

Log:

when handling recursive change notify, the client expects a windows
path name back

Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c 2006-04-05 07:44:14 UTC 
(rev 14923)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c 2006-04-05 08:50:33 UTC 
(rev 14924)
@@ -113,6 +113,7 @@
n-changes = talloc_realloc(n, n-changes, struct notify_changes, 
n-num_changes+1);
n-changes[n-num_changes].action = ev-action;
n-changes[n-num_changes].name.s = talloc_strdup(n-changes, ev-path);
+   string_replace(n-changes[n-num_changes].name.s, '/', '\\');
n-num_changes++;
 
/*



svn commit: samba r14925 - in branches/SAMBA_4_0/source/ntvfs: posix sysdep

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-05 08:52:03 + (Wed, 05 Apr 2006)
New Revision: 14925

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

Log:

trigger NOTIFY_ACTION_OLD_NAME and NOTIFY_ACTION_NEW_NAME events for
renames, if in the same directory. For renames between directories
generate NOTIFY_ACTION_REMOVED and NOTIFY_ACTION_ADDED

Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_setfileinfo.c
   branches/SAMBA_4_0/source/ntvfs/sysdep/sys_notify.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c 2006-04-05 08:50:33 UTC 
(rev 14924)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c 2006-04-05 08:52:03 UTC 
(rev 14925)
@@ -24,7 +24,51 @@
 #include vfs_posix.h
 #include librpc/gen_ndr/security.h
 
+
 /*
+  do a file rename, and send any notify triggers
+*/
+NTSTATUS pvfs_do_rename(struct pvfs_state *pvfs, const char *name1, const char 
*name2)
+{
+   const char *r1, *r2;
+
+   if (rename(name1, name2) == -1) {
+   return pvfs_map_errno(pvfs, errno);
+   }
+
+   /* 
+  renames to the same directory cause a OLD_NAME-NEW_NAME notify.
+  renames to a different directory are considered a remove/add 
+   */
+   r1 = strrchr_m(name1, '/');
+   r2 = strrchr_m(name2, '/');
+
+   if ((r1-name1) != (r2-name2) ||
+   strncmp(name1, name2, r1-name1) != 0) {
+   notify_trigger(pvfs-notify_context, 
+  NOTIFY_ACTION_REMOVED, 
+  FILE_NOTIFY_CHANGE_FILE_NAME,
+  name1);
+   notify_trigger(pvfs-notify_context, 
+  NOTIFY_ACTION_ADDED, 
+  FILE_NOTIFY_CHANGE_FILE_NAME,
+  name2);
+   } else {
+   notify_trigger(pvfs-notify_context, 
+  NOTIFY_ACTION_OLD_NAME, 
+  FILE_NOTIFY_CHANGE_FILE_NAME,
+  name1);
+   notify_trigger(pvfs-notify_context, 
+  NOTIFY_ACTION_NEW_NAME, 
+  FILE_NOTIFY_CHANGE_FILE_NAME,
+  name2);
+   }
+   
+   return NT_STATUS_OK;
+}
+
+
+/*
   resolve a wildcard rename pattern. This works on one component of the name
 */
 static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx, 
@@ -173,18 +217,10 @@
return NT_STATUS_NO_MEMORY;
}
 
-   if (rename(name1-full_name, fname2) == -1) {
-   talloc_free(mem_ctx);
-   return pvfs_map_errno(pvfs, errno);
-   }
+   status = pvfs_do_rename(pvfs, name1-full_name, fname2);
 
-   status = odb_rename(lck, fname2);
-
if (NT_STATUS_IS_OK(status)) {
-   notify_trigger(pvfs-notify_context, 
-  NOTIFY_ACTION_MODIFIED, 
-  FILE_NOTIFY_CHANGE_FILE_NAME,
-  name1-full_name);
+   status = odb_rename(lck, fname2);
}
 
 failed:
@@ -302,11 +338,10 @@
return status;
}
 
-   if (rename(name1-full_name, name2-full_name) == -1) {
-   return pvfs_map_errno(pvfs, errno);
+   status = pvfs_do_rename(pvfs, name1-full_name, name2-full_name);
+   if (NT_STATUS_IS_OK(status)) {
+   status = odb_rename(lck, name2-full_name);
}
-
-   status = odb_rename(lck, name2-full_name);

return NT_STATUS_OK;
 }
@@ -375,19 +410,14 @@
switch (ren-ntrename.in.flags) {
case RENAME_FLAG_RENAME:
status = pvfs_access_check_parent(pvfs, req, name2, 
SEC_DIR_ADD_FILE);
-   if (!NT_STATUS_IS_OK(status)) {
-   return status;
-   }
-   if (rename(name1-full_name, name2-full_name) == -1) {
-   return pvfs_map_errno(pvfs, errno);
-   }
+   NT_STATUS_NOT_OK_RETURN(status);
+   status = pvfs_do_rename(pvfs, name1-full_name, 
name2-full_name);
+   NT_STATUS_NOT_OK_RETURN(status);
break;
 
case RENAME_FLAG_HARD_LINK:
status = pvfs_access_check_parent(pvfs, req, name2, 
SEC_DIR_ADD_FILE);
-   if (!NT_STATUS_IS_OK(status)) {
-   return status;
-   }
+   NT_STATUS_NOT_OK_RETURN(status);
if (link(name1-full_name, name2-full_name) == -1) {
return pvfs_map_errno(pvfs, errno);
}
@@ -395,9 +425,7 @@
 
case RENAME_FLAG_COPY:
status = pvfs_access_check_parent(pvfs, req, name2, 
SEC_DIR_ADD_FILE);
-   if 

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

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-05 08:52:55 + (Wed, 05 Apr 2006)
New Revision: 14926

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

Log:

change the inotify backend to implement the rather unusual semantics
for rename. The cookies in inotify tell us (indirectly!) if its a
rename between directories or not

Modified:
   branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c
===
--- branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c2006-04-05 08:52:03 UTC 
(rev 14925)
+++ branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c2006-04-05 08:52:55 UTC 
(rev 14926)
@@ -90,8 +90,13 @@
 
 /*
   dispatch one inotify event
+  
+  the cookies are used to correctly handle renames
 */
-static void inotify_dispatch(struct inotify_private *in, struct inotify_event 
*e)
+static void inotify_dispatch(struct inotify_private *in, 
+struct inotify_event *e, 
+uint32_t prev_cookie,
+uint32_t next_cookie)
 {
struct watch_context *w;
struct notify_event ne;
@@ -101,11 +106,24 @@
return;
}
 
-   /* map the inotify mask to a action */
+   /* map the inotify mask to a action. This gets complicated for
+  renames */
if (e-mask  IN_CREATE) {
ne.action = NOTIFY_ACTION_ADDED;
} else if (e-mask  IN_DELETE) {
ne.action = NOTIFY_ACTION_REMOVED;
+   } else if (e-mask  IN_MOVED_FROM) {
+   if (e-cookie == next_cookie) {
+   ne.action = NOTIFY_ACTION_OLD_NAME;
+   } else {
+   ne.action = NOTIFY_ACTION_REMOVED;
+   }
+   } else if (e-mask  IN_MOVED_TO) {
+   if (e-cookie == prev_cookie) {
+   ne.action = NOTIFY_ACTION_NEW_NAME;
+   } else {
+   ne.action = NOTIFY_ACTION_ADDED;
+   }
} else {
ne.action = NOTIFY_ACTION_MODIFIED;
}
@@ -129,6 +147,7 @@
struct inotify_private *in = talloc_get_type(private, struct 
inotify_private);
int bufsize = 0;
struct inotify_event *e0, *e;
+   uint32_t prev_cookie=0;
 
/*
  we must use FIONREAD as we cannot predict the length of the
@@ -152,9 +171,14 @@
 
/* we can get more than one event in the buffer */
while (bufsize = sizeof(*e)) {
-   inotify_dispatch(in, e);
+   struct inotify_event *e2 = NULL;
bufsize -= e-len + sizeof(*e);
-   e = (struct inotify_event *)(e-len + sizeof(*e) + (char *)e);
+   if (bufsize = sizeof(*e)) {
+   e2 = (struct inotify_event *)(e-len + sizeof(*e) + 
(char *)e);
+   }
+   inotify_dispatch(in, e, prev_cookie, e2?e2-cookie:0);
+   prev_cookie = e-cookie;
+   e = e2;
}
 
talloc_free(e0);



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

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-05 08:56:16 + (Wed, 05 Apr 2006)
New Revision: 14927

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

Log:

expand the RAW-NOTIFY test to test recursive and rename handling

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/notify.c
===
--- branches/SAMBA_4_0/source/torture/raw/notify.c  2006-04-05 08:52:55 UTC 
(rev 14926)
+++ branches/SAMBA_4_0/source/torture/raw/notify.c  2006-04-05 08:56:16 UTC 
(rev 14927)
@@ -250,6 +250,120 @@
return ret;
 }
 
+
+/* 
+   testing of recursive change notify
+*/
+static BOOL test_notify_recursive(struct smbcli_state *cli, TALLOC_CTX 
*mem_ctx)
+{
+   BOOL ret = True;
+   NTSTATUS status;
+   struct smb_notify notify;
+   union smb_open io;
+   int fnum;
+   struct smbcli_request *req1, *req2;
+
+   printf(TESTING CHANGE NOTIFY WITH RECURSION\n);
+   
+   /*
+ get a handle on the directory
+   */
+   io.generic.level = RAW_OPEN_NTCREATEX;
+   io.ntcreatex.in.root_fid = 0;
+   io.ntcreatex.in.flags = 0;
+   io.ntcreatex.in.access_mask = SEC_FILE_ALL;
+   io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
+   io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
+   io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ | 
NTCREATEX_SHARE_ACCESS_WRITE;
+   io.ntcreatex.in.alloc_size = 0;
+   io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
+   io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
+   io.ntcreatex.in.security_flags = 0;
+   io.ntcreatex.in.fname = BASEDIR;
+
+   status = smb_raw_open(cli-tree, mem_ctx, io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   fnum = io.ntcreatex.out.file.fnum;
+
+   /* ask for a change notify, on file or directory name
+  changes. Setup both with and without recursion */
+   notify.in.buffer_size = 1000;
+   notify.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
+   notify.in.file.fnum = fnum;
+
+   notify.in.recursive = True;
+   req1 = smb_raw_changenotify_send(cli-tree, notify);
+
+   notify.in.recursive = False;
+   req2 = smb_raw_changenotify_send(cli-tree, notify);
+
+   /* cancel initial requests so the buffer is setup */
+   smb_raw_ntcancel(req1);
+   status = smb_raw_changenotify_recv(req1, mem_ctx, notify);
+   CHECK_STATUS(status, NT_STATUS_CANCELLED);
+
+   smb_raw_ntcancel(req2);
+   status = smb_raw_changenotify_recv(req2, mem_ctx, notify);
+   CHECK_STATUS(status, NT_STATUS_CANCELLED);
+
+   smbcli_mkdir(cli-tree, BASEDIR \\subdir-name);
+   smbcli_mkdir(cli-tree, BASEDIR \\subdir-name\\subname1);
+   smbcli_mkdir(cli-tree, BASEDIR \\subdir-name\\subname2);
+   smbcli_rename(cli-tree, BASEDIR \\subdir-name\\subname1, BASEDIR 
\\subdir-name\\subname1-r);
+   smbcli_rename(cli-tree, BASEDIR \\subdir-name\\subname2, BASEDIR 
\\subname2-r);
+   smbcli_rename(cli-tree, BASEDIR \\subname2-r, BASEDIR 
\\subname3-r);
+
+   notify.in.recursive = True;
+   req1 = smb_raw_changenotify_send(cli-tree, notify);
+
+   smbcli_rmdir(cli-tree, BASEDIR \\subdir-name\\subname1-r);
+   smbcli_rmdir(cli-tree, BASEDIR \\subdir-name);
+   smbcli_rmdir(cli-tree, BASEDIR \\subname3-r);
+
+   notify.in.recursive = False;
+   req2 = smb_raw_changenotify_send(cli-tree, notify);
+
+   status = smb_raw_changenotify_recv(req1, mem_ctx, notify);
+   CHECK_STATUS(status, NT_STATUS_OK);
+
+   CHECK_VAL(notify.out.num_changes, 9);
+   CHECK_VAL(notify.out.changes[0].action, NOTIFY_ACTION_ADDED);
+   CHECK_WSTR(notify.out.changes[0].name, subdir-name, STR_UNICODE);
+   CHECK_VAL(notify.out.changes[1].action, NOTIFY_ACTION_ADDED);
+   CHECK_WSTR(notify.out.changes[1].name, subdir-name\\subname1, 
STR_UNICODE);
+   CHECK_VAL(notify.out.changes[2].action, NOTIFY_ACTION_ADDED);
+   CHECK_WSTR(notify.out.changes[2].name, subdir-name\\subname2, 
STR_UNICODE);
+   CHECK_VAL(notify.out.changes[3].action, NOTIFY_ACTION_OLD_NAME);
+   CHECK_WSTR(notify.out.changes[3].name, subdir-name\\subname1, 
STR_UNICODE);
+   CHECK_VAL(notify.out.changes[4].action, NOTIFY_ACTION_NEW_NAME);
+   CHECK_WSTR(notify.out.changes[4].name, subdir-name\\subname1-r, 
STR_UNICODE);
+
+   CHECK_VAL(notify.out.changes[5].action, NOTIFY_ACTION_REMOVED);
+   CHECK_WSTR(notify.out.changes[5].name, subdir-name\\subname2, 
STR_UNICODE);
+   CHECK_VAL(notify.out.changes[6].action, NOTIFY_ACTION_ADDED);
+   CHECK_WSTR(notify.out.changes[6].name, subname2-r, STR_UNICODE);
+
+   CHECK_VAL(notify.out.changes[7].action, NOTIFY_ACTION_OLD_NAME);
+   CHECK_WSTR(notify.out.changes[7].name, subname2-r, STR_UNICODE);
+   

svn commit: samba r14928 - in branches/SAMBA_4_0/source: ntvfs/posix torture/raw

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-05 09:06:09 + (Wed, 05 Apr 2006)
New Revision: 14928

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

Log:

demonstrate that the completion filter is only set on the first notify
on a directory handle

Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c
   branches/SAMBA_4_0/source/torture/raw/notify.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c 2006-04-05 08:56:16 UTC 
(rev 14927)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c 2006-04-05 09:06:09 UTC 
(rev 14928)
@@ -213,6 +213,8 @@
NT_STATUS_NOT_OK_RETURN(status);
}
 
+   /* we update the max_buffer_size on each call, but we do not
+  update the recursive flag or filter */
f-notify_buffer-max_buffer_size = info-in.buffer_size;
 
pending = talloc(f-notify_buffer, struct notify_pending);

Modified: branches/SAMBA_4_0/source/torture/raw/notify.c
===
--- branches/SAMBA_4_0/source/torture/raw/notify.c  2006-04-05 08:56:16 UTC 
(rev 14927)
+++ branches/SAMBA_4_0/source/torture/raw/notify.c  2006-04-05 09:06:09 UTC 
(rev 14928)
@@ -313,6 +313,7 @@
smbcli_rename(cli-tree, BASEDIR \\subdir-name\\subname2, BASEDIR 
\\subname2-r);
smbcli_rename(cli-tree, BASEDIR \\subname2-r, BASEDIR 
\\subname3-r);
 
+   notify.in.completion_filter = 0;
notify.in.recursive = True;
req1 = smb_raw_changenotify_send(cli-tree, notify);
 



svn commit: samba-web r951 - in trunk/news/developers: .

2006-04-05 Thread deryck
Author: deryck
Date: 2006-04-05 14:40:00 + (Wed, 05 Apr 2006)
New Revision: 951

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

Log:
Add link to ZDNet article on our quick response to Coverity.

deryck
Added:
   trunk/news/developers/zdnet_quick_response.html


Changeset:
Added: trunk/news/developers/zdnet_quick_response.html
===
--- trunk/news/developers/zdnet_quick_response.html 2006-04-03 23:45:56 UTC 
(rev 950)
+++ trunk/news/developers/zdnet_quick_response.html 2006-04-05 14:40:00 UTC 
(rev 951)
@@ -0,0 +1,24 @@
+h3a name=zdnet_quick_responseZDNet on Samba's Quick 
Response/a/h3 
+
+div class=article
+   pZDNet is reporting that 
+   a 
href=http://news.zdnet.co.uk/software/applications/0,39020384,39261434,00.htm;open
+   source coders' speed astounds Coverity/a.  This is in reaction to 
+   the speed with which potential bugs reported by Coverity have been
+   cleaned up./p
+   
+   blockquote
+   My impression is that the open source community is producing software 
+   defect patches at an extremely fast rate, Ben Chelf, the chief 
technology 
+   officer at Coverity, said in the statement.
+   /blockquote
+   
+   pSamba is mentioned specifically, too./p
+   
+   blockquoteSamba, a popular open source project used to connect Linux 
+   and Microsoft Windows networks, showed the fastest developer response, 
+   Coverity said. The number of flaws was reduced from 216 to 18 in one 
week 
+   and to zero in two weeks./blockquote
+/div
+
+   



svn commit: samba r14930 - in branches/SAMBA_4_0/source/build/smb_build: .

2006-04-05 Thread jpeach
Author: jpeach
Date: 2006-04-05 23:54:12 + (Wed, 05 Apr 2006)
New Revision: 14930

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

Log:
Coalesce the feature enabled tests so that the config summary always
emits a yes or a no.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/summary.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/summary.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/summary.pm2006-04-05 
09:44:20 UTC (rev 14929)
+++ branches/SAMBA_4_0/source/build/smb_build/summary.pm2006-04-05 
23:54:12 UTC (rev 14930)
@@ -7,6 +7,13 @@
 package summary;
 use strict;
 
+sub enabled($)
+{
+my ($val) = @_;
+
+return (defined($val)  $val =~ m/yes|true/i);
+}
+
 sub showitem($$$)
 {
my ($output,$desc,$items) = @_;
@@ -14,7 +21,7 @@
my @need = ();
 
foreach (@$items) {
-   if ($output-{EXT_LIB_$_}-{ENABLE} ne YES) {
+   if (!enabled($output-{EXT_LIB_$_}-{ENABLE})) {
push (@need, $_);
}
}
@@ -40,24 +47,19 @@
showitem($output, using extended attributes, [XATTR]);
showitem($output, using libblkid, [BLKID]);
showitem($output, using pam, [PAM]);
-   print Using external popt: 
.lc($output-{EXT_LIB_POPT}-{ENABLE}).\n;
-   print Developer mode: .lc($config-{developer}).\n;
-   print Automatic dependencies: ;
+   print Using external popt: .
+   (enabled($output-{EXT_LIB_POPT}-{ENABLE})?yes:no).\n;
+   print Developer mode: 
.(enabled($config-{developer})?yes:no).\n;
+   print Automatic dependencies: .
+   (enabled($config-{automatic_dependencies})
+   ? yes : no (install GNU make = 3.81)) .
+\n;

-   if ($config-{automatic_dependencies} eq yes) {
-   print yes\n;
-   } else {
-   print no (install GNU make = 3.81)\n;
-   }
-   
-   print Using shared libraries internally (experimental): ;
+   print Using shared libraries internally (experimental):  .
+   (enabled($config-{BLDSHARED})
+   ? yes : no (try --enable-dso)) .
+   \n;
 
-   if ($config-{BLDSHARED} eq true) {
-   print yes\n;
-   } else {
-   print no (try --enable-dso)\n;
-
-   }
print \n;
 }
 



Build status as of Thu Apr 6 00:00:02 2006

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

--- /home/build/master/cache/broken_results.txt.old 2006-04-05 
00:00:04.0 +
+++ /home/build/master/cache/broken_results.txt 2006-04-06 00:00:51.0 
+
@@ -1,17 +1,17 @@
-Build status as of Wed Apr  5 00:00:02 2006
+Build status as of Thu Apr  6 00:00:02 2006
 
 Build counts:
 Tree Total  Broken Panic 
 ccache   33 3  0 
 distcc   33 4  0 
-lorikeet-heimdal 27 27 0 
-ppp  20 0  0 
+lorikeet-heimdal 28 27 0 
+ppp  19 0  0 
 rsync32 2  0 
 samba2  0  0 
 samba-docs   0  0  0 
-samba4   38 33 1 
-samba_3_034 7  0 
+samba4   38 30 0 
+samba_3_034 6  0 
 smb-build26 0  0 
-talloc   30 15 0 
-tdb  30 4  0 
+talloc   30 14 0 
+tdb  30 3  0 
 


svn commit: samba r14931 - branches/SAMBA_3_0/source/libads trunk/source/libads

2006-04-05 Thread jmcd
Author: jmcd
Date: 2006-04-06 01:46:01 + (Thu, 06 Apr 2006)
New Revision: 14931

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

Log:
Fix #1374: can't join an OU with name that contains '#'

I had to eliminate \ as an OU path separator, because it is the escape
char in LDAP.  We still accept /, but using the escape char is just
not a good choice.


Modified:
   branches/SAMBA_3_0/source/libads/ldap.c
   trunk/source/libads/ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ldap.c
===
--- branches/SAMBA_3_0/source/libads/ldap.c 2006-04-05 23:54:12 UTC (rev 
14930)
+++ branches/SAMBA_3_0/source/libads/ldap.c 2006-04-06 01:46:01 UTC (rev 
14931)
@@ -1083,7 +1083,8 @@
 /**
  * Build an org unit string
  *  if org unit is Computers or blank then assume a container, otherwise
- *  assume a \ separated list of organisational units
+ *  assume a / separated list of organisational units.
+ * jmcd: '\' is now used for escapes so certain chars can be in the ou (e.g. #)
  * @param ads connection to ads server
  * @param org_unit Organizational unit
  * @return org unit string - caller must free
@@ -1104,7 +1105,10 @@
return SMB_STRDUP(cn=Computers);
}
 
-   return ads_build_path(org_unit, \\/, ou=, 1);
+   /* jmcd: removed \\ from the separation chars, because it is
+  needed as an escape for chars like '#' which are valid in an
+  OU name */
+   return ads_build_path(org_unit, /, ou=, 1);
 }
 
 /**

Modified: trunk/source/libads/ldap.c
===
--- trunk/source/libads/ldap.c  2006-04-05 23:54:12 UTC (rev 14930)
+++ trunk/source/libads/ldap.c  2006-04-06 01:46:01 UTC (rev 14931)
@@ -1083,7 +1083,8 @@
 /**
  * Build an org unit string
  *  if org unit is Computers or blank then assume a container, otherwise
- *  assume a \ separated list of organisational units
+ *  assume a / separated list of organisational units.
+ * jmcd: '\' is now used for escapes so certain chars can be in the ou (e.g. #)
  * @param ads connection to ads server
  * @param org_unit Organizational unit
  * @return org unit string - caller must free
@@ -1104,7 +1105,10 @@
return SMB_STRDUP(cn=Computers);
}
 
-   return ads_build_path(org_unit, \\/, ou=, 1);
+   /* jmcd: removed \\ from the separation chars, because it is
+  needed as an escape for chars like '#' which are valid in an
+  OU name */
+   return ads_build_path(org_unit, /, ou=, 1);
 }
 
 /**



svn commit: linux-cifs-client r50 - in branches/linux-2.6.9-RHEL4: . fs/cifs

2006-04-05 Thread sfrench
Author: sfrench
Date: 2006-04-06 01:48:17 + (Thu, 06 Apr 2006)
New Revision: 50

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=linux-cifs-clientrev=50

Log:
Update to cifs 1.42 and use the ifdef version which builds
across most 2.6.5-2.6.15 kernels

Added:
   branches/linux-2.6.9-RHEL4/fs/cifs/Makefile-24
Modified:
   branches/linux-2.6.9-RHEL4/README
   branches/linux-2.6.9-RHEL4/fs/cifs/AUTHORS
   branches/linux-2.6.9-RHEL4/fs/cifs/CHANGES
   branches/linux-2.6.9-RHEL4/fs/cifs/Makefile
   branches/linux-2.6.9-RHEL4/fs/cifs/README
   branches/linux-2.6.9-RHEL4/fs/cifs/TODO
   branches/linux-2.6.9-RHEL4/fs/cifs/asn1.c
   branches/linux-2.6.9-RHEL4/fs/cifs/cifs_debug.c
   branches/linux-2.6.9-RHEL4/fs/cifs/cifs_debug.h
   branches/linux-2.6.9-RHEL4/fs/cifs/cifs_fs_sb.h
   branches/linux-2.6.9-RHEL4/fs/cifs/cifs_unicode.c
   branches/linux-2.6.9-RHEL4/fs/cifs/cifs_unicode.h
   branches/linux-2.6.9-RHEL4/fs/cifs/cifs_uniupr.h
   branches/linux-2.6.9-RHEL4/fs/cifs/cifsencrypt.c
   branches/linux-2.6.9-RHEL4/fs/cifs/cifsfs.c
   branches/linux-2.6.9-RHEL4/fs/cifs/cifsfs.h
   branches/linux-2.6.9-RHEL4/fs/cifs/cifsglob.h
   branches/linux-2.6.9-RHEL4/fs/cifs/cifspdu.h
   branches/linux-2.6.9-RHEL4/fs/cifs/cifsproto.h
   branches/linux-2.6.9-RHEL4/fs/cifs/cifssmb.c
   branches/linux-2.6.9-RHEL4/fs/cifs/connect.c
   branches/linux-2.6.9-RHEL4/fs/cifs/dir.c
   branches/linux-2.6.9-RHEL4/fs/cifs/fcntl.c
   branches/linux-2.6.9-RHEL4/fs/cifs/file.c
   branches/linux-2.6.9-RHEL4/fs/cifs/inode.c
   branches/linux-2.6.9-RHEL4/fs/cifs/link.c
   branches/linux-2.6.9-RHEL4/fs/cifs/misc.c
   branches/linux-2.6.9-RHEL4/fs/cifs/netmisc.c
   branches/linux-2.6.9-RHEL4/fs/cifs/ntlmssp.h
   branches/linux-2.6.9-RHEL4/fs/cifs/readdir.c
   branches/linux-2.6.9-RHEL4/fs/cifs/rfc1002pdu.h
   branches/linux-2.6.9-RHEL4/fs/cifs/smberr.h
   branches/linux-2.6.9-RHEL4/fs/cifs/transport.c
   branches/linux-2.6.9-RHEL4/fs/cifs/xattr.c


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


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

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-06 01:54:12 + (Thu, 06 Apr 2006)
New Revision: 14932

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

Log:

ensure that we send a NOTIFY_ACTION_OLD_NAME and
NOTIFY_ACTION_NEW_NAME together to the client.

Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c 2006-04-06 01:46:01 UTC 
(rev 14931)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c 2006-04-06 01:54:12 UTC 
(rev 14932)
@@ -125,8 +125,10 @@
}
n-current_buffer_size += len;
 
-   /* send what we have */
-   pvfs_notify_send(n, NT_STATUS_OK);
+   /* send what we have, unless its the first part of a rename */
+   if (ev-action != NOTIFY_ACTION_OLD_NAME) {
+   pvfs_notify_send(n, NT_STATUS_OK);
+   }
 }
 
 /*



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

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-06 01:56:04 + (Thu, 06 Apr 2006)
New Revision: 14933

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

Log:

fix the handling of notify filters to be much closer to the behaviour
of w2k3. The behaviour is particularly tricky for rename.

Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_mkdir.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_open.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_read.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_setfileinfo.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_write.c
   branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_mkdir.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_mkdir.c  2006-04-06 01:54:12 UTC 
(rev 14932)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_mkdir.c  2006-04-06 01:56:04 UTC 
(rev 14933)
@@ -85,7 +85,7 @@
 
notify_trigger(pvfs-notify_context, 
   NOTIFY_ACTION_ADDED, 
-  FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME,
+  FILE_NOTIFY_CHANGE_DIR_NAME,
   name-full_name);
 
return NT_STATUS_OK;
@@ -142,7 +142,7 @@
 
notify_trigger(pvfs-notify_context, 
   NOTIFY_ACTION_ADDED, 
-  FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME,
+  FILE_NOTIFY_CHANGE_DIR_NAME,
   name-full_name);
 
return NT_STATUS_OK;
@@ -184,7 +184,7 @@
 
notify_trigger(pvfs-notify_context, 
   NOTIFY_ACTION_REMOVED, 
-  FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME,
+  FILE_NOTIFY_CHANGE_DIR_NAME,
   name-full_name);
 
return NT_STATUS_OK;

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_open.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_open.c   2006-04-06 01:54:12 UTC 
(rev 14932)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_open.c   2006-04-06 01:56:04 UTC 
(rev 14933)
@@ -380,8 +380,8 @@
create_action = NTCREATEX_ACTION_CREATED;
 
notify_trigger(pvfs-notify_context, 
-  NOTIFY_ACTION_REMOVED, 
-  
FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME,
+  NOTIFY_ACTION_ADDED, 
+  FILE_NOTIFY_CHANGE_DIR_NAME,
   name-full_name);
} else {
create_action = NTCREATEX_ACTION_EXISTED;

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_read.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_read.c   2006-04-06 01:54:12 UTC 
(rev 14932)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_read.c   2006-04-06 01:56:04 UTC 
(rev 14933)
@@ -90,10 +90,5 @@
rd-readx.out.remaining = 0x;
rd-readx.out.compaction_mode = 0; 
 
-   notify_trigger(pvfs-notify_context, 
-  NOTIFY_ACTION_MODIFIED, 
-  FILE_NOTIFY_CHANGE_LAST_ACCESS,
-  f-handle-name-full_name);
-
return NT_STATUS_OK;
 }

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c 2006-04-06 01:54:12 UTC 
(rev 14932)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c 2006-04-06 01:56:04 UTC 
(rev 14933)
@@ -28,39 +28,46 @@
 /*
   do a file rename, and send any notify triggers
 */
-NTSTATUS pvfs_do_rename(struct pvfs_state *pvfs, const char *name1, const char 
*name2)
+NTSTATUS pvfs_do_rename(struct pvfs_state *pvfs, const struct pvfs_filename 
*name1, 
+   const char *name2)
 {
const char *r1, *r2;
+   uint32_t mask;
 
-   if (rename(name1, name2) == -1) {
+   if (rename(name1-full_name, name2) == -1) {
return pvfs_map_errno(pvfs, errno);
}
 
+   if (name1-dos.attrib  FILE_ATTRIBUTE_DIRECTORY) {
+   mask = FILE_NOTIFY_CHANGE_DIR_NAME;
+   } else {
+   mask = 
FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_ATTRIBUTES|FILE_NOTIFY_CHANGE_CREATION;
+   }
/* 
   renames to the same directory cause a OLD_NAME-NEW_NAME notify.
   renames to a different directory are considered a remove/add 
*/
-   r1 = strrchr_m(name1, '/');
+   r1 = strrchr_m(name1-full_name, '/');
r2 = strrchr_m(name2, '/');
 
-   if ((r1-name1) != (r2-name2) ||
-   strncmp(name1, name2, r1-name1) != 0) {
+   if ((r1-name1-full_name) != (r2-name2) ||
+   

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

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-06 01:58:50 + (Thu, 06 Apr 2006)
New Revision: 14934

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

Log:

greatly expand the RAW-NOTIFY testing of completion filters. We now
try each bit in the completion filter separately for a wide range of
file operations.

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/notify.c
===
--- branches/SAMBA_4_0/source/torture/raw/notify.c  2006-04-06 01:56:04 UTC 
(rev 14933)
+++ branches/SAMBA_4_0/source/torture/raw/notify.c  2006-04-06 01:58:50 UTC 
(rev 14934)
@@ -365,6 +365,189 @@
return ret;
 }
 
+
+/* 
+   testing of mask bits for change notify
+*/
+static BOOL test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+{
+   BOOL ret = True;
+   NTSTATUS status;
+   struct smb_notify notify;
+   union smb_open io;
+   int fnum, fnum2;
+   uint32_t mask;
+   int i;
+   char c = 1;
+
+   printf(TESTING CHANGE NOTIFY COMPLETION FILTERS\n);
+   
+   /*
+ get a handle on the directory
+   */
+   io.generic.level = RAW_OPEN_NTCREATEX;
+   io.ntcreatex.in.root_fid = 0;
+   io.ntcreatex.in.flags = 0;
+   io.ntcreatex.in.access_mask = SEC_FILE_ALL;
+   io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
+   io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
+   io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ | 
NTCREATEX_SHARE_ACCESS_WRITE;
+   io.ntcreatex.in.alloc_size = 0;
+   io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
+   io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
+   io.ntcreatex.in.security_flags = 0;
+   io.ntcreatex.in.fname = BASEDIR;
+
+   notify.in.buffer_size = 1000;
+   notify.in.recursive = True;
+
+#define NOTIFY_MASK_TEST(setup, op, cleanup, Action, expected, nchanges) \
+   do { for (mask=i=0;i32;i++) { \
+   struct smbcli_request *req; \
+   status = smb_raw_open(cli-tree, mem_ctx, io); \
+   CHECK_STATUS(status, NT_STATUS_OK); \
+   fnum = io.ntcreatex.out.file.fnum; \
+   setup \
+   notify.in.file.fnum = fnum; \
+   notify.in.completion_filter = (1i); \
+   req = smb_raw_changenotify_send(cli-tree, notify); \
+   op \
+   msleep(10); smb_raw_ntcancel(req); \
+   status = smb_raw_changenotify_recv(req, mem_ctx, notify); \
+   cleanup \
+   if (NT_STATUS_EQUAL(status, NT_STATUS_CANCELLED)) continue; \
+   CHECK_STATUS(status, NT_STATUS_OK); \
+   if (nchanges != notify.out.num_changes || \
+   notify.out.changes[0].action != Action || \
+   strcmp(notify.out.changes[0].name.s, tname1) != 0) { \
+   printf(nchanges=%d action=%d filter=0x%08x\n, \
+  notify.out.num_changes, \
+  notify.out.changes[0].action, \
+  notify.in.completion_filter); \
+   ret = False; \
+   } \
+   mask |= (1i); \
+   smbcli_close(cli-tree, fnum); \
+   } \
+   CHECK_VAL(mask, expected); \
+   } while (0)
+
+   printf(testing mkdir\n);
+   NOTIFY_MASK_TEST(;,
+smbcli_mkdir(cli-tree, BASEDIR \\tname1);,
+smbcli_rmdir(cli-tree, BASEDIR \\tname1);,
+NOTIFY_ACTION_ADDED,
+FILE_NOTIFY_CHANGE_DIR_NAME, 1);
+
+   printf(testing create file\n);
+   NOTIFY_MASK_TEST(;,
+smbcli_close(cli-tree, smbcli_open(cli-tree, BASEDIR 
\\tname1, O_CREAT, 0));,
+smbcli_unlink(cli-tree, BASEDIR \\tname1);,
+NOTIFY_ACTION_ADDED,
+FILE_NOTIFY_CHANGE_FILE_NAME, 1);
+
+   printf(testing unlink\n);
+   NOTIFY_MASK_TEST(
+smbcli_close(cli-tree, smbcli_open(cli-tree, BASEDIR 
\\tname1, O_CREAT, 0));,
+smbcli_unlink(cli-tree, BASEDIR \\tname1);,
+;,
+NOTIFY_ACTION_REMOVED,
+FILE_NOTIFY_CHANGE_FILE_NAME, 1);
+
+   printf(testing rmdir\n);
+   NOTIFY_MASK_TEST(
+smbcli_mkdir(cli-tree, BASEDIR \\tname1);,
+smbcli_rmdir(cli-tree, BASEDIR \\tname1);,
+;,
+NOTIFY_ACTION_REMOVED,
+FILE_NOTIFY_CHANGE_DIR_NAME, 1);
+
+   printf(testing rename file\n);
+   NOTIFY_MASK_TEST(
+smbcli_close(cli-tree, smbcli_open(cli-tree, BASEDIR 
\\tname1, O_CREAT, 0));,
+   

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

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-06 02:01:37 + (Thu, 06 Apr 2006)
New Revision: 14935

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

Log:

try to avoid a race condition in the recursion test

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/notify.c
===
--- branches/SAMBA_4_0/source/torture/raw/notify.c  2006-04-06 01:58:50 UTC 
(rev 14934)
+++ branches/SAMBA_4_0/source/torture/raw/notify.c  2006-04-06 02:01:37 UTC 
(rev 14935)
@@ -315,6 +315,7 @@
 
notify.in.completion_filter = 0;
notify.in.recursive = True;
+   msleep(10);
req1 = smb_raw_changenotify_send(cli-tree, notify);
 
smbcli_rmdir(cli-tree, BASEDIR \\subdir-name\\subname1-r);
@@ -870,7 +871,6 @@
return False;
}
 
-
ret = test_notify_dir(cli, mem_ctx);
ret = test_notify_mask(cli, mem_ctx);
ret = test_notify_recursive(cli, mem_ctx);



svn commit: samba r14936 - in branches/SAMBA_4_0/source/include: .

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-06 02:02:41 + (Thu, 06 Apr 2006)
New Revision: 14936

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

Log:

remove a duplicate line

Modified:
   branches/SAMBA_4_0/source/include/smb.h


Changeset:
Modified: branches/SAMBA_4_0/source/include/smb.h
===
--- branches/SAMBA_4_0/source/include/smb.h 2006-04-06 02:01:37 UTC (rev 
14935)
+++ branches/SAMBA_4_0/source/include/smb.h 2006-04-06 02:02:41 UTC (rev 
14936)
@@ -423,7 +423,6 @@
 /* ChangeNotify flags. */
 #define FILE_NOTIFY_CHANGE_FILE_NAME   0x0001
 #define FILE_NOTIFY_CHANGE_DIR_NAME0x0002
-#define FILE_NOTIFY_CHANGE_DIR_NAME0x0002
 #define FILE_NOTIFY_CHANGE_ATTRIBUTES  0x0004
 #define FILE_NOTIFY_CHANGE_SIZE0x0008
 #define FILE_NOTIFY_CHANGE_LAST_WRITE  0x0010



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

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-06 02:03:19 + (Thu, 06 Apr 2006)
New Revision: 14937

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

Log:

fix a crash that can be caused by a notify triggering during a share
disconnect

Modified:
   branches/SAMBA_4_0/source/smb_server/smb/request.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb/request.c
===
--- branches/SAMBA_4_0/source/smb_server/smb/request.c  2006-04-06 02:02:41 UTC 
(rev 14936)
+++ branches/SAMBA_4_0/source/smb_server/smb/request.c  2006-04-06 02:03:19 UTC 
(rev 14937)
@@ -278,6 +278,11 @@
DATA_BLOB blob;
NTSTATUS status;
 
+   if (req-smb_conn-connection-event.fde == NULL) {
+   /* we are in the process of shutting down this connection */
+   return;
+   }
+
if (req-out.size  NBT_HDR_SIZE) {
_smb_setlen(req-out.buffer, req-out.size - NBT_HDR_SIZE);
}



svn commit: samba r14938 - in branches/SAMBA_4_0/source/libcli: .

2006-04-05 Thread tridge
Author: tridge
Date: 2006-04-06 03:31:31 + (Thu, 06 Apr 2006)
New Revision: 14938

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

Log:

add smbcli_fsetatr() as a convenient interface to a setfileinfo for
torture testing. Used by RAW-NOTIFY.

Modified:
   branches/SAMBA_4_0/source/libcli/clifile.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/clifile.c
===
--- branches/SAMBA_4_0/source/libcli/clifile.c  2006-04-06 02:03:19 UTC (rev 
14937)
+++ branches/SAMBA_4_0/source/libcli/clifile.c  2006-04-06 03:31:31 UTC (rev 
14938)
@@ -588,7 +588,30 @@
return status;
 }
 
+/
+ Do a setfileinfo basic_info call.
+/
+NTSTATUS smbcli_fsetatr(struct smbcli_tree *tree, int fnum, uint16_t mode, 
+   NTTIME create_time, NTTIME access_time, 
+   NTTIME write_time, NTTIME change_time)
+{
+   union smb_setfileinfo parms;
+   NTSTATUS status;
 
+   parms.basic_info.level = RAW_SFILEINFO_BASIC_INFO;
+   parms.basic_info.in.file.fnum = fnum;
+   parms.basic_info.in.attrib = mode;
+   parms.basic_info.in.create_time = create_time;
+   parms.basic_info.in.access_time = access_time;
+   parms.basic_info.in.write_time = write_time;
+   parms.basic_info.in.change_time = change_time;
+   
+   status = smb_raw_setfileinfo(tree, parms);
+
+   return status;
+}
+
+
 /
  Check for existence of a dir.
 /