Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Feb 2010 19:56:32 +0000 (UTC)
From:      Tim Kientzle <kientzle@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r203560 - head/usr.bin/tar
Message-ID:  <201002061956.o16JuWYg023237@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kientzle
Date: Sat Feb  6 19:56:32 2010
New Revision: 203560
URL: http://svn.freebsd.org/changeset/base/203560

Log:
  Remove all traces of an experiment for handling "root" on Windows systems.

Modified:
  head/usr.bin/tar/bsdtar.c
  head/usr.bin/tar/bsdtar_platform.h

Modified: head/usr.bin/tar/bsdtar.c
==============================================================================
--- head/usr.bin/tar/bsdtar.c	Sat Feb  6 19:53:48 2010	(r203559)
+++ head/usr.bin/tar/bsdtar.c	Sat Feb  6 19:56:32 2010	(r203560)
@@ -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: head/usr.bin/tar/bsdtar_platform.h
==============================================================================
--- head/usr.bin/tar/bsdtar_platform.h	Sat Feb  6 19:53:48 2010	(r203559)
+++ head/usr.bin/tar/bsdtar_platform.h	Sat Feb  6 19:56:32 2010	(r203560)
@@ -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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002061956.o16JuWYg023237>