From owner-freebsd-hackers Fri Aug 11 22:36:46 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id WAA13852 for hackers-outgoing; Fri, 11 Aug 1995 22:36:46 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id WAA13841 for ; Fri, 11 Aug 1995 22:36:33 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id PAA01476; Sat, 12 Aug 1995 15:32:42 +1000 Date: Sat, 12 Aug 1995 15:32:42 +1000 From: Bruce Evans Message-Id: <199508120532.PAA01476@godzilla.zeta.org.au> To: evans@fubar.cl.msu.edu, freebsd-hackers@FreeBSD.org Subject: Re: why are pw_uid and pw_gid defined as int's in pwd.h/grp.h? Sender: hackers-owner@FreeBSD.org Precedence: bulk > Does anyone know why in pwd.h inside the password struct both pw_uid >and pw_gid items are defined as int's? Shouldn't they be uid_t and gid_t? >Also on a similar note in the grp.h file inside the definition of struct >group, item gr_gid is defined as an int and not gid_t. and are broken, perhaps for compatibility with broken applications. > My main concern is that I am writing library functions that add/delete >users and groups and need to be able to print them out correctly. Currently >chpass(and the other password utils) print it out like this: >from src/usr.bin/chpass/pw_copy.c: > struct passwd *pw; > > (void)fprintf(to, "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n", > pw->pw_name, pw->pw_passwd, pw->pw_uid, pw->pw_gid, > pw->pw_class, pw->pw_change, pw->pw_expire, pw->pw_gecos, > pw->pw_dir, pw->pw_shell); This is a good example of application broken-ness. Bruce