diff options
author | Ralph Boehme <slow@samba.org> | 2021-08-05 12:08:00 +0200 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2021-09-06 19:17:11 +0000 |
commit | 19485894d4b3b7e9f806434c686e880a94c8069b (patch) | |
tree | 17fb838943bcf004ca3bf063fd8e8795c8d6ab38 /source3 | |
parent | a0fe4423b8e2fa9396a293910028ac4b53d81ec3 (diff) | |
download | samba-19485894d4b3b7e9f806434c686e880a94c8069b.tar.gz |
vfs_gpfs: deal with pathrefs fsps in smbd_gpfs_set_times()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14771
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Aug 26 20:08:51 UTC 2021 on sn-devel-184
(cherry picked from commit fead05a45556993b80a84fe9bb07b10debb4ae62)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/modules/vfs_gpfs.c | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 1f5fdadc9c5..4d1cfa6075a 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -1732,13 +1732,45 @@ static int smbd_gpfs_set_times(struct files_struct *fsp, return 0; } - rc = gpfswrap_set_times(fsp_get_io_fd(fsp), flags, gpfs_times); - if (rc != 0) { - DBG_WARNING("gpfs_set_times() returned with error %s for %s\n", - strerror(errno), - fsp_str_dbg(fsp)); + if (!fsp->fsp_flags.is_pathref) { + rc = gpfswrap_set_times(fsp_get_io_fd(fsp), flags, gpfs_times); + if (rc != 0) { + DBG_WARNING("gpfs_set_times(%s) failed: %s\n", + fsp_str_dbg(fsp), strerror(errno)); + } + return rc; } + + if (fsp->fsp_flags.have_proc_fds) { + int fd = fsp_get_pathref_fd(fsp); + const char *p = NULL; + char buf[PATH_MAX]; + + p = sys_proc_fd_path(fd, buf, sizeof(buf)); + if (p == NULL) { + return -1; + } + + rc = gpfswrap_set_times_path(buf, flags, gpfs_times); + if (rc != 0) { + DBG_WARNING("gpfs_set_times_path(%s,%s) failed: %s\n", + fsp_str_dbg(fsp), p, strerror(errno)); + } + return rc; + } + + /* + * This is no longer a handle based call. + */ + + rc = gpfswrap_set_times_path(fsp->fsp_name->base_name, + flags, + gpfs_times); + if (rc != 0) { + DBG_WARNING("gpfs_set_times_path(%s) failed: %s\n", + fsp_str_dbg(fsp), strerror(errno)); + } return rc; } |