Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2012 09:31:50 +0100 (CET)
From:      =?ISO-8859-1?Q?Trond_Endrest=F8l?= <Trond.Endrestol@fagskolen.gjovik.no>
To:        jb <jb.1234abcd@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: /etc/passwd and "&" char
Message-ID:  <alpine.BSF.2.00.1210290930320.26470@mail.fig.ol.no>
In-Reply-To: <loom.20121029T091947-234@post.gmane.org>
References:  <loom.20121029T091947-234@post.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--2055831798-2142601691-1351499510=:26470
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT

On Mon, 29 Oct 2012 08:28-0000, jb wrote:

> Hi,
> 
> Question:
> What is the purpose of the "&" char in GECOS fields, e.g. user's name field, in
> /etc/passwd file ?
> 
> $ grep "&" /etc/passwd
> root:*:0:0:Charlie &:/root:/bin/csh
> operator:*:2:5:System &:/:/usr/sbin/nologin
> svn:*:1002:1002:User &:/home/svn:/usr/sbin/nologin

>From passwd(5):

     The full name may contain a ampersand (`&') which will be replaced by the
     capitalized login name when the gecos field is displayed or used by vari-
     ous programs such as finger(1), sendmail(8), etc.

> The field containing "&" char represents "-c comment" option in pw(8), which
> sets up GECOS fields (user's full name, etc).
> 
> The pw(8) states further:
> ...
>      The pw utility allows 8-bit characters in the passwd GECOS field ...
>      ...
>                                 Using 8-bit characters may also affect other
>      programs that transmit the contents of the GECOS field over the Internet,
>      such as fingerd(8), and a small number of TCP/IP clients, such as IRC,
>      where full names specified in the passwd file may be used by default.
> ...
> 
> http://en.wikipedia.org/wiki/Ampersand
> ...
> Encoding and display
> ...
> Programming languages
> ...
>   The ampersand character is used as a special character in at least some
>   versions of the database software originally created in Denmark under the
>   name Navision (the software has since been acquired by Microsoft). Using this
>   character in either "Text" or "Code" fields could create difficulties for
>   performing certain tasks in Navision, such as filtering records (either by
>   the user or by programming). It is also used as described below to indicate
>   shortcuts in menu items and lab els.
> ...
> Text markup
>   In SGML, XML, and HTML, ... This creates what is known as the ampersand
>   problem. ...
> ...
> Unix shells
> ...
> Web standards
> ...
> 
> Google search results for "& character":
> Special (escape) characters in SGML, HTML and XML documents:
> &amp;   &#38;   &       ampersand
> 
> jb

-- 
+-------------------------------+------------------------------------+
| Vennlig hilsen,               | Best regards,                      |
| Trond Endrestøl,              | Trond Endrestøl,                   |
| IT-ansvarlig,                 | System administrator,              |
| Fagskolen Innlandet,          | Gjøvik Technical College, Norway,  |
| tlf. mob.   952 62 567,       | Cellular...: +47 952 62 567,       |
| sentralbord 61 14 54 00.      | Switchboard: +47 61 14 54 00.      |
+-------------------------------+------------------------------------+
--2055831798-2142601691-1351499510=:26470--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1210290930320.26470>