X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvclone.c;h=a4eeda1bdc1f86b78d62546d6082e158dd5eec1d;hb=1bd485daf1544e9b7b9bf020783f6aa0b0085c0b;hp=156e69bcad54d348366899ef01a6697e5905197e;hpb=e9a0ab8f6a2c3efa6133856f814d42e933980762;p=util-vserver.git diff --git a/src/vclone.c b/src/vclone.c index 156e69b..a4eeda1 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; @@ -135,13 +136,13 @@ handleDirEntry(const PathInfo *src_path, const PathInfo *basename, Vwrite(1, src_path->d, src_path->l); WRITE_MSG(1, "' (excluded)\n"); } - return false; + return true; } 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); @@ -180,7 +181,8 @@ handleDirEntry(const PathInfo *src_path, const PathInfo *basename, } if (!Unify_copy(basename->d, st, dst_path.d)) PERROR_Q(ENSC_WRAPPERS_PREFIX "Unify_copy", dst_path.d); - else if (global_args->xid != VC_NOCTX && + else if (!S_ISSOCK(st->st_mode) && + global_args->xid != VC_NOCTX && vc_set_iattr(dst_path.d, global_args->xid, 0, VC_IATTR_XID) == -1 && errno != EINVAL) PERROR_Q(ENSC_WRAPPERS_PREFIX "vc_set_iattr", dst_path.d);