From: Martin Schlemmer <azarah@nosferatu•za.org>
To: kyle@marchex•com
Cc: GIT Mailing Lists <git@vger•kernel.org>
Subject: Re: [patch] fixup GECOS handling
Date: Fri, 22 Apr 2005 18:58:25 +0200 [thread overview]
Message-ID: <1114189105.29271.36.camel@nosferatu.lan> (raw)
In-Reply-To: <1114186599.31076.409.camel@axer.marchex.com>
[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]
On Fri, 2005-04-22 at 09:16 -0700, Kyle Hayes wrote:
> On Fri, 2005-04-22 at 16:23 +0200, Martin Schlemmer wrote:
> > Hi,
> >
> > This still applies - any reason for not doing this?
>
> Seems like this will break on certain kinds of data. See below.
>
> > if (!pw)
> > die("You don't exist. Go away!");
> > realgecos = pw->pw_gecos;
> > + /* The name is seperated from the room no., tel no, etc via [,;] */
> > + if (strchr(realgecos, ','))
> > + *strchr(realgecos, ',') = 0;
> > + else if (strchr(realgecos, ';'))
> > + *strchr(realgecos, ';') = 0;
> > len = strlen(pw->pw_name);
> > memcpy(realemail, pw->pw_name, len);
> > realemail[len] = '@';
>
> Suppose that the GECOS field is:
>
> Hayes, Kyle; Room 42; 424-424-4242; foo bar baz...
>
> You'll search for the first comma, find it, truncate my name to "Hayes",
> and continue.
>
> I have seen this kind of GECOS in larger environments where the
> individual users are not the ones that administrate their machines.
> Using the LastName, FirstName style of name is not rare.
>
What OS? With Linux at least, this is what chfn's manpage say:
----
The only restriction placed on the contents of the fields is that no control characters may be present,
nor any of comma, colon, or equal sign. The other field does not have this restriction, and is used to
store accounting information used by other applications.
----
Meaning, if they use a ',' in one of the fields (and it is a linux
system with the chfn most probably from the shadow package), then they
are looking for trouble. The only reason I added the ';' was because
somebody said whatever OS used it instead of a ','.
Thanks,
--
Martin Schlemmer
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-04-22 16:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-18 10:36 [patch] fixup GECOS handling Martin Schlemmer
2005-04-18 12:35 ` David Woodhouse
2005-04-18 12:58 ` Martin Schlemmer
2005-04-22 14:23 ` Martin Schlemmer
2005-04-22 16:16 ` Kyle Hayes
2005-04-22 16:58 ` Martin Schlemmer [this message]
2005-04-22 17:18 ` Petr Baudis
2005-04-22 17:25 ` Martin Schlemmer
2005-04-22 17:58 ` Kyle Hayes
2005-04-22 19:06 ` Martin Schlemmer
2005-04-22 20:46 ` Kyle Hayes
2005-04-23 23:38 ` Petr Baudis
2005-04-23 23:49 ` Martin Schlemmer
2005-04-22 17:43 ` Kyle Hayes
2005-04-22 23:30 ` Andy Isaacson
2005-04-25 17:02 ` Kyle Hayes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1114189105.29271.36.camel@nosferatu.lan \
--to=azarah@nosferatu$(echo .)za.org \
--cc=git@vger$(echo .)kernel.org \
--cc=kyle@marchex$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox