diff options
author | Karel Zak | 2010-11-23 20:39:55 +0100 |
---|---|---|
committer | Karel Zak | 2011-01-03 12:28:46 +0100 |
commit | b0bb8fb6f9c3d54d230b785695a5bceab7e3f320 (patch) | |
tree | 967b3095dab666a892f40271598dd359dfd5fc12 /shlibs/mount/src/utils.c | |
parent | tests: improve libmount context mount and umount test (diff) | |
download | kernel-qcow2-util-linux-b0bb8fb6f9c3d54d230b785695a5bceab7e3f320.tar.gz kernel-qcow2-util-linux-b0bb8fb6f9c3d54d230b785695a5bceab7e3f320.tar.xz kernel-qcow2-util-linux-b0bb8fb6f9c3d54d230b785695a5bceab7e3f320.zip |
libmount: fix utab file and dir modes, add new debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/utils.c')
-rw-r--r-- | shlibs/mount/src/utils.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/shlibs/mount/src/utils.c b/shlibs/mount/src/utils.c index 6af8d14f4..468b0bb3d 100644 --- a/shlibs/mount/src/utils.c +++ b/shlibs/mount/src/utils.c @@ -37,6 +37,8 @@ char *mnt_getenv_safe(const char *arg) { + return getenv(arg); + if ((getuid() != geteuid()) || (getgid() != getegid())) return NULL; #if HAVE_PRCTL @@ -510,7 +512,8 @@ static int try_write(const char *filename) if (!filename) return -EINVAL; - fd = open(filename, O_RDWR, 0644); + fd = open(filename, O_RDWR|O_CREAT, S_IWUSR| \ + S_IRUSR|S_IRGRP|S_IROTH); if (fd >= 0) { close(fd); return 0; @@ -612,7 +615,9 @@ int mnt_has_regular_utab(const char **utab, int *writable) stripoff_last_component(dirname); /* remove filename */ - rc = mkdir(dirname, 755); + rc = mkdir(dirname, S_IWUSR| + S_IRUSR|S_IRGRP|S_IROTH| + S_IXUSR|S_IXGRP|S_IXOTH); free(dirname); if (rc && errno != EEXIST) goto done; /* probably EACCES */ |