X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fdesktop.c;h=8446a848b26baed169f915f280ef4f88e3b97b5d;hb=b362b6f7b22b6e4e9e74760989f389149677917b;hp=4802b20e3ec5f67312805985806b8f1c5a2a57e7;hpb=7b12c56c26d0ce7ef5834c71d3c8bcc90fef2532;p=netatalk.git diff --git a/etc/afpd/desktop.c b/etc/afpd/desktop.c index 4802b20e..8446a848 100644 --- a/etc/afpd/desktop.c +++ b/etc/afpd/desktop.c @@ -1,5 +1,5 @@ /* - * $Id: desktop.c,v 1.49 2010-01-21 14:14:49 didg Exp $ + * $Id: desktop.c,v 1.50.2.1 2010-02-01 10:56:08 franklahm Exp $ * * See COPYRIGHT. * @@ -31,10 +31,10 @@ #include #include #include +#include #include "volume.h" #include "directory.h" #include "fork.h" -#include "globals.h" #include "desktop.h" #include "mangle.h" @@ -600,7 +600,8 @@ char *mtoupath(const struct vol *vol, char *mpath, cnid_t did, int utf8) u_int16_t flags; if ( *mpath == '\0' ) { - return( "." ); + strcpy(upath, "."); + return upath; } /* set conversion flags */ @@ -682,12 +683,12 @@ static int ad_addcomment(struct vol *vol, struct path *path, char *ibuf) clen = min( clen, 199 ); upath = path->u_name; - if (!vol_unix_priv(vol) && check_access(upath, OPENACC_WR ) < 0) { + if (check_access(upath, OPENACC_WR ) < 0) { return AFPERR_ACCESS; } isadir = path_isadir(path); - if (isadir || !(of = of_findname(path))) { + if (isadir || !(of = of_findname(vol, path))) { ad_init(&ad, vol->v_adouble, vol->v_ad_options); adp = &ad; } else @@ -700,7 +701,7 @@ static int ad_addcomment(struct vol *vol, struct path *path, char *ibuf) if (ad_getentryoff(adp, ADEID_COMMENT)) { if ( (ad_get_MD_flags( adp ) & O_CREAT) ) { if ( *path->m_name == '\0' ) { - name = curdir->d_m_name; + name = (char *)curdir->d_m_name->data; } else { name = path->m_name; } @@ -760,7 +761,7 @@ static int ad_getcomment(struct vol *vol, struct path *path, char *rbuf, size_t upath = path->u_name; isadir = path_isadir(path); - if (isadir || !(of = of_findname(path))) { + if (isadir || !(of = of_findname(vol, path))) { ad_init(&ad, vol->v_adouble, vol->v_ad_options); adp = &ad; } else @@ -832,12 +833,12 @@ static int ad_rmvcomment(struct vol *vol, struct path *path) char *upath; upath = path->u_name; - if (!vol_unix_priv(vol) && check_access(upath, OPENACC_WR ) < 0) { + if (check_access(upath, OPENACC_WR ) < 0) { return AFPERR_ACCESS; } isadir = path_isadir(path); - if (isadir || !(of = of_findname(path))) { + if (isadir || !(of = of_findname(vol, path))) { ad_init(&ad, vol->v_adouble, vol->v_ad_options); adp = &ad; } else