]> arthur.barton.de Git - netatalk.git/commitdiff
don't advertise volume without r-x right
authordidg <didg>
Wed, 20 Jul 2005 21:09:22 +0000 (21:09 +0000)
committerdidg <didg>
Wed, 20 Jul 2005 21:09:22 +0000 (21:09 +0000)
etc/afpd/volume.c

index a6d3cdb9e3ed2898c29e7db549c4981b7ef23f8d..0773cce4e3b5fd2dabf9896e2b5f9c16a8bb5caf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.51.2.7.2.33.2.7 2005-06-02 12:49:41 didg Exp $
+ * $Id: volume.c,v 1.51.2.7.2.33.2.8 2005-07-20 21:09:22 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1524,6 +1524,8 @@ int       ibuflen, *rbuflen;
     data = rbuf + 5;
     for ( vcnt = 0, volume = Volumes; volume; volume = volume->v_next ) {
         if (!(volume->v_flags & AFPVOL_NOSTAT)) {
+            struct maccess ma;
+
             if ( stat( volume->v_path, &st ) < 0 ) {
                 LOG(log_info, logtype_afpd, "afp_getsrvrparms(%s): stat: %s",
                         volume->v_path, strerror(errno) );
@@ -1532,6 +1534,10 @@ int      ibuflen, *rbuflen;
             if (!S_ISDIR(st.st_mode)) {
                 continue;              /* not a dir */
             }
+            accessmode(volume->v_path, &ma, NULL, &st);
+            if ((ma.ma_user & (AR_UREAD | AR_USEARCH)) != (AR_UREAD | AR_USEARCH)) {
+                continue;   /* no r-x access */
+            }
         }
         if (volume->v_hide) {
             continue;          /* config file changed but the volume was mounted */