summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-08-14 23:15:02 +0000
committerJeremy Allison <jra@samba.org>2003-08-14 23:15:02 +0000
commit1699fadcdb86462c0b36f0479317dc52ae8a263a (patch)
treec247bbc4ce508cde4171bbad96402b429aae851a /source3/smbd/trans2.c
parentb679661d275e7e5ebafb665654cb39a2003b67bc (diff)
downloadsamba-1699fadcdb86462c0b36f0479317dc52ae8a263a.tar.gz
samba-1699fadcdb86462c0b36f0479317dc52ae8a263a.tar.bz2
samba-1699fadcdb86462c0b36f0479317dc52ae8a263a.zip
Fix changing of attributes via setattr. Samba4 test fixes.
Jeremy. (This used to be commit 97e1d5c9573513c9c9be9a709341bda54fbe44be)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 8adac1930f..efce768177 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1871,6 +1871,9 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
base_name = p+1;
mode = dos_mode(conn,fname,&sbuf);
+ if (!mode)
+ mode = FILE_ATTRIBUTE_NORMAL;
+
fullpathname = fname;
file_size = get_file_size(sbuf);
allocation_size = get_allocation_size(fsp,&sbuf);
@@ -2915,10 +2918,15 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n",
DEBUG(6,("modtime: %s ", ctime(&tvs.modtime)));
DEBUG(6,("size: %.0f ", (double)size));
- if (S_ISDIR(sbuf.st_mode))
- dosmode |= aDIR;
- else
- dosmode &= ~aDIR;
+ if (dosmode == FILE_ATTRIBUTE_NORMAL)
+ dosmode = 0;
+
+ if (dosmode) {
+ if (S_ISDIR(sbuf.st_mode))
+ dosmode |= aDIR;
+ else
+ dosmode &= ~aDIR;
+ }
DEBUG(6,("dosmode: %x\n" , dosmode));