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/smbd/dosmode.c | |
parent | 7bb3860f49cd8b09c2015f6646c07fe5ebaa0de3 (diff) | |
download | samba-48b0016cff4bad621b94fc0bf678ec15260dd7d7.tar.gz samba-48b0016cff4bad621b94fc0bf678ec15260dd7d7.tar.bz2 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/smbd/dosmode.c')
-rw-r--r-- | source3/smbd/dosmode.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index ade5e66e86..555718bd83 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -704,7 +704,8 @@ int file_set_dosmode(connection_struct *conn, const char *fname, than POSIX. *******************************************************************/ -int file_ntimes(connection_struct *conn, const char *fname, const struct timespec ts[2]) +int file_ntimes(connection_struct *conn, const char *fname, + struct smb_file_time *ft) { SMB_STRUCT_STAT sbuf; int ret = -1; @@ -713,9 +714,11 @@ int file_ntimes(connection_struct *conn, const char *fname, const struct timespe ZERO_STRUCT(sbuf); DEBUG(6, ("file_ntime: actime: %s", - time_to_asc(convert_timespec_to_time_t(ts[0])))); + time_to_asc(convert_timespec_to_time_t(ft->atime)))); DEBUG(6, ("file_ntime: modtime: %s", - time_to_asc(convert_timespec_to_time_t(ts[1])))); + time_to_asc(convert_timespec_to_time_t(ft->mtime)))); + DEBUG(6, ("file_ntime: createtime: %s", + time_to_asc(convert_timespec_to_time_t(ft->create_time)))); /* Don't update the time on read-only shares */ /* We need this as set_filetime (which can be called on @@ -728,7 +731,7 @@ int file_ntimes(connection_struct *conn, const char *fname, const struct timespe return 0; } - if(SMB_VFS_NTIMES(conn, fname, ts) == 0) { + if(SMB_VFS_NTIMES(conn, fname, ft) == 0) { return 0; } @@ -750,7 +753,7 @@ int file_ntimes(connection_struct *conn, const char *fname, const struct timespe if (can_write_to_file(conn, fname, &sbuf)) { /* We are allowed to become root and change the filetime. */ become_root(); - ret = SMB_VFS_NTIMES(conn, fname, ts); + ret = SMB_VFS_NTIMES(conn, fname, ft); unbecome_root(); } |