From d18fd120edea93e64ceebab1ff50189481d01beb Mon Sep 17 00:00:00 2001 From: wbaumann Date: Mon, 12 Aug 2013 19:46:43 +0000 Subject: [PATCH] Fix default modes --- ChangeLog | 4 ++++ src/cache.c | 5 +++-- src/defaults.h | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e08c0bb..0ce8251 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ ChangeLog for davfs2 -------------------- +2013-08-12 Werner Baumann (werner.baumann@onlinehome.de) + * cache.c, defaults.h: + Fix default modes. + 2013-08-12 Werner Baumann (werner.baumann@onlinehome.de) * cache.c, mount_davfs.c; Make default access modes 755 and 644. diff --git a/src/cache.c b/src/cache.c index 3c716f8..a46a20c 100644 --- a/src/cache.c +++ b/src/cache.c @@ -587,8 +587,8 @@ dav_init_cache(const dav_args *args, const char *mpoint) default_uid = args->fsuid; default_gid = args->fsgid; - default_file_mode = args->file_mode | S_IFREG; - default_dir_mode = args->dir_mode | S_IFDIR; + default_file_mode = args->file_mode; + default_dir_mode = args->dir_mode; table_size = args->table_size; table = xcalloc(table_size, sizeof(*table)); @@ -1964,6 +1964,7 @@ new_node(dav_node *parent, mode_t mode) node->dirty = 0; node->uid = default_uid; node->gid = default_gid; + node->mode = mode; if (debug) syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "new node: %p->%p", diff --git a/src/defaults.h b/src/defaults.h index 41f7459..45a813a 100644 --- a/src/defaults.h +++ b/src/defaults.h @@ -109,11 +109,11 @@ /* Mode of directories. May be overridden by command line or fstab. */ -#define DAV_DIR_MODE (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) +#define DAV_DIR_MODE (S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) /* Mode of regular files. May be overridden by command line or fstab. */ -#define DAV_FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) +#define DAV_FILE_MODE (S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) /* WebDAV */