]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/volume.c
don't advertise volume without r-x right.
[netatalk.git] / etc / afpd / volume.c
index bb12ff1998d0767d10b71a42420035a161f15d4b..606fc6433191d12c1fb4746a7f9fcd54e2ff8b43 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.62 2005-06-02 12:32:18 didg Exp $
+ * $Id: volume.c,v 1.63 2005-07-20 22:28:46 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1518,6 +1518,8 @@ int       ibuflen _U_, *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) );
@@ -1526,6 +1528,10 @@ int      ibuflen _U_, *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 */