summaryrefslogtreecommitdiff
path: root/bin/pax
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-24 03:33:10 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-24 03:33:10 +0000
commit8cb278be7438df8946957da8bd414d818d9fbf58 (patch)
tree0867d93ff57bd1c326496e4900d268eca442f6d5 /bin/pax
parent7101b6e3bbfee59f7933612f56823cf3969b9c09 (diff)
uid_from_user() and gid_from_user() return -1 when indicating error,
not arbitrary values < 0.
Diffstat (limited to 'bin/pax')
-rw-r--r--bin/pax/sel_subs.c6
-rw-r--r--bin/pax/tar.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c
index dbbb4ce4028..bd0138990b3 100644
--- a/bin/pax/sel_subs.c
+++ b/bin/pax/sel_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sel_subs.c,v 1.27 2018/09/13 12:33:43 millert Exp $ */
+/* $OpenBSD: sel_subs.c,v 1.28 2019/06/24 03:33:09 deraadt Exp $ */
/* $NetBSD: sel_subs.c,v 1.5 1995/03/21 09:07:42 cgd Exp $ */
/*-
@@ -155,7 +155,7 @@ usr_add(char *str)
*/
if ((str[0] == '\\') && (str[1] == '#'))
++str;
- if (uid_from_user(str, &uid) < 0) {
+ if (uid_from_user(str, &uid) == -1) {
paxwarn(1, "Unable to find uid for user: %s", str);
return(-1);
}
@@ -250,7 +250,7 @@ grp_add(char *str)
*/
if ((str[0] == '\\') && (str[1] == '#'))
++str;
- if (gid_from_group(str, &gid) < 0) {
+ if (gid_from_group(str, &gid) == -1) {
paxwarn(1,"Cannot determine gid for group name: %s", str);
return(-1);
}
diff --git a/bin/pax/tar.c b/bin/pax/tar.c
index a49a5e885fb..eb93d28737c 100644
--- a/bin/pax/tar.c
+++ b/bin/pax/tar.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tar.c,v 1.67 2018/09/13 12:33:43 millert Exp $ */
+/* $OpenBSD: tar.c,v 1.68 2019/06/24 03:33:09 deraadt Exp $ */
/* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */
/*-
@@ -798,10 +798,10 @@ reset:
* the posix spec wants).
*/
hd->gname[sizeof(hd->gname) - 1] = '\0';
- if (Nflag || gid_from_group(hd->gname, &(arcn->sb.st_gid)) < 0)
+ if (Nflag || gid_from_group(hd->gname, &(arcn->sb.st_gid)) == -1)
arcn->sb.st_gid = (gid_t)asc_ul(hd->gid, sizeof(hd->gid), OCT);
hd->uname[sizeof(hd->uname) - 1] = '\0';
- if (Nflag || uid_from_user(hd->uname, &(arcn->sb.st_uid)) < 0)
+ if (Nflag || uid_from_user(hd->uname, &(arcn->sb.st_uid)) == -1)
arcn->sb.st_uid = (uid_t)asc_ul(hd->uid, sizeof(hd->uid), OCT);
/*