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

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

index 4f28340671e3590852dea188f5a7446e2773f10e..85e0b3c997e787a2af2d939ae8b77be9595ecf57 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.71.2.4.2.15.2.12 2009-07-20 18:29:56 didg Exp $
+ * $Id: directory.c,v 1.71.2.4.2.15.2.13 2009-09-01 12:34:38 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -572,6 +572,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 49b6118167f55dc3366d0638325629c248a3e23b..d2b4fbdc867ea588c5d512074a7197fd788ec651 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: filedir.c,v 1.45.2.2.2.14.2.6 2009-01-28 05:37:58 didg Exp $
+ * $Id: filedir.c,v 1.45.2.2.2.14.2.7 2009-09-01 12:34:38 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -313,8 +313,10 @@ int check_name(const struct vol *vol, char *name)
     if ((vol->v_flags & AFPVOL_NOHEX) && strchr(name, '/'))
         return AFPERR_PARAM;
 
-    if (!vol->validupath(vol, name))
+    if (!vol->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))
@@ -775,15 +777,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]) {