Unify_copy doesn't touch sockets, so there's nothing to change the tag of.
[util-vserver.git] / src / vclone.c
index f1a8c0c..c180bcf 100644 (file)
@@ -180,8 +180,10 @@ 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 &&
-                vc_set_iattr(dst_path.d, global_args->xid, 0, VC_IATTR_XID) == -1)
+       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);
        else
          res = true;