Make default access modes 755 and 644

This commit is contained in:
wbaumann 2013-08-12 17:40:36 +00:00
parent ebfd3e6f8e
commit 0a42f0c625
3 changed files with 6 additions and 36 deletions

View File

@ -1,6 +1,10 @@
ChangeLog for davfs2
--------------------

2013-08-12 Werner Baumann (werner.baumann@onlinehome.de)
* cache.c, mount_davfs.c;
Make default access modes 755 and 644.

2013-08-12 Werner Baumann (werner.baumann@onlinehome.de)
* cache.c, mount_davfs.c, mount_davfs.h:
Remove file_umask and dir_umask (bug #34563).

View File

@ -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;
default_dir_mode = args->dir_mode;
default_file_mode = args->file_mode | S_IFREG;
default_dir_mode = args->dir_mode | S_IFDIR;

table_size = args->table_size;
table = xcalloc(table_size, sizeof(*table));

View File

@ -182,9 +182,6 @@ debug_opts_neon(const char *s);
static void
delete_args(dav_args *args);

static void
eval_modes(dav_args *args);

static void
expand_home(char **dir, const dav_args *args);

@ -939,8 +936,6 @@ parse_config(dav_args *args)
args->dav_group);
args->dav_gid = grp->gr_gid;

eval_modes(args);

if (args->trust_ca_cert)
args->ca_cert = read_cert(&args->trust_ca_cert, args);

@ -1373,32 +1368,6 @@ delete_args(dav_args *args)
}


/* Evaluates the umask and the default modes for directories and files from
args->mopts, umask(), args->dir_mode and args->file_mode and stores them
in args.
Requires: mopts, dir_mode, file_mode. */
static void
eval_modes(dav_args *args)
{
mode_t default_mode = umask(0);
umask(default_mode);
default_mode = ~default_mode;
default_mode &= S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;

if (!args->dir_mode) {
args->dir_mode = default_mode;
args->dir_mode |= (args->dir_mode & S_IRUSR) ? S_IXUSR : 0;
args->dir_mode |= (args->dir_mode & S_IRGRP) ? S_IXGRP : 0;
args->dir_mode |= (args->dir_mode & S_IROTH) ? S_IXOTH : 0;
}
args->dir_mode |= S_IFDIR;

if (!args->file_mode)
args->file_mode = default_mode;
args->file_mode |= S_IFREG;
}


/* If *dir starts with '~/' or '~user/' it is turned into an
absolute filename (starting with '/') in the user's home directory.
user must be the name of the mounting user.
@ -1617,11 +1586,8 @@ new_args(void)
args->mopts = DAV_MOPTS;
args->buf_size = DAV_FUSE_BUF_SIZE;

/* TODO: activate after changing default mode and rmoving
umask. Remove eval_mode.
args->dir_mode = DAV_DIR_MODE;
args->file_mode = DAV_FILE_MODE;
*/

args->p_port = DAV_DEFAULT_PROXY_PORT;
args->useproxy = DAV_USE_PROXY;