#include #include #include #include #include #include void main(void) { int f; char dummy[17]; f = open("/var/adm/ftp/users", O_WRONLY|O_CREAT|O_TRUNC, 0644); if (f>=0) { struct passwd * pw; while((pw = getpwent()) != NULL) { lseek(f, 9*pw->pw_uid, SEEK_SET); sprintf( dummy, "%s%s", pw->pw_name, " " ); write(f, dummy, 8); } close(f); } else { exit( 1 ); } f = open("/var/adm/ftp/groups", O_WRONLY|O_CREAT|O_TRUNC, 0644); if (f>=0) { struct group * gr; while((gr = getgrent()) != NULL) { lseek(f, 9*gr->gr_gid, SEEK_SET); sprintf( dummy, "%s%s", gr->gr_name, " " ); write(f, dummy, 8); } close(f); } else { exit( 2 ); } exit( 0 ); }