diff options
author | Derrell Lipman <derrell@samba.org> | 2006-09-02 21:47:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:39:47 -0500 |
commit | 5e44fc4cd47108245c567b9e676a5d8c09787d96 (patch) | |
tree | a5c7ca55269f524c240139de536c9797d8ca4904 /source3/libsmb/clirap.c | |
parent | b7a5e3de1eac86bd460aed341ec17a01f4b82e5f (diff) | |
download | samba-5e44fc4cd47108245c567b9e676a5d8c09787d96.tar.gz samba-5e44fc4cd47108245c567b9e676a5d8c09787d96.tar.bz2 samba-5e44fc4cd47108245c567b9e676a5d8c09787d96.zip |
r18009: Fixes bug 4026.
This completes the work Jeremy began last week, disambiguating the meaning of
c_time. (In POSIX terminology, c_time means "status Change time", not "create
time".) All uses of c_time, a_time and m_time have now been replaced with
change_time, access_time, and write_time, and when creation time is intended,
create_time is used.
Additionally, the capability of setting and retrieving the create time have
been added to the smbc_setxattr() and smbc_getxattr() functions. An example
of setting all four times can be seen with the program
examples/libsmbclient/testacl
with the following command line similar to:
testacl -f -S "system.*:CREATE_TIME:1000000000,ACCESS_TIME:1000000060,WRITE_TIME:1000000120,CHANGE_TIME:1000000180" 'smb://server/share/testfile.txt'
The -f option turns on the new mode which uses full time names in the
attribute specification (e.g. ACCESS_TIME vs A_TIME).
(This used to be commit 8e119b64f1d92026dda855d904be09912a40601c)
Diffstat (limited to 'source3/libsmb/clirap.c')
-rw-r--r-- | source3/libsmb/clirap.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index 677c8f1fc3..caa23b59d9 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -379,7 +379,9 @@ BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char send a qpathinfo call ****************************************************************************/ BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, - time_t *c_time, time_t *a_time, time_t *m_time, + time_t *change_time, + time_t *access_time, + time_t *write_time, SMB_OFF_T *size, uint16 *mode) { unsigned int data_len = 0; @@ -434,14 +436,14 @@ BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, date_fn = cli_make_unix_date2; } - if (c_time) { - *c_time = date_fn(cli, rdata+0); + if (change_time) { + *change_time = date_fn(cli, rdata+0); } - if (a_time) { - *a_time = date_fn(cli, rdata+4); + if (access_time) { + *access_time = date_fn(cli, rdata+4); } - if (m_time) { - *m_time = date_fn(cli, rdata+8); + if (write_time) { + *write_time = date_fn(cli, rdata+8); } if (size) { *size = IVAL(rdata, 12); @@ -460,7 +462,11 @@ BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, send a setpathinfo call ****************************************************************************/ BOOL cli_setpathinfo(struct cli_state *cli, const char *fname, - time_t c_time, time_t a_time, time_t m_time, uint16 mode) + time_t create_time, + time_t access_time, + time_t write_time, + time_t change_time, + uint16 mode) { unsigned int data_len = 0; unsigned int param_len = 0; @@ -495,16 +501,16 @@ BOOL cli_setpathinfo(struct cli_state *cli, const char *fname, * Add the create, last access, modification, and status change times */ - /* Don't set create time, at offset 0 */ + put_long_date(p, create_time); p += 8; - put_long_date(p, a_time); + put_long_date(p, access_time); p += 8; - put_long_date(p, m_time); + put_long_date(p, write_time); p += 8; - put_long_date(p, c_time); + put_long_date(p, change_time); p += 8; /* Add attributes */ @@ -555,8 +561,11 @@ send a qpathinfo call with the SMB_QUERY_FILE_ALL_INFO info level ****************************************************************************/ BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname, - struct timespec *create_time, struct timespec *access_time, struct timespec *write_time, - struct timespec *change_time, SMB_OFF_T *size, uint16 *mode, + struct timespec *create_time, + struct timespec *access_time, + struct timespec *write_time, + struct timespec *change_time, + SMB_OFF_T *size, uint16 *mode, SMB_INO_T *ino) { unsigned int data_len = 0; @@ -670,8 +679,11 @@ send a qfileinfo call ****************************************************************************/ BOOL cli_qfileinfo(struct cli_state *cli, int fnum, uint16 *mode, SMB_OFF_T *size, - struct timespec *create_time, struct timespec *access_time, struct timespec *write_time, - struct timespec *change_time, SMB_INO_T *ino) + struct timespec *create_time, + struct timespec *access_time, + struct timespec *write_time, + struct timespec *change_time, + SMB_INO_T *ino) { unsigned int data_len = 0; unsigned int param_len = 0; |