]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Use fsp_str_dbg() in DEBUGs
authorVolker Lendecke <vl@samba.org>
Fri, 12 Sep 2025 17:16:28 +0000 (19:16 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 21 Oct 2025 17:33:29 +0000 (17:33 +0000)
This removes "git grep fsp_name->base_name" references.

Referencing fsp_name->base_name is potentially racy and affected by

https://bugzilla.samba.org/show_bug.cgi?id=15909

This removes some obvious git grep lines, still leaving far too many...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
15 files changed:
source3/lib/adouble.c
source3/modules/nfs4_acls.c
source3/modules/vfs_ceph_new.c
source3/modules/vfs_ceph_snapshots.c
source3/modules/vfs_fruit.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_media_harmony.c
source3/modules/vfs_unityed_media.c
source3/modules/vfs_vxfs.c
source3/smbd/dir.c
source3/smbd/files.c
source3/smbd/notify.c
source3/smbd/smb2_create.c
source3/smbd/smb2_query_directory.c
source3/smbd/smb2_reply.c

index 0cea2ba23fe92554c4312407acb2cf697774638d..90d8df3809ac7f9e274edcd7f281fae854c10ff1 100644 (file)
@@ -2176,11 +2176,10 @@ static ssize_t ad_read_meta(vfs_handle_struct *handle,
        /* Now parse entries */
        ok = ad_unpack(ad, ADEID_NUM_XATTR, AD_DATASZ_XATTR);
        if (!ok) {
-               DBG_WARNING(
-                       "Invalid AppleDouble xattr metadata (%s) in file: %s - "
-                       "Consider deleting the corrupted file.\n",
-                       smb_fname->base_name,
-                       ad->ad_fsp->fsp_name->base_name);
+               DBG_WARNING("Invalid AppleDouble xattr metadata (%s) in file: "
+                           "%s - Consider deleting the corrupted file.\n",
+                           smb_fname->base_name,
+                           fsp_str_dbg(ad->ad_fsp));
                errno = EINVAL;
                rc = -1;
                goto exit;
@@ -2390,7 +2389,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle,
                DBG_WARNING("Invalid AppleDouble resource (%s) in file: %s - "
                            "Consider deleting the corrupted file.\n",
                            smb_fname->base_name,
-                           ad->ad_fsp->fsp_name->base_name);
+                           fsp_str_dbg(ad->ad_fsp));
                errno = EINVAL;
                return -1;
        }
@@ -2402,7 +2401,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle,
                DBG_WARNING("Invalid AppleDouble resource (%s) in file: %s - "
                            "Consider deleting the corrupted file.\n",
                            smb_fname->base_name,
-                           ad->ad_fsp->fsp_name->base_name);
+                           fsp_str_dbg(ad->ad_fsp));
                errno = EINVAL;
                return -1;
        }
index a261c77aca58ce961e21c522b1ae5da5536d4ad1..b47ef613de6c3a2e8dfce4d2992c4b1fd69ed4f7 100644 (file)
@@ -216,7 +216,8 @@ int nfs4_acl_fstat(struct vfs_handle_struct *handle,
                        lp_fake_directory_create_times(SNUM(handle->conn));
 
                DBG_DEBUG("fstat for %s failed with EACCES. Trying with "
-                         "CAP_DAC_OVERRIDE.\n", fsp->fsp_name->base_name);
+                         "CAP_DAC_OVERRIDE.\n",
+                         fsp_str_dbg(fsp));
                ret = fstat_with_cap_dac_override(fsp_get_pathref_fd(fsp),
                                                  sbuf,
                                                  fake_dctime);
@@ -254,7 +255,8 @@ int nfs4_acl_fstatat(struct vfs_handle_struct *handle,
                        lp_fake_directory_create_times(SNUM(handle->conn));
 
                DBG_DEBUG("fstatat for %s failed with EACCES. Trying with "
-                         "CAP_DAC_OVERRIDE.\n", dirfsp->fsp_name->base_name);
+                         "CAP_DAC_OVERRIDE.\n",
+                         fsp_str_dbg(dirfsp));
                ret = fstatat_with_cap_dac_override(fsp_get_pathref_fd(dirfsp),
                                                    smb_fname->base_name,
                                                    sbuf,
index c71adcc56787081f8ce1838e55610da527a9036e..667de1959bc7a2a7ad450b150271cada4131d861 100644 (file)
@@ -771,7 +771,8 @@ static int vfs_ceph_add_fh(struct vfs_handle_struct *handle,
        (*out_cfh)->fd = -1;
 out:
        DBG_DEBUG("[CEPH] vfs_ceph_add_fh: name = %s ret = %d\n",
-                 fsp->fsp_name->base_name, ret);
+                 fsp_str_dbg(fsp),
+                 ret);
        return ret;
 }
 
@@ -789,7 +790,8 @@ static int vfs_ceph_fetch_fh(struct vfs_handle_struct *handle,
        *out_cfh = VFS_FETCH_FSP_EXTENSION(handle, fsp);
        ret = (*out_cfh == NULL) ? -EBADF : 0;
        DBG_DEBUG("[CEPH] vfs_ceph_fetch_fh: name = %s ret = %d\n",
-                 fsp->fsp_name->base_name, ret);
+                 fsp_str_dbg(fsp),
+                 ret);
        return ret;
 }
 
@@ -801,7 +803,8 @@ static int vfs_ceph_fetch_io_fh(struct vfs_handle_struct *handle,
        *out_cfh = VFS_FETCH_FSP_EXTENSION(handle, fsp);
        ret = (*out_cfh == NULL) || ((*out_cfh)->fh == NULL) ? -EBADF : 0;
        DBG_DEBUG("[CEPH] vfs_ceph_fetch_io_fh: name = %s ret = %d\n",
-                 fsp->fsp_name->base_name, ret);
+                 fsp_str_dbg(fsp),
+                 ret);
        return ret;
 }
 
@@ -2201,7 +2204,7 @@ static DIR *vfs_ceph_fdopendir(struct vfs_handle_struct *handle,
        struct vfs_ceph_fh *cfh = NULL;
 
        START_PROFILE_X(SNUM(handle->conn), syscall_fdopendir);
-       DBG_DEBUG("[CEPH] fdopendir: name=%s\n", fsp->fsp_name->base_name);
+       DBG_DEBUG("[CEPH] fdopendir: name=%s\n", fsp_str_dbg(fsp));
        ret = vfs_ceph_fetch_fh(handle, fsp, &cfh);
        if (ret != 0) {
                goto out;
@@ -2214,7 +2217,9 @@ static DIR *vfs_ceph_fdopendir(struct vfs_handle_struct *handle,
        result = &cfh->dirp;
 out:
        DBG_DEBUG("[CEPH] fdopendir: handle=%p name=%s ret=%d\n",
-                 handle, fsp->fsp_name->base_name, ret);
+                 handle,
+                 fsp_str_dbg(fsp),
+                 ret);
        if (ret != 0) {
                errno = -ret;
        }
@@ -2232,7 +2237,7 @@ static struct dirent *vfs_ceph_readdir(struct vfs_handle_struct *handle,
        int ret = -1;
 
        START_PROFILE_X(SNUM(handle->conn), syscall_readdir);
-       DBG_DEBUG("[CEPH] readdir: name=%s\n", dirfsp->fsp_name->base_name);
+       DBG_DEBUG("[CEPH] readdir: name=%s\n", fsp_str_dbg(dirfsp));
 
        result = vfs_ceph_get_fh_dirent(dircfh);
        if (result == NULL) {
@@ -2258,7 +2263,9 @@ static struct dirent *vfs_ceph_readdir(struct vfs_handle_struct *handle,
        errno = saved_errno;
 out:
        DBG_DEBUG("[CEPH] readdir: handle=%p name=%s ret=%d\n",
-                 handle, dirfsp->fsp_name->base_name, ret);
+                 handle,
+                 fsp_str_dbg(dirfsp),
+                 ret);
        END_PROFILE_X(syscall_readdir);
        return result;
 }
@@ -2401,7 +2408,8 @@ out:
        fsp->fsp_flags.have_proc_fds = false;
 err_out:
        DBG_DEBUG("[CEPH] openat: name=%s result=%d",
-                 fsp->fsp_name->base_name, result);
+                 fsp_str_dbg(fsp),
+                 result);
        END_PROFILE_X(syscall_openat);
        return status_code(result);
 }
@@ -2421,7 +2429,9 @@ static int vfs_ceph_close(struct vfs_handle_struct *handle, files_struct *fsp)
        vfs_ceph_remove_fh(handle, fsp);
 out:
        DBG_DEBUG("[CEPH] close: handle=%p name=%s result=%d\n",
-                 handle, fsp->fsp_name->base_name, result);
+                 handle,
+                 fsp_str_dbg(fsp),
+                 result);
        END_PROFILE_X(syscall_close);
        return status_code(result);
 }
@@ -2443,10 +2453,10 @@ static ssize_t vfs_ceph_pread(struct vfs_handle_struct *handle,
 
        result = vfs_ceph_ll_read(handle, cfh, offset, n, data);
 out:
-       DBG_DEBUG("[CEPH] pread: handle=%p name=%s n=%" PRIu64 "offset=%" PRIu64
-                 " result=%" PRIu64 "\n",
+       DBG_DEBUG("[CEPH] pread: handle=%p name=%s n=%" PRIu64
+                 "offset=%" PRIu64 " result=%" PRIu64 "\n",
                  handle,
-                 fsp->fsp_name->base_name,
+                 fsp_str_dbg(fsp),
                  n,
                  (intmax_t)offset,
                  result);
@@ -2681,9 +2691,10 @@ static struct tevent_req *vfs_ceph_pread_send(struct vfs_handle_struct *handle,
        struct vfs_ceph_aio_state *state = NULL;
        int ret = -1;
 
-       DBG_DEBUG("[CEPH] pread_send: handle=%p name=%s data=%p n=%zu offset=%zd\n",
+       DBG_DEBUG("[CEPH] pread_send: handle=%p name=%s data=%p n=%zu "
+                 "offset=%zd\n",
                  handle,
-                 fsp->fsp_name->base_name,
+                 fsp_str_dbg(fsp),
                  data,
                  n,
                  offset);
@@ -2774,8 +2785,9 @@ static ssize_t vfs_ceph_pwrite(struct vfs_handle_struct *handle,
        }
        result = vfs_ceph_ll_write(handle, cfh, offset, n, data);
 out:
-       DBG_DEBUG("[CEPH] pwrite: name=%s data=%p n=%" PRIu64 "offset=%" PRIu64 "\n",
-                 fsp->fsp_name->base_name,
+       DBG_DEBUG("[CEPH] pwrite: name=%s data=%p n=%" PRIu64 "offset=%" PRIu64
+                 "\n",
+                 fsp_str_dbg(fsp),
                  data,
                  n,
                  (intmax_t)offset);
@@ -2795,9 +2807,10 @@ static struct tevent_req *vfs_ceph_pwrite_send(struct vfs_handle_struct *handle,
        struct vfs_ceph_aio_state *state = NULL;
        int ret = -1;
 
-       DBG_DEBUG("[CEPH] pwrite_send: handle=%p name=%s data=%p n=%zu offset=%zd\n",
+       DBG_DEBUG("[CEPH] pwrite_send: handle=%p name=%s data=%p n=%zu "
+                 "offset=%zd\n",
                  handle,
-                 fsp->fsp_name->base_name,
+                 fsp_str_dbg(fsp),
                  data,
                  n,
                  offset);
@@ -2891,7 +2904,10 @@ static off_t vfs_ceph_lseek(struct vfs_handle_struct *handle,
        result = vfs_ceph_ll_lseek(handle, cfh, offset, whence);
 out:
        DBG_DEBUG("[CEPH] lseek: handle=%p name=%s offset=%zd whence=%d\n",
-                 handle, fsp->fsp_name->base_name, offset, whence);
+                 handle,
+                 fsp_str_dbg(fsp),
+                 offset,
+                 whence);
        END_PROFILE_X(syscall_lseek);
        return lstatus_code(result);
 }
@@ -2998,7 +3014,7 @@ static struct tevent_req *vfs_ceph_fsync_send(struct vfs_handle_struct *handle,
        struct vfs_ceph_aio_state *state = NULL;
        int ret = -1;
 
-       DBG_DEBUG("[CEPH] fsync_send: name=%s\n", fsp->fsp_name->base_name);
+       DBG_DEBUG("[CEPH] fsync_send: name=%s\n", fsp_str_dbg(fsp));
 
        req = tevent_req_create(mem_ctx, &state, struct vfs_ceph_aio_state);
        if (req == NULL) {
@@ -3024,7 +3040,9 @@ static struct tevent_req *vfs_ceph_fsync_send(struct vfs_handle_struct *handle,
        if (ret != 0) {
                /* ceph_fsync returns -errno on error. */
                DBG_DEBUG("[CEPH] fsync_send: ceph_fsync returned error "
-                         "name=%s ret=%d\n", fsp->fsp_name->base_name, ret);
+                         "name=%s ret=%d\n",
+                         fsp_str_dbg(fsp),
+                         ret);
                tevent_req_error(req, -ret);
                return tevent_req_post(req, ev);
        }
@@ -3229,11 +3247,15 @@ static int vfs_ceph_fntimes(struct vfs_handle_struct *handle,
        }
 
 out:
-       DBG_DEBUG("[CEPH] ntimes: handle=%p name=%s {mtime=%ld atime=%ld ctime=%ld"
-                 " create_time=%ld} result=%d\n",
+       DBG_DEBUG("[CEPH] ntimes: handle=%p name=%s {mtime=%ld atime=%ld "
+                 "ctime=%ld create_time=%ld} result=%d\n",
                  handle,
-                 fsp->fsp_name->base_name, ft->mtime.tv_sec, ft->atime.tv_sec,
-                 ft->ctime.tv_sec, ft->create_time.tv_sec, result);
+                 fsp_str_dbg(fsp),
+                 ft->mtime.tv_sec,
+                 ft->atime.tv_sec,
+                 ft->ctime.tv_sec,
+                 ft->create_time.tv_sec,
+                 result);
        END_PROFILE_X(syscall_fntimes);
        return status_code(result);
 }
@@ -3301,7 +3323,9 @@ static int vfs_ceph_fchmod(struct vfs_handle_struct *handle,
        }
 out:
        DBG_DEBUG("[CEPH] fchmod: handle=%p, name=%s result=%d\n",
-                 handle, fsp->fsp_name->base_name, result);
+                 handle,
+                 fsp_str_dbg(fsp),
+                 result);
        END_PROFILE_X(syscall_fchmod);
        return status_code(result);
 }
@@ -3340,7 +3364,11 @@ static int vfs_ceph_fchown(struct vfs_handle_struct *handle,
        }
 out:
        DBG_DEBUG("[CEPH] fchown: handle=%p name=%s uid=%d gid=%d result=%d\n",
-                 handle, fsp->fsp_name->base_name, uid, gid, result);
+                 handle,
+                 fsp_str_dbg(fsp),
+                 uid,
+                 gid,
+                 result);
        END_PROFILE_X(syscall_fchown);
        return status_code(result);
 }
@@ -3460,7 +3488,9 @@ static int vfs_ceph_ftruncate(struct vfs_handle_struct *handle,
 
        START_PROFILE_X(SNUM(handle->conn), syscall_ftruncate);
        DBG_DEBUG("[CEPH] ftruncate: handle=%p, name=%s, len=%zd\n",
-                 handle, fsp->fsp_name->base_name, (intmax_t)len);
+                 handle,
+                 fsp_str_dbg(fsp),
+                 (intmax_t)len);
 
        if (lp_strict_allocate(SNUM(fsp->conn))) {
                END_PROFILE(syscall_ftruncate);
@@ -3473,7 +3503,9 @@ static int vfs_ceph_ftruncate(struct vfs_handle_struct *handle,
        }
        result = vfs_ceph_ll_ftruncate(handle, cfh, len);
 out:
-       DBG_DEBUG("[CEPH] ftruncate: name=%s result=%d\n", fsp->fsp_name->base_name, result);
+       DBG_DEBUG("[CEPH] ftruncate: name=%s result=%d\n",
+                 fsp_str_dbg(fsp),
+                 result);
        END_PROFILE_X(syscall_ftruncate);
        return status_code(result);
 }
index 67011735d26da15bbbdcdab5ea7ba0712fce16eb..ffc22a02f9b396dc52bdd10d16ed5ac4d7ee3a38 100644 (file)
@@ -414,8 +414,7 @@ static int ceph_snap_get_shadow_copy_data(struct vfs_handle_struct *handle,
                                                   "ceph", "snapdir",
                                                   CEPH_SNAP_SUBDIR_DEFAULT);
 
-       DBG_DEBUG("getting shadow copy data for %s\n",
-                 fsp->fsp_name->base_name);
+       DBG_DEBUG("getting shadow copy data for %s\n", fsp_str_dbg(fsp));
 
        tmp_ctx = talloc_new(fsp);
        if (tmp_ctx == NULL) {
index d4f2cbc06c89a14d56d4f814e4e177f57e8cf00e..866348e3043510230ad01eeffc3f7f7abc7b4a70 100644 (file)
@@ -2071,7 +2071,7 @@ static int fruit_unlink_rsrc_stream(vfs_handle_struct *handle,
                        handle, dirfsp, smb_fname, &st, AT_SYMLINK_NOFOLLOW);
                if (ret != 0) {
                        DBG_ERR("fstatat [%s%s] failed [%s]\n",
-                               dirfsp->fsp_name->base_name,
+                               fsp_str_dbg(dirfsp),
                                smb_fname->base_name,
                                strerror(errno));
                        return -1;
index dffe59902530dbda546296d139fccb449dfef3d8..0164c3f2033501064f0fa5e5fb3f0cb49455cb03 100644 (file)
@@ -141,14 +141,14 @@ static int set_gpfs_sharemode(files_struct *fsp, uint32_t access_mask,
        if (errno == EACCES) {
                DBG_NOTICE("GPFS share mode denied for %s/%s.\n",
                           fsp->conn->connectpath,
-                          fsp->fsp_name->base_name);
+                          fsp_str_dbg(fsp));
        } else if (errno == EPERM) {
                DBG_ERR("Samba requested GPFS sharemode for %s/%s, but the "
                        "GPFS file system is not configured accordingly. "
                        "Configure file system with mmchfs -D nfs4 or "
                        "set gpfs:sharemodes=no in Samba.\n",
                        fsp->conn->connectpath,
-                       fsp->fsp_name->base_name);
+                       fsp_str_dbg(fsp));
        } else {
                DBG_ERR("gpfs_set_share failed: %s\n", strerror(errno));
        }
@@ -212,7 +212,7 @@ static int vfs_gpfs_close(vfs_handle_struct *handle, files_struct *fsp)
                        DBG_ERR("Clearing GPFS sharemode on close failed for "
                                " %s/%s: %s\n",
                                fsp->conn->connectpath,
-                               fsp->fsp_name->base_name,
+                               fsp_str_dbg(fsp),
                                strerror(errno));
                }
        }
@@ -1799,7 +1799,8 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct vfs_handle_struct *handle,
 
        if (ret == -1) {
                DBG_WARNING("Getting winattrs failed for %s: %s\n",
-                           fsp->fsp_name->base_name, strerror(errno));
+                           fsp_str_dbg(fsp),
+                           strerror(errno));
                return map_nt_error_from_unix(errno);
        }
 
index 10406f556fb8cd29d8518b04192e79be0a222448..4a52064d55f4e9f9ba7a0ccc0089a855085892eb 100644 (file)
@@ -764,7 +764,7 @@ static DIR *mh_fdopendir(vfs_handle_struct *handle,
        DIR *dirstream;
 
        DEBUG(MH_INFO_DEBUG, ("Entering with fsp->fsp_name->base_name '%s'\n",
-                             fsp->fsp_name->base_name));
+                             fsp_str_dbg(fsp)));
 
        dirstream = SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
        if (!dirstream)
@@ -801,7 +801,7 @@ out:
 err:
        /* Failure is freed here. */
        DEBUG(MH_ERR_DEBUG, ("Failing with fsp->fsp_name->base_name '%s'\n",
-                       fsp->fsp_name->base_name));
+                            fsp_str_dbg(fsp)));
        TALLOC_FREE(dirInfo);
        return NULL;
 }
index cf1447e8325f124e1aa35e0e4ba95a50eaf9a189..6fa2e77b13ffd85aff081767d235a926bb9e8c30 100644 (file)
@@ -566,8 +566,7 @@ static DIR *um_fdopendir(vfs_handle_struct *handle,
        struct um_dirinfo_struct *dirInfo = NULL;
        DIR *dirstream;
 
-       DEBUG(10, ("Entering with fsp->fsp_name->base_name '%s'\n",
-                  fsp->fsp_name->base_name));
+       DBG_DEBUG("Entering with fsp->fsp_name '%s'\n", fsp_str_dbg(fsp));
 
        dirstream = SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
        if (!dirstream) {
@@ -600,8 +599,7 @@ out:
        return (DIR *) dirInfo;
 
 err:
-       DEBUG(1, ("Failing with fsp->fsp_name->base_name '%s'\n",
-                 fsp->fsp_name->base_name));
+       DBG_WARNING("Failing with fsp->fsp_name '%s'\n", fsp_str_dbg(fsp));
        TALLOC_FREE(dirInfo);
        return NULL;
 }
@@ -1091,8 +1089,7 @@ static int um_fstat(vfs_handle_struct *handle,
 {
        int status = 0;
 
-       DEBUG(10, ("Entering with fsp->fsp_name->base_name "
-                  "'%s'\n", fsp_str_dbg(fsp)));
+       DBG_DEBUG("Entering with fsp->fsp_name '%s'\n", fsp_str_dbg(fsp));
 
        status = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
        if (status != 0) {
index 50988d25190de14951e135d6bf50d5ed3b0de580..e2d22c47d73dfcc32a24fbbde81e933f158b3dfe 100644 (file)
@@ -654,7 +654,8 @@ static ssize_t vxfs_fget_xattr(struct vfs_handle_struct *handle,
        */
 
        if (!called) {
-               DBG_DEBUG("No handle specified using path %s\n", fsp->fsp_name->base_name);
+               DBG_DEBUG("No handle specified using path %s\n",
+                         fsp_str_dbg(fsp));
                ret = vxfs_getxattr_path(fsp->fsp_name->base_name, name, value, size);
                if ((ret != -1) || ((errno != ENOTSUP) &&
                            (errno != ENOSYS) && (errno != ENODATA))) {
@@ -883,7 +884,8 @@ static NTSTATUS vxfs_fset_ea_dos_attributes(struct vfs_handle_struct *handle,
                */
 
                if (!called) {
-                       DBG_DEBUG("No handle specified using path %s\n", fsp->fsp_name->base_name);
+                       DBG_DEBUG("No handle specified using path %s\n",
+                                 fsp_str_dbg(fsp));
                        ret = vxfs_checkwxattr_path(fsp->fsp_name->base_name);
                }
 
index 21bcbe9e1c24c0f182c907b49c136f8076ea9286..04839f006def27a0c9fe147a4bd497ceb6f9fd9b 100644 (file)
@@ -1089,7 +1089,7 @@ NTSTATUS OpenDir_from_pathref(TALLOC_CTX *mem_ctx,
                                   &how);
                if (!NT_STATUS_IS_OK(status)) {
                        DBG_DEBUG("fd_openat(%s) returned %s\n",
-                                 dirfsp->fsp_name->base_name,
+                                 fsp_str_dbg(dirfsp),
                                  nt_errstr(status));
                        file_free(NULL, new_fsp);
                        return status;
index cce1dc3790aaf13ebdc31464324eb4c23f13d0f0..03118efbb1d9ea1932188b11f7208be7715fafa1 100644 (file)
@@ -1558,7 +1558,7 @@ NTSTATUS openat_pathref_fsp_lcomp(struct files_struct *dirfsp,
        full_fname = full_path_from_dirfsp_atname(conn, dirfsp, smb_fname_rel);
        if (full_fname == NULL) {
                DBG_DEBUG("full_path_from_dirfsp_atname(%s/%s) failed\n",
-                         dirfsp->fsp_name->base_name,
+                         fsp_str_dbg(dirfsp),
                          smb_fname_rel->base_name);
                file_free(NULL, fsp);
                return NT_STATUS_NO_MEMORY;
@@ -1585,7 +1585,7 @@ NTSTATUS openat_pathref_fsp_lcomp(struct files_struct *dirfsp,
        if ((fd == -1) && (errno == ENOENT)) {
                status = map_nt_error_from_unix(errno);
                DBG_DEBUG("smb_vfs_openat(%s/%s) failed: %s\n",
-                         dirfsp->fsp_name->base_name,
+                         fsp_str_dbg(dirfsp),
                          smb_fname_rel->base_name,
                          strerror(errno));
                file_free(NULL, fsp);
@@ -1630,7 +1630,7 @@ NTSTATUS openat_pathref_fsp_lcomp(struct files_struct *dirfsp,
                status = map_nt_error_from_unix(errno);
                DBG_DEBUG("SMB_VFS_%sSTAT(%s/%s) failed: %s\n",
                          (fd >= 0) ? "F" : "",
-                         dirfsp->fsp_name->base_name,
+                         fsp_str_dbg(dirfsp),
                          smb_fname_rel->base_name,
                          strerror(errno));
                fd_close(fsp);
index 61b5b60bcf68ffa36961990f8637172c2157c3ba..5970a7a9220b358e76007f86bc968ed4c5833352 100644 (file)
@@ -302,7 +302,7 @@ NTSTATUS change_notify_create(struct files_struct *fsp,
 
        if (fsp->notify != NULL) {
                DEBUG(1, ("change_notify_create: fsp->notify != NULL, "
-                         "fname = %s\n", fsp->fsp_name->base_name));
+                         "fname = %s\n", fsp_str_dbg(fsp)));
                return NT_STATUS_INVALID_PARAMETER;
        }
 
@@ -514,7 +514,7 @@ done:
 static struct files_struct *smbd_notifyd_reregister(struct files_struct *fsp,
                                                    void *private_data)
 {
-       DBG_DEBUG("reregister %s\n", fsp->fsp_name->base_name);
+       DBG_DEBUG("reregister %s\n", fsp_str_dbg(fsp));
 
        if ((fsp->conn->sconn->notify_ctx != NULL) &&
            (fsp->notify != NULL) &&
@@ -772,7 +772,8 @@ static void notify_fsp(files_struct *fsp, struct timespec when,
                          "expose=%s for %s notify %s\n",
                          has_sec_change_notify_privilege ? "true" : "false",
                          expose ? "true" : "false",
-                         fsp->fsp_name->base_name, name);
+                         fsp_str_dbg(fsp),
+                         name);
                if (!expose) {
                        return;
                }
index f8f63e85287c56e50266eb3ba1a3bd4342b2c881..228433eb3e99950396f30fe0617e52a31457d730 100644 (file)
@@ -658,9 +658,10 @@ static NTSTATUS smbd_smb2_create_durable_lease_check(struct smb_request *smb1req
        }
 
        if (!strequal(fsp->fsp_name->base_name, smb_fname->base_name)) {
-               DEBUG(10, ("Lease requested for file %s, reopened file "
-                          "is named %s\n", smb_fname->base_name,
-                          fsp->fsp_name->base_name));
+               DBG_DEBUG("Lease requested for file %s, reopened file "
+                         "is named %s\n",
+                         smb_fname->base_name,
+                         fsp_str_dbg(fsp));
                TALLOC_FREE(smb_fname);
                return NT_STATUS_INVALID_PARAMETER;
        }
index 0e66705425ad24a47ee20d8af7e47835874311fd..79712adda917e92373db0de84b1108785a4e231a 100644 (file)
@@ -452,7 +452,7 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
 
        DEBUG(8,("smbd_smb2_query_directory_send: dirpath=<%s> dontdescend=<%s>, "
                "in_output_buffer_length = %u\n",
-                fsp->fsp_name->base_name, lp_dont_descend(talloc_tos(), lp_sub, SNUM(conn)),
+                fsp_str_dbg(fsp), lp_dont_descend(talloc_tos(), lp_sub, SNUM(conn)),
                (unsigned int)in_output_buffer_length ));
 
        state->dont_descend = in_list(
index cc8f02ea12404556747ba98c3d1ed3b9b32a03bb..19f49f89a875a729268c8e371819bc7691ef07a9 100644 (file)
@@ -1558,7 +1558,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
        if (!NT_STATUS_IS_OK(status)) {
                DBG_NOTICE("Error %s rename %s -> %s\n",
                           nt_errstr(status),
-                          smb_fname_str_dbg(fsp->fsp_name),
+                          fsp_str_dbg(fsp),
                           smb_fname_str_dbg(smb_fname_dst));
                if (NT_STATUS_EQUAL(status,NT_STATUS_SHARING_VIOLATION))
                        status = NT_STATUS_ACCESS_DENIED;