diff options
author | Tim Prouty <tprouty@samba.org> | 2009-07-02 13:39:20 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-07-06 15:38:42 -0700 |
commit | 3cb0e521e1bdddde972b6fd08fb86f7fe73da8d5 (patch) | |
tree | 22777dd2e4d6db9f30b19275a91a9dd3c21a2fbf /source3/modules/onefs_streams.c | |
parent | f39232a8fb93cfccfe1533ab613867572ff7f848 (diff) | |
download | samba-3cb0e521e1bdddde972b6fd08fb86f7fe73da8d5.tar.gz samba-3cb0e521e1bdddde972b6fd08fb86f7fe73da8d5.tar.bz2 samba-3cb0e521e1bdddde972b6fd08fb86f7fe73da8d5.zip |
s3: Plumb smb_filename through SMB_VFS_NTIMES
Diffstat (limited to 'source3/modules/onefs_streams.c')
-rw-r--r-- | source3/modules/onefs_streams.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/source3/modules/onefs_streams.c b/source3/modules/onefs_streams.c index 2a31036862..2be490f52d 100644 --- a/source3/modules/onefs_streams.c +++ b/source3/modules/onefs_streams.c @@ -508,15 +508,15 @@ int onefs_unlink(vfs_handle_struct *handle, return ret; } -int onefs_vtimes_streams(vfs_handle_struct *handle, const char *fname, +int onefs_vtimes_streams(vfs_handle_struct *handle, + const struct smb_filename *smb_fname, int flags, struct timespec times[3]) { + struct smb_filename *smb_fname_onefs = NULL; int ret; - bool is_stream; - char *base; - char *stream; int dirfd; int saved_errno; + NTSTATUS status; START_PROFILE(syscall_ntimes); @@ -524,23 +524,40 @@ int onefs_vtimes_streams(vfs_handle_struct *handle, const char *fname, if (ret) return ret; - if (!is_stream) { - ret = vtimes(fname, times, flags); + if (!is_ntfs_stream_smb_fname(smb_fname)) { + ret = vtimes(smb_fname->base_name, times, flags); return ret; } - dirfd = get_stream_dir_fd(handle->conn, base, NULL); - if (dirfd < -1) { + status = onefs_stream_prep_smb_fname(talloc_tos(), smb_fname, + &smb_fname_onefs); + if (!NT_STATUS_IS_OK(status)) { + errno = map_errno_from_nt_status(status); return -1; } - ret = enc_vtimesat(dirfd, stream, ENC_DEFAULT, times, flags); + /* Default stream (the ::$DATA was just stripped off). */ + if (!is_ntfs_stream_smb_fname(smb_fname_onefs)) { + ret = vtimes(smb_fname_onefs->base_name, times, flags); + goto out; + } + + dirfd = get_stream_dir_fd(handle->conn, smb_fname->base_name, NULL); + if (dirfd < -1) { + ret = -1; + goto out; + } - END_PROFILE(syscall_ntimes); + ret = enc_vtimesat(dirfd, smb_fname_onefs->stream_name, ENC_DEFAULT, + times, flags); saved_errno = errno; close(dirfd); errno = saved_errno; + + out: + END_PROFILE(syscall_ntimes); + TALLOC_FREE(smb_fname_onefs); return ret; } |