]> arthur.barton.de Git - netatalk.git/commitdiff
Check that object has the right type (file, directory) before setdirparams
authordidg <didg>
Fri, 16 Aug 2002 00:42:56 +0000 (00:42 +0000)
committerdidg <didg>
Fri, 16 Aug 2002 00:42:56 +0000 (00:42 +0000)
setfileparams.

etc/afpd/directory.c
etc/afpd/file.c

index 18b07c14dca35ded53ab183c43f1071e0b4770f7..c27aef88151d8a678110a485f09cfd9f1520ac0c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.35 2002-08-15 06:20:10 didg Exp $
+ * $Id: directory.c,v 1.36 2002-08-16 00:42:56 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1206,6 +1206,10 @@ int              ibuflen, *rbuflen;
         return( AFPERR_NOOBJ );
     }
 
+    if ( *path != '\0' ) {
+        return( AFPERR_BADTYPE ); /* not a directory */
+    }
+
     /*
      * If ibuf is odd, make it even.
      */
index 30cd045ce6abc850982cbef34a82af3f86ff6bcc..39b61c1a92c081e789105271aecde74922f7aecc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.46 2002-06-17 18:23:03 didg Exp $
+ * $Id: file.c,v 1.47 2002-08-16 00:42:56 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -596,6 +596,10 @@ int                ibuflen, *rbuflen;
         return( AFPERR_NOOBJ );
     }
 
+    if ( *path == '\0' ) {
+        return( AFPERR_BADTYPE ); /* it's a directory */
+    }
+
     if ((u_long)ibuf & 1 ) {
         ibuf++;
     }