Path: utzoo!utgpu!watmath!clyde!att!rutgers!ucsd!sdcsvax!ucsdhub!esosun!seismo!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: GCOS field Message-ID: <573@auspex.UUCP> Date: 4 Dec 88 08:06:55 GMT References: <17641@adm.BRL.MIL> <8980@smoke.BRL.MIL> <8516@elsie.UUCP> <8990@smoke.BRL.MIL> <8517@elsie.UUCP> <9003@smoke.BRL.MIL> <1257@vsedev.VSE.COM> <7996@dasys1.UUCP> <552@auspex.UUCP> <12717@steinmetz.ge.com> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 29 >I'm not sure what you mean by "sets them both to point..." but if you >try putpwent on Ultrix, Xenix, or V/386 it seems to use the GCOS field >and ignore the comment field. It can't choose both, so it has to ignore one; the code that sets the "comment" field may be a recent innovation antedating "putpwent" (I lack access to sources of sufficiently old releases to check this), so for historical reasons "putpwent" would use the "gecos" field. It is probably not a *good* innovation; it might be nice if the field had been named "comment", but it's probably not worth fixing now (it may be too late to fix it anyway). If somebody wants to fix names, perhaps they should think about changing "creat" to "create" :-) :-) :-) :-). (I seem to remember a comment along the lines of either "if I did UNIX again, the only thing I'd change is that I'd call 'creat' 'create" or "if I did UNIX again, I'd have called 'creat' 'create'" being ascribed to Ken Thomson; did he actually say something like either of those, and what did he actually say?) Basically, programmers should pretend the "pw_comment" field is a filler field, not containing anything and not used. By "sets them both to point" I meant "sets them both to point"; "getpwent" implementations generally read a line from the password file into a buffer, stuff '\0's into the buffer to cut it into fields, and set the "char *" members of the "struct passwd" structure to point into that buffer; the S5R3 implementation sets both "pw_comment" and "pw_gecos" to point to the same place in the buffer, namely the beginning of the GCOS field.