FreeBSD Bugzilla – Attachment 129906 Details for
Bug 173977
pw(8) does not do range-checking on UIDs/GUIs from user's input, passwd DB becomes inconsistent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.01 KB, created by
nvass
on 2012-11-28 18:50:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
nvass
Created:
2012-11-28 18:50:00 UTC
Size:
1.01 KB
patch
obsolete
>Index: usr.sbin/pw/pw_group.c >=================================================================== >--- usr.sbin/pw/pw_group.c (revision 243652) >+++ usr.sbin/pw/pw_group.c (working copy) >@@ -350,6 +350,8 @@ > */ > if (a_gid != NULL) { > gid = (gid_t) atol(a_gid->val); >+ if (errno == ERANGE || errno == EINVAL) >+ errx(EX_DATAERR, "gid %s is invalid", a_gid->val); > > if ((grp = GETGRGID(gid)) != NULL && getarg(args, 'o') == NULL) > errx(EX_DATAERR, "gid `%ld' has already been allocated", (long) grp->gr_gid); >Index: usr.sbin/pw/pw_user.c >=================================================================== >--- usr.sbin/pw/pw_user.c (revision 243652) >+++ usr.sbin/pw/pw_user.c (working copy) >@@ -849,6 +849,8 @@ > */ > if (a_uid != NULL) { > uid = (uid_t) atol(a_uid->val); >+ if (errno == ERANGE || errno == EINVAL) >+ errx(EX_DATAERR, "uid %s is invalid", a_uid->val); > > if ((pwd = GETPWUID(uid)) != NULL && getarg(args, 'o') == NULL) > errx(EX_DATAERR, "uid `%ld' has already been allocated", (long) pwd->pw_uid);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 173977
: 129906