]> arthur.barton.de Git - netatalk.git/commitdiff
Fix bug where afpd would erroneously return AFPERR_NOOBJ when it encountered
authorjmarcus <jmarcus>
Wed, 3 Oct 2001 19:51:03 +0000 (19:51 +0000)
committerjmarcus <jmarcus>
Wed, 3 Oct 2001 19:51:03 +0000 (19:51 +0000)
a directory that could not be read or searched.  This fixes a problem with
trashcan handling.

ChangeLog
etc/afpd/directory.c

index 936094174598fdc62caa66c9657790ead8b67758..d6c6797654e6497a56259cc3bfea81abffab2aa4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 2001-10-03  joe c   <marcus@marcuscom.com>
        
        * configure.in: Fix bug with PAM configuration
+       * etc/afpd/directory.c: Fix bug with unaccessible directories causing
+       afpd to erroneously return AFPERR_NOOBJ
 
 2001-09-28  joe c   <marcus@marcuscom.com>
 
index 9823e2142a100d119d0e0665a885552d258503cb..86f9b257dd48f5ac61eec5d4d84f338af3e107d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.18 2001-09-06 20:00:59 rufustfirefly Exp $
+ * $Id: directory.c,v 1.19 2001-10-03 19:51:04 jmarcus Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1411,7 +1411,14 @@ int afp_createdir(obj, ibuf, ibuflen, rbuf, rbuflen )
     }
 
     if (( path = cname( vol, dir, &ibuf )) == NULL ) {
-       return( AFPERR_NOOBJ );
+       switch( errno ) {
+               case EACCES:
+                       return( AFPERR_ACCESS );
+               case EEXIST:
+                       return( AFPERR_EXIST );
+               default:
+                       return( AFPERR_NOOBJ );
+       }
     }
 
     /* check for illegal bits */
@@ -1958,7 +1965,12 @@ int afp_opendir(obj, ibuf, ibuflen, rbuf, rbuflen )
     }
 
     if (( path = cname( vol, parentdir, &ibuf )) == NULL ) {
-       return( AFPERR_NOOBJ );
+       switch( errno ) {
+               case EACCES:
+                       return( AFPERR_ACCESS );
+               default:
+                       return( AFPERR_NOOBJ );
+       }
     }
 
     /* see if we already have the directory. */