[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with quoted email addresses.
On Fri, 2 May 1997, Dean Michaels wrote:
> > ------- pwtest.c ---------
> > #include <stdio.h>
> > #include <pwd.h>
> > #define USER " dmichael"
> > main()
> > {
> > struct passwd *pw = getpwnam(USER);
> > printf ("getpwnam(\"%s\") -> ",USER);
> > if (pw == NULL)
> > printf("USER UNKNOWN\n");
> > else
> > printf("user='%s', uid=%d\n", pw->pw_name, pw->pw_uid);
> > return 0;
> > }
>
> Produces the following under Solaris 2.5.1
>
> /Zmailer> make pwtest
> cc -o pwtest pwtest.c
> /Zmailer> ./pwtest
> getpwnam(" dmichael") -> user='dmichael', uid=1001
> /Zmailer>
>
> What do you suggest, a wrapper for getpwnam()?
Whoa, this may not generalise to "all" Solaris machines.
(Seems not all Solaris's are equal then - Dean's machine
is certainly different than mine).
I get a proper response from an SS4 and an Ultra-1:
SS4:
# uname -a
SunOS srv 5.5.1 Generic sun4m sparc SUNW,SPARCstation-4
using either gcc or cc (/usr/ucb/cc) I get:
# gcc -o pwtest pwtest.c
# ./pwtest
getpwnam(" jmack") -> USER UNKNOWN
# cc -o pwtest pwtest.c
# ./pwtest
getpwnam(" jmack") -> USER UNKNOWN
Ultra-1:
# uname -a
SunOS tuzo 5.5 Generic sun4u sparc SUNW,Ultra-1
# ./pwtest
getpwnam(" jmack") -> USER UNKNOWN
(perhaps there is something wonky with libc on Dean's machine?)
Cheers,
--
James S. MacKinnon Office: P-139 Avahd-Bhatia Physics Lab
Team Physics Voice : (403) 492-8226
University of Alberta email : Jim.MacKinnon@Phys.UAlberta.CA
Edmonton, Canada T6G 2N5
WWW: http://www.phys.ualberta.ca/~jmack/jmack.html