diff options
author | 1998-01-22 06:21:29 +0000 | |
---|---|---|
committer | 1998-01-22 06:21:29 +0000 | |
commit | a8acd22851f771fa0fde9b8d3d3c4c68f5dee412 (patch) | |
tree | c17f465869a2415e3f83d3915f3487ab0ef79cc6 | |
parent | more consistent with supported options (diff) | |
download | wireguard-openbsd-a8acd22851f771fa0fde9b8d3d3c4c68f5dee412.tar.xz wireguard-openbsd-a8acd22851f771fa0fde9b8d3d3c4c68f5dee412.zip |
Preserve uid/gid if invoked as tar and extracting as root.
This is traditional tar behavior.
-rw-r--r-- | bin/pax/options.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/pax/options.c b/bin/pax/options.c index fc378c84c02..7b2ea216f6e 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.30 1997/09/01 18:29:54 deraadt Exp $ */ +/* $OpenBSD: options.c,v 1.31 1998/01/22 06:21:29 millert Exp $ */ /* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: options.c,v 1.30 1997/09/01 18:29:54 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: options.c,v 1.31 1998/01/22 06:21:29 millert Exp $"; #endif #endif /* not lint */ @@ -716,9 +716,11 @@ tar_options(argc, argv) break; case 'x': /* - * write an archive + * write an archive, preserve ids if root */ act = EXTRACT; + if (geteuid() == 0) + pids = 1; break; case 'z': /* |