]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/vfs/vfs.c
libatal/vfs: stats a path before checking if it is a directory
[netatalk.git] / libatalk / vfs / vfs.c
index 53b53064da1a10a4363299b83c8b6ce4182a436b..a349cfe8cd4c63b1e6137f1400073ae33b4664c3 100644 (file)
@@ -170,7 +170,6 @@ static int RF_setfilmode_adouble(VFS_FUNC_ARGS_SETFILEMODE)
 static int RF_setdirunixmode_adouble(VFS_FUNC_ARGS_SETDIRUNIXMODE)
 {
     const char *adouble = vol->ad_path(name, ADFLAGS_DIR );
-    int  dropbox = vol->v_flags;
 
     if (dir_rx_set(mode)) {
         if (chmod_acl(ad_dir(adouble), (DIRBITS | mode) & ~vol->v_umask) < 0 ) 
@@ -208,7 +207,6 @@ static int setdirmode_adouble_loop(const struct vol *vol, struct dirent *de _U_,
 
 static int RF_setdirmode_adouble(VFS_FUNC_ARGS_SETDIRMODE)
 {
-    int   dropbox = vol->v_flags;
     mode_t hf_mode = ad_hf_mode(mode);
     const char  *adouble = vol->ad_path(name, ADFLAGS_DIR );
     const char  *adouble_p = ad_dir(adouble);
@@ -410,6 +408,9 @@ static int RF_posix_acl(VFS_FUNC_ARGS_ACL)
     struct stat st;
     int len;
 
+    if (stat(path, &st) == -1)
+        EC_FAIL;
+
     if (S_ISDIR(st.st_mode)) {
         len = snprintf(buf, MAXPATHLEN, "%s/.AppleDouble",path);
         if (len < 0 || len >=  MAXPATHLEN)