version 1.94, 2018/09/13 15:23:32 |
version 1.95, 2018/09/16 02:44:06 |
|
|
optstr = "fnop:su:vN:M:"; |
optstr = "fnop:su:vN:M:"; |
} |
} |
|
|
|
/* Keep passwd file open for faster lookups. */ |
|
setpassent(1); |
|
|
/* |
/* |
* fuser and fstat share three flags: -f, -s and -u. In both cases |
* fuser and fstat share three flags: -f, -s and -u. In both cases |
* -f is a boolean, but for -u fstat wants an argument while fuser |
* -f is a boolean, but for -u fstat wants an argument while fuser |
|
|
if (uflg++) |
if (uflg++) |
usage(); |
usage(); |
if (!fuser) { |
if (!fuser) { |
if (!(passwd = getpwnam(optarg))) { |
uid_t uid; |
arg = strtonum(optarg, 0, UID_MAX, |
|
|
if (uid_from_user(optarg, &uid) == -1) { |
|
uid = strtonum(optarg, 0, UID_MAX, |
&errstr); |
&errstr); |
if (errstr != NULL) { |
if (errstr != NULL) { |
errx(1, "%s: unknown uid", |
errx(1, "%s: unknown uid", |
optarg); |
optarg); |
} |
} |
} else |
} |
arg = passwd->pw_uid; |
arg = uid; |
what = KERN_FILE_BYUID; |
what = KERN_FILE_BYUID; |
} |
} |
break; |
break; |