summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-06 11:56:44 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-06 11:56:44 +0000
commit4fe9c5b65614d048c053989ab3d1e97b1bbcfa2b (patch)
tree7420818d8f76705d5ab97d64f53984e263d6857f
parent58f6c75babebcf05c9ef5bb50dc433e55156b6ec (diff)
downloadsamba-4fe9c5b65614d048c053989ab3d1e97b1bbcfa2b.tar.gz
samba-4fe9c5b65614d048c053989ab3d1e97b1bbcfa2b.tar.bz2
samba-4fe9c5b65614d048c053989ab3d1e97b1bbcfa2b.zip
fixed a bug in time setting (utime() call)
(This used to be commit 2f4506a33c7015f2a176929d794c6c40f1433591)
-rw-r--r--source3/smbwrapper/smbw.c7
-rw-r--r--source3/smbwrapper/smbw_dir.c14
2 files changed, 12 insertions, 9 deletions
diff --git a/source3/smbwrapper/smbw.c b/source3/smbwrapper/smbw.c
index ab2b807f6c..e5359360c3 100644
--- a/source3/smbwrapper/smbw.c
+++ b/source3/smbwrapper/smbw.c
@@ -955,8 +955,11 @@ static int smbw_settime(const char *fname, time_t t)
}
if (!cli_setatr(&srv->cli, path, mode, t)) {
- errno = smbw_errno(&srv->cli);
- goto failed;
+ /* some servers always refuse directory changes */
+ if (!(mode & aDIR)) {
+ errno = smbw_errno(&srv->cli);
+ goto failed;
+ }
}
smbw_busy--;
diff --git a/source3/smbwrapper/smbw_dir.c b/source3/smbwrapper/smbw_dir.c
index 5223183d56..a932c102dc 100644
--- a/source3/smbwrapper/smbw_dir.c
+++ b/source3/smbwrapper/smbw_dir.c
@@ -374,14 +374,13 @@ int smbw_chdir(const char *name)
/* a special case - accept cd to /smb */
if (strncmp(cwd, smbw_prefix, len-1) == 0 &&
cwd[len-1] == 0) {
- goto success;
+ goto success1;
}
if (strncmp(cwd,smbw_prefix,strlen(smbw_prefix))) {
if (real_chdir(cwd) == 0) {
- goto success;
+ goto success2;
}
- errno = ENOENT;
goto failed;
}
@@ -405,7 +404,11 @@ int smbw_chdir(const char *name)
goto failed;
}
- success:
+ success1:
+ /* we don't want the old directory to be busy */
+ real_chdir("/");
+
+ success2:
DEBUG(4,("set SMBW_CWD to %s\n", cwd));
@@ -414,9 +417,6 @@ int smbw_chdir(const char *name)
DEBUG(4,("setenv failed\n"));
}
- /* we don't want the old directory to be busy */
- real_chdir("/");
-
smbw_busy--;
return 0;