summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
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;
}