summaryrefslogtreecommitdiff
path: root/source3/smbwrapper/smbw_stat.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_stat.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_stat.c')
-rw-r--r--source3/smbwrapper/smbw_stat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/smbwrapper/smbw_stat.c b/source3/smbwrapper/smbw_stat.c
index ab351d56b1..a6d01f66d6 100644
--- a/source3/smbwrapper/smbw_stat.c
+++ b/source3/smbwrapper/smbw_stat.c
@@ -33,6 +33,8 @@ setup basic info in a stat structure
void smbw_setup_stat(struct stat *st, char *fname, size_t size, int mode)
{
ZERO_STRUCTP(st);
+
+ st->st_mode = 0;
if (IS_DOS_DIR(mode)) {
st->st_mode = SMBW_DIR_MODE;
@@ -40,6 +42,11 @@ void smbw_setup_stat(struct stat *st, char *fname, size_t size, int mode)
st->st_mode = SMBW_FILE_MODE;
}
+ if (IS_DOS_ARCHIVE(mode)) st->st_mode |= S_IXUSR;
+ if (IS_DOS_SYSTEM(mode)) st->st_mode |= S_IXGRP;
+ if (IS_DOS_HIDDEN(mode)) st->st_mode |= S_IXOTH;
+ if (!IS_DOS_READONLY(mode)) st->st_mode |= S_IWUSR;
+
st->st_size = size;
st->st_blksize = 512;
st->st_blocks = (size+511)/512;