From 1cd272522797dbdb87d2c140ea2079416b3b47cc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 26 Jun 2012 17:14:45 -0700 Subject: [PATCH] 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. --- gnulib.modules | 1 + src/extract.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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; -- 2.45.2