From: Volker Lendecke Date: Fri, 12 Sep 2025 17:16:28 +0000 (+0200) Subject: smbd: Use fsp_str_dbg() in DEBUGs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70aab08c6;p=thirdparty%2Fsamba.git smbd: Use fsp_str_dbg() in DEBUGs 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c index 0cea2ba23fe..90d8df3809a 100644 --- a/source3/lib/adouble.c +++ b/source3/lib/adouble.c @@ -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; } diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c index a261c77aca5..b47ef613de6 100644 --- a/source3/modules/nfs4_acls.c +++ b/source3/modules/nfs4_acls.c @@ -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, diff --git a/source3/modules/vfs_ceph_new.c b/source3/modules/vfs_ceph_new.c index c71adcc5678..667de1959bc 100644 --- a/source3/modules/vfs_ceph_new.c +++ b/source3/modules/vfs_ceph_new.c @@ -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); } diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c index 67011735d26..ffc22a02f9b 100644 --- a/source3/modules/vfs_ceph_snapshots.c +++ b/source3/modules/vfs_ceph_snapshots.c @@ -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) { diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index d4f2cbc06c8..866348e3043 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -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; diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index dffe5990253..0164c3f2033 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -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); } diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c index 10406f556fb..4a52064d55f 100644 --- a/source3/modules/vfs_media_harmony.c +++ b/source3/modules/vfs_media_harmony.c @@ -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; } diff --git a/source3/modules/vfs_unityed_media.c b/source3/modules/vfs_unityed_media.c index cf1447e8325..6fa2e77b13f 100644 --- a/source3/modules/vfs_unityed_media.c +++ b/source3/modules/vfs_unityed_media.c @@ -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) { diff --git a/source3/modules/vfs_vxfs.c b/source3/modules/vfs_vxfs.c index 50988d25190..e2d22c47d73 100644 --- a/source3/modules/vfs_vxfs.c +++ b/source3/modules/vfs_vxfs.c @@ -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); } diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 21bcbe9e1c2..04839f006de 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -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; diff --git a/source3/smbd/files.c b/source3/smbd/files.c index cce1dc3790a..03118efbb1d 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -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); diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index 61b5b60bcf6..5970a7a9220 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -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; } diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index f8f63e85287..228433eb3e9 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -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; } diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c index 0e66705425a..79712adda91 100644 --- a/source3/smbd/smb2_query_directory.c +++ b/source3/smbd/smb2_query_directory.c @@ -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( diff --git a/source3/smbd/smb2_reply.c b/source3/smbd/smb2_reply.c index cc8f02ea124..19f49f89a87 100644 --- a/source3/smbd/smb2_reply.c +++ b/source3/smbd/smb2_reply.c @@ -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;