X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fvolume.c;h=3b02b2390a467dd81de3319fa757ceb709434844;hb=aa105c51d67fe1ab7cfde61d6cd27ceeed3284db;hp=6fbb6ec36171647e775d34c3cd5d097f0ad23381;hpb=edf01c724768d494e522ec84380e8e49b37a2bd6;p=netatalk.git diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index 6fbb6ec3..3b02b239 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -321,7 +321,7 @@ static int getvolparams(const AFPObj *obj, uint16_t bitmap, struct vol *vol, str * .Parent file here if it doesn't exist. */ /* Convert adouble:v2 to adouble:ea on the fly */ - (void)ad_convert(vol->v_path, st, vol); + (void)ad_convert(vol->v_path, st, vol, NULL); ad_init(&ad, vol); if (ad_open(&ad, vol->v_path, ADFLAGS_HF | ADFLAGS_DIR | ADFLAGS_RDWR | ADFLAGS_CREATE, 0666) != 0 ) { @@ -871,6 +871,11 @@ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t goto openvol_err; } } + + const char *msg; + if ((msg = iniparser_getstring(obj->iniconfig, volume->v_configname, "login message", NULL)) != NULL) + setmessage(msg); + return( AFP_OK ); } @@ -889,14 +894,14 @@ openvol_err: return ret; } -void closevol(struct vol *vol) +void closevol(const AFPObj *obj, struct vol *vol) { if (!vol) return; vol->v_flags &= ~AFPVOL_OPEN; - of_closevol(vol); + of_closevol(obj, vol); dir_free( vol->v_root ); vol->v_root = NULL; @@ -914,20 +919,20 @@ void closevol(struct vol *vol) } /* ------------------------- */ -void close_all_vol(void) +void close_all_vol(const AFPObj *obj) { struct vol *ovol; curdir = NULL; for ( ovol = getvolumes(); ovol; ovol = ovol->v_next ) { if ( (ovol->v_flags & AFPVOL_OPEN) ) { ovol->v_flags &= ~AFPVOL_OPEN; - closevol(ovol); + closevol(obj, ovol); } } } /* ------------------------- */ -int afp_closevol(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) +int afp_closevol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen) { struct vol *vol; uint16_t vid; @@ -940,7 +945,8 @@ int afp_closevol(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_ } (void)chdir("/"); - closevol(vol); + curdir = NULL; + closevol(obj, vol); return( AFP_OK ); }