Re: [patch] fixup GECOS handling

From: Petr Baudis <pasky@ucw.cz>
Date: 2005-04-24 09:38:21
Dear diary, on Fri, Apr 22, 2005 at 09:06:43PM CEST, I got a letter
where Martin Schlemmer <azarah@nosferatu.za.org> told me that...
> @@ -311,6 +296,17 @@
>         if (!pw)
>                 die("You don't exist. Go away!");
>         realgecos = pw->pw_gecos;
> +       /*
> +        * The GECOS fields are seperated via ',' on Linux, FreeBSD, etc,
> +        * and ';' on AIX.
> +        */
> +#if defined(__aix__)
> +       if (strchr(realgecos, ';'))
> +               *strchr(realgecos, ';') = 0;
> +#else
> +       if (strchr(realgecos, ','))
> +               *strchr(realgecos, ',') = 0;
> +#endif
>         len = strlen(pw->pw_name);
>         memcpy(realemail, pw->pw_name, len);
>         realemail[len] = '@';

I'm confused, what does this has to do with AIX? Do we even have / can
expect to have any major AIX users?

I'm not too happy with this, I have to say. It seems it won't do always
the right thing anyway. I would still favour the approach when you cut
off everything after ';', and everything after ',' if no ';' is found.
Seems simplest, safest, etc.

Tell me about anyone who has a semicolon in his realname.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sun Apr 24 09:38:35 2005

This archive was generated by hypermail 2.1.8 : 2005-04-24 09:38:35 EST