tar: do chown, not lchown to restore mode (compat)
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 17 Sep 2009 01:02:57 +0000 (03:02 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 17 Sep 2009 01:02:57 +0000 (03:02 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libunarchive/data_extract_all.c

index 3e4a77de89144d2845b2293fd65e4f3b02bfe700..0d529a61649a9cbeee85243b4d689200e5e6dd8a 100644 (file)
@@ -128,10 +128,11 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
                                struct group *grp = getgrnam(file_header->gname);
                                if (grp) gid = grp->gr_gid;
                        }
-                       lchown(file_header->name, uid, gid);
+                       /* GNU tar 1.15.1 use chown, not lchown */
+                       chown(file_header->name, uid, gid);
                } else
 #endif
-                       lchown(file_header->name, file_header->uid, file_header->gid);
+                       chown(file_header->name, file_header->uid, file_header->gid);
        }
        if (!S_ISLNK(file_header->mode)) {
                /* uclibc has no lchmod, glibc is even stranger -