From: HAT Date: Thu, 4 Oct 2012 13:30:33 +0000 (+0900) Subject: remove realpath() in afp_openvol() X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=0b7c10583488e175c58829759029dad65dc0ebc7;p=netatalk.git remove realpath() in afp_openvol() because it has already been done, when parsing afp.conf --- diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index 3b02b239..ecc9bf13 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -771,26 +771,7 @@ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t return AFPERR_MISC; } - /* Normalize volume path */ -#ifdef REALPATH_TAKES_NULL - if ((volume->v_path = realpath(path, NULL)) == NULL) - return AFPERR_MISC; -#else - if ((volume->v_path = malloc(MAXPATHLEN+1)) == NULL) - return AFPERR_MISC; - if (realpath(path, volume->v_path) == NULL) { - free(volume->v_path); - return AFPERR_MISC; - } - /* Safe some memory */ - char *tmp; - if ((tmp = strdup(volume->v_path)) == NULL) { - free(volume->v_path); - return AFPERR_MISC; - } - free(volume->v_path); - volume->v_path = tmp; -#endif + strlcpy(volume->v_path, path, MAXPATHLEN); if (volume_codepage(obj, volume) < 0) { ret = AFPERR_MISC;