From: Weicheng Pan <wcpan@csie.nctu.edu.tw>
To: gentoo-amd64@lists.gentoo.org
Subject: [gentoo-amd64] NIS problem
Date: Wed, 26 Oct 2005 05:49:59 +0800 [thread overview]
Message-ID: <435EA887.8090509@csie.nctu.edu.tw> (raw)
Hi all:
I meet a very strange problem on my NIS. I test two cases, which one is
a Gentoo i386 box, and the other is Gentoo AMD64 box.
I referenced this page:
http://www.linux-nis.org/nis-howto/HOWTO/settingup_client.html , and can
successfully login.
But when my directory has unknown UID on AMD64 box, it will return a
SEGMENTATION FAULT error.
Then I use the following code to verify the client settings:
#include <stdio.h>
#include <pwd.h>
#include <sys/types.h>
int
main(int argc, char *argv[])
{
struct passwd *pwd;
if(argc != 2)
{
fprintf(stderr,"Usage: getwpnam username\n");
exit(1);
}
pwd=getpwnam(argv[1]);
if(pwd != NULL)
{
printf("name.....: [%s]\n",pwd->pw_name);
printf("password.: [%s]\n",pwd->pw_passwd);
printf("user id..: [%d]\n", pwd->pw_uid);
printf("group id.: [%d]\n",pwd->pw_gid);
printf("gecos....: [%s]\n",pwd->pw_gecos);
printf("directory: [%s]\n",pwd->pw_dir);
printf("shell....: [%s]\n",pwd->pw_shell);
}
else
fprintf(stderr,"User \"%s\" not found!\n",argv[1]);
exit(0);
}
Finally, I found that getpwnam() call will cause segmentation fault
rather than return NULL on pass a non-exist username on AMD64 box.
Is anybody has encounter this situation?
Regards,
Weicheng.
--
gentoo-amd64@gentoo.org mailing list
next reply other threads:[~2005-10-26 6:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-25 21:49 Weicheng Pan [this message]
2005-10-28 19:44 ` [gentoo-amd64] NIS problem Steve Herber
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=435EA887.8090509@csie.nctu.edu.tw \
--to=wcpan@csie.nctu.edu.tw \
--cc=gentoo-amd64@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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