s3:notify: don't log user_can_stat_name_under_fsp with level 0 for OBJECT_NAME_NOT_FOUND
authorStefan Metzmacher <metze@samba.org>
Wed, 3 Apr 2024 14:35:35 +0000 (16:35 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 23 Apr 2024 14:17:32 +0000 (14:17 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/notify.c

index 850193eccf33898ff7672872597fb3906f060c63..d08df3c8380ad94199b102ffa3efbb69cc73d99b 100644 (file)
@@ -651,9 +651,14 @@ static bool user_can_stat_name_under_fsp(files_struct *fsp, const char *name)
                                           0,
                                           &fname);
                if (!NT_STATUS_IS_OK(status)) {
-                       DBG_ERR("synthetic_pathref failed for %s, error %s\n",
-                               filepath,
-                               nt_errstr(status));
+                       int dbg_lvl = DBGLVL_ERR;
+                       if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
+                               dbg_lvl = DBGLVL_DEBUG;
+                       }
+                       DBG_PREFIX(dbg_lvl, (
+                                  "synthetic_pathref failed for %s, error %s\n",
+                                  filepath,
+                                  nt_errstr(status)));
                        TALLOC_FREE(fname);
                        TALLOC_FREE(filepath);
                        return false;