expanding `&' in struct passwd.pw_gecos

Luke Mewburn luke at mewburn.net
Tue Jan 4 21:40:47 GMT 2005


On Tue, Jan 04, 2005 at 12:05:40PM -0600, Gerald (Jerry) Carter wrote:
  | Tim Potter wrote:
  | | On Tue, 2004-12-14 at 10:20 +1100, Luke Mewburn wrote:
  | |
  | |>On Wed, Dec 01, 2004 at 03:20:20PM +1100, Luke Mewburn wrote:
  | |>  | Various systems (SunOS 4, Solaris, NetBSD, FreeBSD, ...)
  | |>  | support the replacment of occurrences `&' in the pw_gecos
  | |>  | field with the pw_name field.  (See passwd(4) / passwd(5)).
  | |>  |
  | |>  | Unfortunately this wasn't done inside the getpwent(3) API,
  | |>  | relying upon the end-applications to do this conversion.
  | |
  | |
  | |>I submitted bug #2154 with an attached patch.
  | |>It implements a new 'passwd expand gecos = <boolean>' global.
  | |
  | |
  | | I'm planning to apply this patch soon, unless anyone
  | | has any objections. The default for the new parameter is
  | | false (i.e no expansion is done).
  | 
  | Just curious.  Is anyone besides Luke asking for this ?
  | I've never heard of such behavior in several years.
  | If only one or two people want it, I would rather leave
  | it out.  Or as a local patch.

The patch is actually installed by default as part of NetBSD's
pkgsrc build of Samba.  Whilst pkgsrc is primarily targetted
for NetBSD it is multi-platform and various people use it as
the third party software build infrastructure for their systems
(including Solaris, HP-UX, IRIX, FreeBSD, DragonflyBSD, OpenBSD,
Darwin/MacOS X, etc).  So, many people are already benefitting
from this feature.

As I mention in the bug report, the '&' expansion in the
pw_gecos field has been a documented feature of BSD systems
and SunOS/Solaris for many years, and before the rise of Linux
SunOS/Solaris, and BSD derived UNIXes were some of the most
popular UNIX systems, and are still popular.  It's not like
this is just a feature added recently in NetBSD.

Cheers,
Luke.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20050105/1191e892/attachment.bin


More information about the samba-technical mailing list