summaryrefslogtreecommitdiffstats
path: root/source/libsmb/clirap.c
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-09-02 21:47:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:39:47 -0500
commit8e119b64f1d92026dda855d904be09912a40601c (patch)
tree847daeee117a2323a1b2a0995ff6e9a48c760341 /source/libsmb/clirap.c
parentbf7bf8e4e9a279fe3ef1e9ff655b12f65c3c3e67 (diff)
downloadsamba-8e119b64f1d92026dda855d904be09912a40601c.tar.gz
samba-8e119b64f1d92026dda855d904be09912a40601c.tar.xz
samba-8e119b64f1d92026dda855d904be09912a40601c.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).
Diffstat (limited to 'source/libsmb/clirap.c')
-rw-r--r--source/libsmb/clirap.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/source/libsmb/clirap.c b/source/libsmb/clirap.c
index 677c8f1fc3d..caa23b59d9a 100644
--- a/source/libsmb/clirap.c
+++ b/source/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;