s3: Replace a SMB_ASSERT with an error return
authorVolker Lendecke <vl@samba.org>
Fri, 9 Mar 2012 13:45:21 +0000 (14:45 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 9 Mar 2012 16:21:55 +0000 (17:21 +0100)
source3/smbd/notify.c

index 8160d5ac63881e56e6b6fd45a413c67671cb69bf..4357af412ee080563ddcdd1e80b91798e02e1abd 100644 (file)
@@ -181,7 +181,11 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter,
        struct notify_entry e;
        NTSTATUS status;
 
-       SMB_ASSERT(fsp->notify == NULL);
+       if (fsp->notify != NULL) {
+               DEBUG(1, ("change_notify_create: fsp->notify != NULL, "
+                         "fname = %s\n", fsp->fsp_name->base_name));
+               return NT_STATUS_INVALID_PARAMETER;
+       }
 
        if (!(fsp->notify = talloc_zero(NULL, struct notify_change_buf))) {
                DEBUG(0, ("talloc failed\n"));