summaryrefslogtreecommitdiffstats
path: root/lib/libutil
diff options
context:
space:
mode:
authordavidn <davidn@FreeBSD.org>1997-05-15 06:06:32 +0000
committerdavidn <davidn@FreeBSD.org>1997-05-15 06:06:32 +0000
commit3ca7419589b10be6628a4b108aae51717dbbcd2a (patch)
tree0ce4365f1224fcedc00d26a689709526c1949fbc /lib/libutil
parent3347d1b140b15275bc2bc10c7d432672c4a40ce8 (diff)
downloadFreeBSD-src-3ca7419589b10be6628a4b108aae51717dbbcd2a.zip
FreeBSD-src-3ca7419589b10be6628a4b108aae51717dbbcd2a.tar.gz
For non-root uids, consider root-owned files also 'secure' unless otherwise
disqualified.
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/_secure_path.34
-rw-r--r--lib/libutil/_secure_path.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libutil/_secure_path.3 b/lib/libutil/_secure_path.3
index 6387b73..66fbb2c 100644
--- a/lib/libutil/_secure_path.3
+++ b/lib/libutil/_secure_path.3
@@ -17,7 +17,7 @@
.\" 5. Modifications may be freely made to this file providing the above
.\" conditions are met.
.\"
-.\" $Id$
+.\" $Id: _secure_path.3,v 1.1 1997/05/10 18:55:37 davidn Exp $
.\"
.Dd May 2, 1997
.Os FreeBSD
@@ -46,7 +46,7 @@ special or named pipe, etc.),
.It
Is not world writable.
.It
-Is owned by the given uid, if uid is not -1,
+Is owned by the given uid or uid 0, if uid is not -1,
.It
Is not group wriable or it has group ownership by the given
gid, if gid is not -1.
diff --git a/lib/libutil/_secure_path.c b/lib/libutil/_secure_path.c
index 38a974e..01c29bf 100644
--- a/lib/libutil/_secure_path.c
+++ b/lib/libutil/_secure_path.c
@@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file providing the above
* conditions are met.
*
- * $Id$
+ * $Id: _secure_path.c,v 1.1 1997/05/10 18:55:37 davidn Exp $
*/
@@ -57,7 +57,7 @@ _secure_path(const char *path, uid_t uid, gid_t gid)
msg = "%s: %s is not a regular file";
else if (sb.st_mode & S_IWOTH)
msg = "%s: %s is world writable";
- else if (uid != -1 && sb.st_uid != uid) {
+ else if (uid != -1 && sb.st_uid != uid && sb.st_uid != 0) {
if (uid == 0)
msg = "%s: %s is not owned by root";
else
OpenPOWER on IntegriCloud