From: Daniel Hokka Zakrisson Date: Fri, 29 Aug 2008 03:45:53 +0000 (+0000) Subject: access dereferences symbolic links. Use lstat instead. X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5817e191c23c4c53548472b5aa77a29d995c3410;p=util-vserver.git access dereferences symbolic links. Use lstat instead. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2779 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/src/vclone.c b/src/vclone.c index c180bcf..78992c3 100644 --- a/src/vclone.c +++ b/src/vclone.c @@ -125,6 +125,7 @@ handleDirEntry(const PathInfo *src_path, const PathInfo *basename, else { PathInfo dst_path = global_info.dst; char dst_path_buf[ENSC_PI_APPSZ(dst_path, *src_path)]; + struct stat dst_st; if (S_ISDIR(st->st_mode)) *is_dir = true; @@ -141,7 +142,7 @@ handleDirEntry(const PathInfo *src_path, const PathInfo *basename, PathInfo_append(&dst_path, src_path, dst_path_buf); /* skip files that already exist */ - if (access(dst_path.d, F_OK)!=-1) { + if (lstat(dst_path.d, &dst_st)!=-1) { if (Global_getVerbosity() > 1) { WRITE_MSG(1, " skipping '"); Vwrite(1, src_path->d, src_path->l);