diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-05-07 20:53:10 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:21:54 -0500 |
commit | 87d18ac48853e1d63d127b03ea6dbc7568e334f4 (patch) | |
tree | f470ba17a3d0e516f2e12d7e37caa5aebabdb404 | |
parent | 798af9e0c86976245c36ea1f0c7171e9ab663da7 (diff) | |
download | samba-87d18ac48853e1d63d127b03ea6dbc7568e334f4.tar.gz samba-87d18ac48853e1d63d127b03ea6dbc7568e334f4.tar.bz2 samba-87d18ac48853e1d63d127b03ea6dbc7568e334f4.zip |
r22755: Second half of r22754. As it stands now, string_replace expects a
pstring. Give it one, although I hate putting it in :-)
Thanks to Tom Bork! :-)
(This used to be commit f4ea3fd36543120fa7d712e6e650c704e4e23759)
-rw-r--r-- | source3/smbd/notify.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index d18bbb180f..b2ac26764a 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -337,7 +337,7 @@ void notify_fname(connection_struct *conn, uint32 action, uint32 filter, static void notify_fsp(files_struct *fsp, uint32 action, const char *name) { struct notify_change *change, *changes; - char *name2; + pstring name2; if (fsp->notify == NULL) { /* @@ -346,11 +346,7 @@ static void notify_fsp(files_struct *fsp, uint32 action, const char *name) return; } - if (!(name2 = talloc_strdup(fsp->notify, name))) { - DEBUG(0, ("talloc_strdup failed\n")); - return; - } - + pstrcpy(name2, name); string_replace(name2, '/', '\\'); /* @@ -364,7 +360,6 @@ static void notify_fsp(files_struct *fsp, uint32 action, const char *name) * guard against a DoS here. */ TALLOC_FREE(fsp->notify->changes); - TALLOC_FREE(name2); fsp->notify->num_changes = -1; return; } @@ -377,7 +372,6 @@ static void notify_fsp(files_struct *fsp, uint32 action, const char *name) fsp->notify, fsp->notify->changes, struct notify_change, fsp->notify->num_changes+1))) { DEBUG(0, ("talloc_realloc failed\n")); - TALLOC_FREE(name2); return; } @@ -385,7 +379,11 @@ static void notify_fsp(files_struct *fsp, uint32 action, const char *name) change = &(fsp->notify->changes[fsp->notify->num_changes]); - change->name = talloc_move(changes, &name2); + if (!(change->name = talloc_strdup(changes, name2))) { + DEBUG(0, ("talloc_strdup failed\n")); + return; + } + change->action = action; fsp->notify->num_changes += 1; @@ -401,7 +399,7 @@ static void notify_fsp(files_struct *fsp, uint32 action, const char *name) * We have to send the two rename events in one reply. So hold * the first part back. */ - return; + return; } /* |