summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmb_compat.c
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2005-06-01 17:40:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:04 -0500
commite317034997bbeab447298070afdb1b78c60e0e69 (patch)
tree06e4d09719d735ebba861a74e2e60fe9f404623e /source3/libsmb/libsmb_compat.c
parent0100bb0eb697105db7ef1473455a8b180ca43cb4 (diff)
downloadsamba-e317034997bbeab447298070afdb1b78c60e0e69.tar.gz
samba-e317034997bbeab447298070afdb1b78c60e0e69.tar.bz2
samba-e317034997bbeab447298070afdb1b78c60e0e69.zip
r7168: Updating file times from libsmbclient was not working for win98. Although
the function that was being used to set attributes is a core protocol function (SMBsetatr = 0x09), it does not appear to work on win98. As a temporary measure, when file times are to be set, this version opens the file and uses SMBsetattrE = 0x22 instead. (The other advantage of this function over the original one is that it supports setting access time as well as modification time.) The next step, the proper solution if it can be made to work, is to write functions that use TRANS2_SET_PATH_INFO instead. (This used to be commit bab0bf7f4f9d2a4b6fcee4429094349302bbeb33)
Diffstat (limited to 'source3/libsmb/libsmb_compat.c')
-rw-r--r--source3/libsmb/libsmb_compat.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/libsmb/libsmb_compat.c b/source3/libsmb/libsmb_compat.c
index 83088a14de..3dc60f7240 100644
--- a/source3/libsmb/libsmb_compat.c
+++ b/source3/libsmb/libsmb_compat.c
@@ -303,14 +303,16 @@ int smbc_utimes(const char *fname, struct timeval *tbuf)
#ifdef HAVE_UTIME_H
int smbc_utime(const char *fname, struct utimbuf *utbuf)
{
- struct timeval tv;
+ struct timeval tv[2];
if (utbuf == NULL)
return statcont->utimes(statcont, fname, NULL);
- tv.tv_sec = utbuf->modtime;
- tv.tv_usec = 0;
- return statcont->utimes(statcont, fname, &tv);
+ tv[0].tv_sec = utbuf->actime;
+ tv[1].tv_sec = utbuf->modtime;
+ tv[0].tv_usec = tv[1].tv_usec = 0;
+
+ return statcont->utimes(statcont, fname, tv);
}
#endif