aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2012-09-14 17:00:23 +0300
committerMartin Pärtel <martin.partel@gmail.com>2012-09-14 17:00:23 +0300
commit63f687ed8efbbf0cce478e8b397d2b81fe0d90e6 (patch)
tree86e549e48054f76f071e106938a4573dbaf9dec7 /src
parentf6161698827488cc21f3f3726d5af0cb2a89ce4b (diff)
downloadbindfs-63f687ed8efbbf0cce478e8b397d2b81fe0d90e6.tar.gz
Use my_dirname instead of dirname for thread-safety.
Diffstat (limited to 'src')
-rw-r--r--src/bindfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bindfs.c b/src/bindfs.c
index 754bc0e..df0746c 100644
--- a/src/bindfs.c
+++ b/src/bindfs.c
@@ -52,7 +52,6 @@
#include <errno.h>
#include <getopt.h>
#include <assert.h>
-#include <libgen.h>
#include <pwd.h>
#include <grp.h>
#include <limits.h>
@@ -297,14 +296,15 @@ static void chown_new_file(const char *path, struct fuse_context *fc, int (*chow
gid_t file_group;
if (settings.create_policy == CREATE_AS_USER) {
- char *path_copy, *dir_path;
+ char *path_copy;
+ const char *dir_path;
struct stat stbuf;
file_owner = fc->uid;
file_group = fc->gid;
path_copy = strdup(path);
- dir_path = dirname(path_copy);
+ dir_path = my_dirname(path_copy);
if (lstat(dir_path, &stbuf) != -1 && stbuf.st_mode & S_ISGID)
file_group = -1;
free(path_copy);