diff options
author | obrien <obrien@FreeBSD.org> | 2001-06-12 15:58:31 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-06-12 15:58:31 +0000 |
commit | b39990d7f9947621a844c7a4936eeb286a471c47 (patch) | |
tree | 64a7283ba107f59516e2295d3e0dde4935357be1 /usr.bin | |
parent | 6d6ba0ea8e97ed7cd73c3cf2fb25607d77fe20ea (diff) | |
download | FreeBSD-src-b39990d7f9947621a844c7a4936eeb286a471c47.zip FreeBSD-src-b39990d7f9947621a844c7a4936eeb286a471c47.tar.gz |
Allow -u to work with UID's also.
Submitted by: Seth Kingsley <seth.kingsley@windriver.com>
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/killall/killall.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c index 9e75517..d1cb973 100644 --- a/usr.bin/killall/killall.c +++ b/usr.bin/killall/killall.c @@ -225,12 +225,15 @@ main(int ac, char **av) printf("ttydev:0x%x\n", tdev); } if (user) { - pw = getpwnam(user); - if (pw == NULL) - errx(1, "user %s does not exist", user); - uid = pw->pw_uid; - if (dflag) - printf("uid:%d\n", uid); + uid = strtol(user, &ep, 10); + if ((ep - user) < strlen(user)) { + pw = getpwnam(user); + if (pw == NULL) + errx(1, "user %s does not exist", user); + uid = pw->pw_uid; + if (dflag) + printf("uid:%d\n", uid); + } } else { uid = getuid(); if (uid != 0) { |