/*
- * $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.10 2005-09-28 09:53:47 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
return ret;
/* first part of the path. just forward to the next variable. */
- len = MIN(p - src, destlen);
+ len = MIN((size_t)(p - src), destlen);
if (len > 0) {
destlen -= len;
dest += len;
/* stuff up to next $ */
src = p + 2;
p = strchr(src, '$');
- len = p ? MIN(p - src, destlen) : destlen;
+ len = p ? MIN((size_t)(p - src), destlen) : destlen;
if (len > 0) {
strncpy(dest, src, len);
dest += len;
}
/* ----------------- */
-static int validupath_osx(const struct vol *vol, const char *name)
+static int validupath_osx(const struct vol *vol _U_, const char *name)
{
return strncasecmp(name,".Apple", 6) && strncasecmp(name,"._", 2);
}
if ( nameoff ) {
ashort = htons( data - buf );
memcpy(nameoff, &ashort, sizeof( ashort ));
- aint = ucs2_to_charset( (utf8_encoding()?CH_UTF8_MAC:vol->v_maccharset), vol->v_name, data+1, 255);
+ /* name is always in mac charset, FIXME mangle if length > 27 char */
+ aint = ucs2_to_charset( vol->v_maccharset, vol->v_name, data+1, 255);
if ( aint <= 0 ) {
*buflen = 0;
return AFPERR_MISC;
/* ------------------------------- */
int afp_getsrvrparms(obj, ibuf, ibuflen, rbuf, rbuflen )
AFPObj *obj;
-char *ibuf, *rbuf;
-int ibuflen, *rbuflen;
+char *ibuf _U_, *rbuf;
+int ibuflen _U_, *rbuflen;
{
struct timeval tv;
struct stat st;
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) );
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 */
int afp_openvol(obj, ibuf, ibuflen, rbuf, rbuflen )
AFPObj *obj;
char *ibuf, *rbuf;
-int ibuflen, *rbuflen;
+int ibuflen _U_, *rbuflen;
{
struct stat st;
char *volname;
/* ------------------------- */
int afp_closevol(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj *obj;
-char *ibuf, *rbuf;
-int ibuflen, *rbuflen;
+AFPObj *obj _U_;
+char *ibuf, *rbuf _U_;
+int ibuflen _U_, *rbuflen;
{
struct vol *vol, *ovol;
u_int16_t vid;
/* ------------------------- */
int afp_getvolparams(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj *obj;
+AFPObj *obj _U_;
char *ibuf, *rbuf;
-int ibuflen, *rbuflen;
+int ibuflen _U_, *rbuflen;
{
struct vol *vol;
u_int16_t vid, bitmap;
/* ------------------------- */
int afp_setvolparams(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj *obj;
-char *ibuf, *rbuf;
-int ibuflen, *rbuflen;
+AFPObj *obj _U_;
+char *ibuf, *rbuf _U_;
+int ibuflen _U_, *rbuflen;
{
struct adouble ad;
struct vol *vol;