[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with quoted email addresses.



>   ------- 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()?

Dean.