]> arthur.barton.de Git - netatalk.git/commitdiff
Fix access check bug for Netatalk private folders and vetoed folders.
authorfranklahm <franklahm>
Tue, 1 Sep 2009 13:15:13 +0000 (13:15 +0000)
committerfranklahm <franklahm>
Tue, 1 Sep 2009 13:15:13 +0000 (13:15 +0000)
http://thread.gmane.org/gmane.network.netatalk.devel/8878
http://thread.gmane.org/gmane.network.netatalk.devel/8881
Merge from branch-2-0.

etc/afpd/directory.c
etc/afpd/filedir.c

index bd6542f739350476268996c82dca7021e662ff33..0489e2d04d4d2caaa3febdb560288919ae788036 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.99 2009-07-20 18:31:04 didg Exp $
+ * $Id: directory.c,v 1.100 2009-09-01 13:15:13 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -707,6 +707,8 @@ struct path *path;
 
     if (check_name(vol, path->u_name)) {
         /* the name is illegal */
+        LOG(log_info, logtype_afpd, "extenddir: illegal path: '%s'", path->u_name);
+        path->u_name = NULL;
         afp_errno = AFPERR_PARAM;
         return NULL;
     }
index c7efc070dcfc012f975248f75489a0687e4c1a61..f9a84039a793e64e2d563d6a1b8e81c85fc5aa90 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: filedir.c,v 1.53 2009-04-17 04:24:20 didg Exp $
+ * $Id: filedir.c,v 1.54 2009-09-01 13:15:13 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -316,8 +316,10 @@ int check_name(const struct vol *vol, char *name)
     if ((vol->v_flags & AFPVOL_NOHEX) && strchr(name, '/'))
         return AFPERR_PARAM;
 
-    if (!vol->vfs->validupath(vol, name))
+    if (!vol->vfs->validupath(vol, name)) {
+        LOG(log_info, logtype_afpd, "check_name: illegal name: '%s'", name);
         return AFPERR_EXIST;
+    }
 
     /* check for vetoed filenames */
     if (veto_file(vol->v_veto, name))
@@ -778,15 +780,13 @@ int veto_file(const char*veto_str, const char*path)
 
     if ((veto_str == NULL) || (path == NULL))
         return 0;
-    /*
-    #ifdef DEBUG
-       LOG(log_debug, logtype_afpd, "veto_file \"%s\", \"%s\"", veto_str, path);
-    #endif
-    */
+
     for(i=0, j=0; veto_str[i] != '\0'; i++) {
         if (veto_str[i] == '/') {
-            if ((j>0) && (path[j] == '\0'))
+            if ((j>0) && (path[j] == '\0')) {
+                LOG(log_info, logtype_afpd, "vetoed file:'%s'", path);
                 return 1;
+            }
             j = 0;
         } else {
             if (veto_str[i] != path[j]) {