From: Paul Eggert Date: Wed, 27 Jun 2012 00:14:45 +0000 (-0700) Subject: tar: don't assume root is uid 0 X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=1cd272522797dbdb87d2c140ea2079416b3b47cc;p=chaz%2Ftar tar: don't assume root is uid 0 This is not true for Tandem NonStop Kernel. See Joachim Schmitz's comment in . * gnulib.modules: Add root-uid. * src/extract.c: Include . (extr_init): Don't assume root is uid 0. --- diff --git a/gnulib.modules b/gnulib.modules index 43c9de1..9e7a05a 100644 --- a/gnulib.modules +++ b/gnulib.modules @@ -45,6 +45,7 @@ quote quotearg readlinkat renameat +root-uid rpmatch safe-read savedir diff --git a/src/extract.c b/src/extract.c index 0e499e5..e35c8f6 100644 --- a/src/extract.c +++ b/src/extract.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "common.h" @@ -153,7 +154,7 @@ struct string_list void extr_init (void) { - we_are_root = geteuid () == 0; + we_are_root = geteuid () == ROOT_UID; same_permissions_option += we_are_root; same_owner_option += we_are_root;