From 82fb15c15adb5c8a0981ce067177451eaf59f230 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sat, 6 Feb 2010 19:56:32 +0000 Subject: [PATCH] Remove all traces of an experiment for handling "root" on Windows systems. --- usr.bin/tar/bsdtar.c | 7 +++++-- usr.bin/tar/bsdtar_platform.h | 6 +----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/usr.bin/tar/bsdtar.c b/usr.bin/tar/bsdtar.c index 2504f728286e..80d4ded106fe 100644 --- a/usr.bin/tar/bsdtar.c +++ b/usr.bin/tar/bsdtar.c @@ -159,8 +159,10 @@ main(int argc, char **argv) /* Default: Perform basic security checks. */ bsdtar->extract_flags |= SECURITY; - /* Defaults for root user: */ - if (bsdtar_is_privileged(bsdtar)) { +#ifndef _WIN32 + /* On POSIX systems, assume --same-owner and -p when run by + * the root user. This doesn't make any sense on Windows. */ + if (bsdtar->user_uid == 0) { /* --same-owner */ bsdtar->extract_flags |= ARCHIVE_EXTRACT_OWNER; /* -p */ @@ -169,6 +171,7 @@ main(int argc, char **argv) bsdtar->extract_flags |= ARCHIVE_EXTRACT_XATTR; bsdtar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; } +#endif bsdtar->argv = argv; bsdtar->argc = argc; diff --git a/usr.bin/tar/bsdtar_platform.h b/usr.bin/tar/bsdtar_platform.h index fb1444206a7b..ae5869723ce7 100644 --- a/usr.bin/tar/bsdtar_platform.h +++ b/usr.bin/tar/bsdtar_platform.h @@ -164,12 +164,8 @@ #define __LA_DEAD #endif -#if defined(__CYGWIN__) -#include "bsdtar_cygwin.h" -#elif defined(_WIN32) /* && !__CYGWIN__ */ +#if defined(_WIN32) && !defined(__CYGWIN__) #include "bsdtar_windows.h" -#else -#define bsdtar_is_privileged(bsdtar) (bsdtar->user_uid == 0) #endif #endif /* !BSDTAR_PLATFORM_H_INCLUDED */