svn commit: r215231 - stable/8/usr.bin/tar
Tim Kientzle
kientzle at FreeBSD.org
Sat Nov 13 05:55:57 UTC 2010
Author: kientzle
Date: Sat Nov 13 05:55:56 2010
New Revision: 215231
URL: http://svn.freebsd.org/changeset/base/215231
Log:
MFC: reverse an ill-advised experiment trying
to emulate a "root user" on Windows.
Modified:
stable/8/usr.bin/tar/bsdtar.c
stable/8/usr.bin/tar/bsdtar_platform.h
Directory Properties:
stable/8/usr.bin/tar/ (props changed)
Modified: stable/8/usr.bin/tar/bsdtar.c
==============================================================================
--- stable/8/usr.bin/tar/bsdtar.c Sat Nov 13 05:53:55 2010 (r215230)
+++ stable/8/usr.bin/tar/bsdtar.c Sat Nov 13 05:55:56 2010 (r215231)
@@ -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;
Modified: stable/8/usr.bin/tar/bsdtar_platform.h
==============================================================================
--- stable/8/usr.bin/tar/bsdtar_platform.h Sat Nov 13 05:53:55 2010 (r215230)
+++ stable/8/usr.bin/tar/bsdtar_platform.h Sat Nov 13 05:55:56 2010 (r215231)
@@ -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 */
More information about the svn-src-stable
mailing list