diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2018-09-16 02:43:12 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2018-09-16 02:43:12 +0000 |
commit | 9c8f73324a0075fd194fa0cdfe30ea838752d595 (patch) | |
tree | 0f450f6a0b6e31f6ee187b54cb7fdcc69c94da89 /sbin/fsck_ffs | |
parent | 97c1792c8951d9b761662d4459c7bc1e59b323e5 (diff) |
Use user_from_uid(3) and group_from_gid(3) in a few more places
that do repeated lookups. OK tb@
Diffstat (limited to 'sbin/fsck_ffs')
-rw-r--r-- | sbin/fsck_ffs/inode.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 39695b54625..bdac6546e33 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inode.c,v 1.48 2016/12/16 17:44:59 krw Exp $ */ +/* $OpenBSD: inode.c,v 1.49 2018/09/16 02:43:11 millert Exp $ */ /* $NetBSD: inode.c,v 1.23 1996/10/11 20:15:47 thorpej Exp $ */ /* @@ -525,10 +525,7 @@ void pinode(ino_t ino) { union dinode *dp; - char *p; -#ifndef SMALL - struct passwd *pw; -#endif + const char *p; time_t t; printf(" I=%llu ", (unsigned long long)ino); @@ -537,8 +534,8 @@ pinode(ino_t ino) dp = ginode(ino); printf(" OWNER="); #ifndef SMALL - if ((pw = getpwuid(DIP(dp, di_uid))) != 0) - printf("%s ", pw->pw_name); + if ((p = user_from_uid(DIP(dp, di_uid), 1)) != NULL) + printf("%s ", p); else #endif printf("%u ", (unsigned)DIP(dp, di_uid)); |