From 7631ae18b8772366935e28aeab41b41e25c9e986 Mon Sep 17 00:00:00 2001 From: didg Date: Wed, 20 Jul 2005 21:09:22 +0000 Subject: [PATCH] don't advertise volume without r-x right --- etc/afpd/volume.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index a6d3cdb9..0773cce4 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -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 */ -- 2.39.2