summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-12-31 10:16:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:49 -0500
commit165f5f3f40317c1e75d60a977270f903f7475f69 (patch)
tree150798e7f68903db1201c2465f77c863dcd03c30 /source3/smbd/reply.c
parentab7fc62edfb32422bf95dbf358f6ee5d94e27a34 (diff)
downloadsamba-165f5f3f40317c1e75d60a977270f903f7475f69.tar.gz
samba-165f5f3f40317c1e75d60a977270f903f7475f69.tar.bz2
samba-165f5f3f40317c1e75d60a977270f903f7475f69.zip
r20433: Work in progress: Survive more of RAW-NOTIFY.
call_nt_transact_notify_change() is now sync if there are changes around. A notify_message does a direct reply from within the message, so process_pending_change_notify_queue is not needed anymore for samba-generated events. Next step is to restructure the kernel-mechanisms to generate messages. Volker (This used to be commit c813f71d0036ec52c99a97e60fe33ee47d0635fa)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index f10b649bf1..935e8033a5 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1975,10 +1975,12 @@ NTSTATUS can_delete(connection_struct *conn, char *fname, uint32 dirtype, BOOL b
code.
****************************************************************************/
-NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype, char *name, BOOL has_wild)
+NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype,
+ char *name, BOOL has_wild)
{
pstring directory;
pstring mask;
+ pstring orig_name;
char *p;
int count=0;
NTSTATUS error = NT_STATUS_OK;
@@ -1989,6 +1991,11 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype, char *name, B
*directory = *mask = 0;
rc = unix_convert(name,conn,0,&bad_path,&sbuf);
+
+ /*
+ * Feel my pain, this code needs rewriting *very* badly! -- vl
+ */
+ pstrcpy(orig_name, name);
p = strrchr_m(name,'/');
if (!p) {
@@ -2089,6 +2096,18 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype, char *name, B
error = map_nt_error_from_unix(errno);
}
+ {
+ char *dir;
+ const char *fname;
+
+ if (parent_dirname_talloc(tmp_talloc_ctx(), orig_name,
+ &dir, &fname)) {
+ notify_action(conn, dir, fname,
+ NOTIFY_ACTION_REMOVED);
+ TALLOC_FREE(dir); /* not strictly necessary */
+ }
+ }
+
return error;
}