]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/filedir.c
Eddie's wincheck() fix.
[netatalk.git] / etc / afpd / filedir.c
index f47d5f7af64cd9f4c7955e98728109ee34beb530..a50c33b771d622d5e593b8451305123c326eb938 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: filedir.c,v 1.23 2002-03-05 01:41:36 srittau Exp $
+ * $Id: filedir.c,v 1.24 2002-03-13 19:29:17 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -378,13 +378,13 @@ int               ibuflen, *rbuflen;
     if (strcmp(path, ibuf) == 0)
         return AFP_OK;
 
-    /* check for illegal characters */
-    if (!wincheck(vol, ibuf))
-        return AFPERR_PARAM;
-
     newpath = obj->oldtmp;
     strcpy( newpath, mtoupath(vol, ibuf ));
 
+    /* check for illegal characters in the unix filename */
+    if (!wincheck(vol, newpath))
+        return AFPERR_PARAM;
+
     if ((vol->v_flags & AFPVOL_NOHEX) && strchr(newpath, '/'))
         return AFPERR_PARAM;
 
@@ -672,12 +672,12 @@ int               ibuflen, *rbuflen;
         newname[ plen ] = '\0';
     }
 
-    /* check for illegal characters */
-    if (!wincheck(vol, newname))
-        return AFPERR_PARAM;
-
     upath = mtoupath(vol, newname);
 
+    /* check for illegal characters in the unix filename */
+    if (!wincheck(vol, upath))
+        return AFPERR_PARAM;
+
     if ((vol->v_flags & AFPVOL_NOHEX) && strchr(upath, '/'))
         return AFPERR_PARAM;