summaryrefslogtreecommitdiffstats
path: root/bin/cp/extern.h
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2001-06-11 13:57:54 +0000
committerbde <bde@FreeBSD.org>2001-06-11 13:57:54 +0000
commit5f8a4bf5ab28d162b4d59738aca0f347c6a5f4ba (patch)
tree46f648b9bcd8b6bd904eb0058e3befa6575f8467 /bin/cp/extern.h
parent3851943e9b5934e21298c7a48a10da449af6ec57 (diff)
downloadFreeBSD-src-5f8a4bf5ab28d162b4d59738aca0f347c6a5f4ba.zip
FreeBSD-src-5f8a4bf5ab28d162b4d59738aca0f347c6a5f4ba.tar.gz
Removed the broken code which claimed to lose the set[ug]id bits in
the !(pflag && setfile()) case for regular files unless the copy is owned by the same user and group. These bits have already been lost (or never gained) in the correct way. The code didn't actually lose the bits; it depended on them being lost already (apparently in all cases) and attempted to gain them as necessary, but it often gained them (and sometimes collateral bits) when wrong: - pflag && setfile() == 0 case (i.e., for a successful cp -p): setfile() copies all the attributes as correctly as possible (as specified by POSIX), and we sometimes messed up the up the mode by setting it again. Also, if the file is immutable, then setting the mode again gave spurious errors (PR 20646). - !pflag case. If the target is created, POSIX requires it to not have the set[ug]id bits, but we sometimes copied them from the source. If the target already exists, POSIX requires its mode to be unchanged, but we sometimes copied the whole mode from the source. PR: 20646 MFC after: 4 weeks
Diffstat (limited to 'bin/cp/extern.h')
-rw-r--r--bin/cp/extern.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/bin/cp/extern.h b/bin/cp/extern.h
index 3b0ecef..4e5f07c 100644
--- a/bin/cp/extern.h
+++ b/bin/cp/extern.h
@@ -41,8 +41,7 @@ typedef struct {
} PATH_T;
extern PATH_T to;
-extern uid_t myuid;
-extern int iflag, pflag, fflag, vflag, myumask;
+extern int iflag, pflag, fflag, vflag;
#include <sys/cdefs.h>
OpenPOWER on IntegriCloud