From: didg Date: Mon, 20 Jul 2009 18:31:04 +0000 (+0000) Subject: .AppleDxxx folders were user accessible if option 'usedots' was set X-Git-Tag: before-ipv6~150 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=35d08d6160b2a600a7f721946167de96aea911c7 .AppleDxxx folders were user accessible if option 'usedots' was set --- diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index ad7741a7..bd6542f7 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -1,5 +1,5 @@ /* - * $Id: directory.c,v 1.98 2009-06-19 13:38:32 franklahm Exp $ + * $Id: directory.c,v 1.99 2009-07-20 18:31:04 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -704,6 +704,13 @@ struct path *path; afp_errno = AFPERR_PARAM; return NULL; } + + if (check_name(vol, path->u_name)) { + /* the name is illegal */ + afp_errno = AFPERR_PARAM; + return NULL; + } + if (of_stat( path ) != 0 ) { if (!(vol->v_flags & AFPVOL_CASEINSEN)) return NULL; @@ -2418,9 +2425,6 @@ int ibuflen _U_, *rbuflen; return AFPERR_EXIST; upath = s_path->u_name; - if (0 != (err = check_name(vol, upath))) { - return err; - } if (AFP_OK != (err = netatalk_mkdir( upath))) { return err; diff --git a/etc/afpd/file.c b/etc/afpd/file.c index a02cb5a9..5bd63240 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -1,5 +1,5 @@ /* - * $Id: file.c,v 1.108 2008-12-23 08:27:50 didg Exp $ + * $Id: file.c,v 1.109 2009-07-20 18:31:04 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -576,7 +576,6 @@ int ibuflen _U_, *rbuflen; char *path, *upath; int creatf, did, openf, retvalue = AFP_OK; u_int16_t vid; - int ret; struct path *s_path; #ifdef DEBUG @@ -613,8 +612,6 @@ int ibuflen _U_, *rbuflen; } upath = s_path->u_name; - if (0 != (ret = check_name(vol, upath))) - return ret; /* if upath is deleted we already in trouble anyway */ if ((of = of_findname(s_path))) {