summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-09-20 20:20:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:03:41 -0500
commit1970294ab3df66d36b713dc8811527ddc8e99bd0 (patch)
tree330b36ef540426243f9615df5ec7509d8fd2a10c /source3
parentb3b2910f8fbcd12a717e6b9090a87a8db87c339f (diff)
downloadsamba-1970294ab3df66d36b713dc8811527ddc8e99bd0.tar.gz
samba-1970294ab3df66d36b713dc8811527ddc8e99bd0.tar.bz2
samba-1970294ab3df66d36b713dc8811527ddc8e99bd0.zip
r10359: Ensure that smb.conf requests for hidden files are honored, even
when DOS attributes are stored in EA's. Jeremy. (This used to be commit 758b30710e9f84f19b79c39afddc742aef495ebd)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/dosmode.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index ee2f1095fa..efbd5f04cb 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -297,27 +297,28 @@ uint32 dos_mode(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf)
return 0;
}
- /* Get the DOS attributes from an EA by preference. */
- if (get_ea_dos_attribute(conn, path, sbuf, &result)) {
- result |= set_sparse_flag(sbuf);
- return result;
- }
-
- result = dos_mode_from_sbuf(conn, path, sbuf);
-
- /* Now do any modifications that depend on the path name. */
+ /* First do any modifications that depend on the path name. */
/* hide files with a name starting with a . */
if (lp_hide_dot_files(SNUM(conn))) {
const char *p = strrchr_m(path,'/');
- if (p)
+ if (p) {
p++;
- else
+ } else {
p = path;
+ }
- if (p[0] == '.' && p[1] != '.' && p[1] != 0)
+ if (p[0] == '.' && p[1] != '.' && p[1] != 0) {
result |= aHIDDEN;
+ }
}
+ /* Get the DOS attributes from an EA by preference. */
+ if (get_ea_dos_attribute(conn, path, sbuf, &result)) {
+ result |= set_sparse_flag(sbuf);
+ } else {
+ result |= dos_mode_from_sbuf(conn, path, sbuf);
+ }
+
/* Optimization : Only call is_hidden_path if it's not already
hidden. */
if (!(result & aHIDDEN) && IS_HIDDEN_PATH(conn,path)) {