Index: getfacl.c =================================================================== RCS file: /home/ncvs/src/bin/getfacl/getfacl.c,v retrieving revision 1.9 diff -u -r1.9 getfacl.c --- getfacl.c 30 Dec 2002 15:36:29 -0000 1.9 +++ getfacl.c 27 Mar 2003 19:09:23 -0000 @@ -40,6 +40,8 @@ #include #include +#include +#include #include #include #include @@ -150,6 +152,8 @@ print_acl(char *path, acl_type_t type, int hflag) { struct stat sb; + struct passwd *user; + struct group *grp; acl_t acl; char *acl_text; int error; @@ -168,7 +172,22 @@ else more_than_one++; - printf("#file:%s\n#owner:%d\n#group:%d\n", path, sb.st_uid, sb.st_gid); + user = getpwuid(sb.st_uid); + grp = getgrgid(sb.st_gid); + + printf("#file:%s\n", path); + + user = getpwuid(sb.st_uid); + if (user == NULL) + printf("#owner:%d\n", sb.st_uid); + else + printf("#owner:%s\n", user->pw_name); + + grp = getgrgid(sb.st_gid); + if (grp == NULL) + printf("#group:%d\n", sb.st_gid); + else + printf("#group:%s\n", grp->gr_name); if (hflag) acl = acl_get_link_np(path, type);