summaryrefslogtreecommitdiff
path: root/source3/smbwrapper/smbw.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-06 11:14:52 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-06 11:14:52 +0000
commit58f6c75babebcf05c9ef5bb50dc433e55156b6ec (patch)
treeb43eee685ae5c6204e831b16f87beea9b1c889ac /source3/smbwrapper/smbw.c
parented75bab8e22c1cbebe0238a689f7994f3817ee8f (diff)
downloadsamba-58f6c75babebcf05c9ef5bb50dc433e55156b6ec.tar.gz
samba-58f6c75babebcf05c9ef5bb50dc433e55156b6ec.tar.bz2
samba-58f6c75babebcf05c9ef5bb50dc433e55156b6ec.zip
implemented attribute mapping and chmod. file attributes are mapped in
the same manner as smbd. See the README for a full explanation. (This used to be commit 0a5dcddd3fa23081d7cd214acc32b8046125a74e)
Diffstat (limited to 'source3/smbwrapper/smbw.c')
-rw-r--r--source3/smbwrapper/smbw.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/smbwrapper/smbw.c b/source3/smbwrapper/smbw.c
index d6b377a0b5..ab2b807f6c 100644
--- a/source3/smbwrapper/smbw.c
+++ b/source3/smbwrapper/smbw.c
@@ -1059,13 +1059,18 @@ int smbw_chmod(const char *fname, mode_t newmode)
goto failed;
}
- if (!cli_getatr(&srv->cli, path, &mode, NULL, NULL)) {
+ mode = 0;
+
+ if (!(newmode & (S_IWUSR | S_IWGRP | S_IWOTH))) mode |= aRONLY;
+ if ((newmode & S_IXUSR) && lp_map_archive(-1)) mode |= aARCH;
+ if ((newmode & S_IXGRP) && lp_map_system(-1)) mode |= aSYSTEM;
+ if ((newmode & S_IXOTH) && lp_map_hidden(-1)) mode |= aHIDDEN;
+
+ if (!cli_setatr(&srv->cli, path, mode, 0)) {
errno = smbw_errno(&srv->cli);
goto failed;
}
- /* assume success for the moment - need to add attribute mapping */
-
smbw_busy--;
return 0;