diff options
author | todd stecher <todd.stecher@gmail.com> | 2009-01-23 14:40:19 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-01-23 21:05:38 -0800 |
commit | 48b0016cff4bad621b94fc0bf678ec15260dd7d7 (patch) | |
tree | 960f825709d1a8eb2af5fb0afb31553262ee290f /source3/modules/vfs_recycle.c | |
parent | 7bb3860f49cd8b09c2015f6646c07fe5ebaa0de3 (diff) | |
download | samba-48b0016cff4bad621b94fc0bf678ec15260dd7d7.tar.gz samba-48b0016cff4bad621b94fc0bf678ec15260dd7d7.tar.xz samba-48b0016cff4bad621b94fc0bf678ec15260dd7d7.zip |
Extend NTIMES to allow setting create_time
1) Add in smb_file_time struct to clarify code and make room for createtime.
2) Get and set create time from SMB messages.
3) Fixup existing VFS modules + examples Some OS'es allow for the
setting of the birthtime through kernel interfaces. This value is
generically used for Windows createtime, but is not settable in the
code today.
Diffstat (limited to 'source3/modules/vfs_recycle.c')
-rw-r--r-- | source3/modules/vfs_recycle.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c index cb985e1be22..2b0edcdb4a1 100644 --- a/source3/modules/vfs_recycle.c +++ b/source3/modules/vfs_recycle.c @@ -391,19 +391,21 @@ static void recycle_do_touch(vfs_handle_struct *handle, const char *fname, bool touch_mtime) { SMB_STRUCT_STAT st; - struct timespec ts[2]; + struct smb_file_time ft; int ret, err; + ZERO_STRUCT(ft); + if (SMB_VFS_NEXT_STAT(handle, fname, &st) != 0) { DEBUG(0,("recycle: stat for %s returned %s\n", fname, strerror(errno))); return; } - ts[0] = timespec_current(); /* atime */ - ts[1] = touch_mtime ? ts[0] : get_mtimespec(&st); /* mtime */ + ft.atime = timespec_current(); /* atime */ + ft.mtime = touch_mtime ? ft.atime : get_mtimespec(&st); /* mtime */ become_root(); - ret = SMB_VFS_NEXT_NTIMES(handle, fname, ts); + ret = SMB_VFS_NEXT_NTIMES(handle, fname, &ft); err = errno; unbecome_root(); if (ret == -1 ) { |