summaryrefslogtreecommitdiffstats
path: root/chpass/chpass.c
diff options
context:
space:
mode:
authorMike Barcroft <mike@FreeBSD.org>2001-07-26 23:27:10 +0000
committerMike Barcroft <mike@FreeBSD.org>2001-07-26 23:27:10 +0000
commit2e7897495782bf04835cf18c52dbcfec3fcfe61e (patch)
tree84cf1d2449e5e61af0b1267bb9ce8b2143fbc334 /chpass/chpass.c
parentff4aa702015e5d6b3863c90eba93e78bb2e26a23 (diff)
downloadpw-darwin-2e7897495782bf04835cf18c52dbcfec3fcfe61e.tar.gz
pw-darwin-2e7897495782bf04835cf18c52dbcfec3fcfe61e.tar.zst
pw-darwin-2e7897495782bf04835cf18c52dbcfec3fcfe61e.zip
Prevent chpass(1) from writing -1 in the UID or GID fields
in the password file by properly casting integers. PR: 27757 Reviewed by: des Approved by: des MFC after: 4 days
Diffstat (limited to 'chpass/chpass.c')
-rw-r--r--chpass/chpass.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/chpass/chpass.c b/chpass/chpass.c
index 69e700f..f10a9d6 100644
--- a/chpass/chpass.c
+++ b/chpass/chpass.c
@@ -173,7 +173,8 @@ main(argc, argv)
#else
case 0:
if (!(pw = getpwuid(uid)))
- errx(1, "unknown user: uid %u", uid);
+ errx(1, "unknown user: uid %lu",
+ (unsigned long)uid);
break;
case 1:
if (!(pw = getpwnam(*argv)))