<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=562424216-05082007><FONT face=宋体 
color=#0000ff>Thank you very much!</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=562424216-05082007><FONT face=宋体 
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=562424216-05082007><FONT face=宋体 
color=#0000ff>1. Yes, I have already defined the "service" 
"check_user"</FONT></SPAN></DIV>
<DIV><SPAN class=562424216-05082007></SPAN><FONT face=宋体><FONT 
color=#0000ff>2. Yes, I used the "<SPAN 
class=562424216-05082007>misc_conv</SPAN>" which defined in the pam_misc.h</FONT></FONT></DIV>
<DIV><FONT face=宋体><FONT color=#0000ff></FONT></FONT> </DIV>
<DIV>
<DIV><FONT face=宋体 color=#0000ff><SPAN class=562424216-05082007>I changed 
my "check_user" service file is:</SPAN></FONT></DIV>
<DIV><FONT face=宋体 color=#0000ff><SPAN class=562424216-05082007><STRONG><FONT 
color=#000000>auth       
required     pam_stack.so 
service=system-auth<BR>auth       
required     pam_nologin.so<BR>account    
required     pam_stack.so 
service=system-auth</FONT></STRONG></SPAN></FONT></DIV>
<DIV><FONT face=宋体 color=#000000><SPAN 
class=562424216-05082007><STRONG></STRONG></SPAN></FONT> </DIV></DIV>
<DIV><FONT><FONT><FONT face=宋体 color=#0000ff><SPAN class=562424216-05082007>I 
get some new results , but i don't unterstand what's going 
on?</SPAN></FONT></FONT></FONT><FONT><FONT><FONT face=宋体 color=#0000ff><SPAN 
class=562424216-05082007></DIV></SPAN></FONT></FONT></FONT>
<DIV><FONT><FONT><FONT face=宋体 color=#0000ff><SPAN 
class=562424216-05082007></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT><FONT><FONT face=宋体 color=#0000ff><SPAN class=562424216-05082007>1. I 
login the system as root , and complied my code , then run it , everything is 
ok</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT><FONT face=宋体 color=#0000ff><SPAN class=562424216-05082007>2. I 
login the system as no-root , run the program complied by root , get this code 
"PAM_AUTHINFO_UNAVAIL"</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT><FONT face=宋体 color=#0000ff><SPAN class=562424216-05082007>3. I 
login the system as no-root , complied my code ,then run the program , get this 
code "PAM_AUTHINFO_UNAVAIL"</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT><FONT face=宋体 color=#0000ff><SPAN 
class=562424216-05082007></SPAN></FONT></FONT></FONT><FONT><FONT><FONT face=宋体 
color=#0000ff><SPAN class=562424216-05082007>4. I login the system as no-root 
,then run "sudo chmod u+s check_user" on the program i just complied,  run 
it ,</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT><FONT face=宋体 color=#0000ff><SPAN 
class=562424216-05082007> I get the code 
"PAM_AUTHINFO_UNAVAIL"</SPAN></FONT></FONT></FONT><FONT face=宋体 
color=#0000ff></FONT><FONT face=宋体 color=#0000ff></FONT><FONT face=宋体 
color=#0000ff></FONT><BR></DIV>
<DIV><SPAN class=562424216-05082007><FONT face=宋体 color=#0000ff>Please explain 
for me.</FONT></SPAN></DIV>
<DIV><SPAN class=562424216-05082007><FONT face=宋体 color=#0000ff>Thank you very 
much!</FONT></SPAN></DIV>
<DIV><SPAN class=562424216-05082007><FONT face=宋体 
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=562424216-05082007><FONT face=宋体 color=#0000ff>Chu 
Qiu</FONT></SPAN></DIV>
<DIV><FONT face=宋体 color=#0000ff></FONT> </DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> pam-list-bounces@redhat.com 
[mailto:pam-list-bounces@redhat.com] <B>On Behalf Of </B>Andreas 
Schindler<BR><B>Sent:</B> 2007年8月4日 15:56<BR><B>To:</B> 
pam-list@redhat.com<BR><B>Subject:</B> Re: Pam-list Digest, Vol 42, Issue 
3<BR></FONT><BR></DIV>
<DIV></DIV>
<BLOCKQUOTE cite=mid:20070804160009.DAB7173195@hormel.redhat.com 
  type="cite"><BR>
  <META content="MSHTML 6.00.6000.16481" name=GENERATOR>
  <DIV><SPAN class=625443921-03082007><FONT face=宋体>I'm studying on pam library 
  , and I run the code given by "The Linux-PAM Application Developer's Guide" on 
  redhat linux.</FONT></SPAN></DIV>
  <DIV><SPAN class=625443921-03082007></SPAN> </DIV>
  <DIV><SPAN class=625443921-03082007><FONT face=宋体>"retval = 
  pam_authenticate(pamh, 0);" is running successfully</FONT></SPAN></DIV>
  <DIV><SPAN class=625443921-03082007><FONT face=宋体 
  color=#0000ff></FONT></SPAN> </DIV>
  <DIV><SPAN class=625443921-03082007><FONT face=宋体>but the next "retval = 
  pam_acct_mgmt(pamh, 0);" return "PAM_AUTHINFO_UNAVAIL"</FONT></SPAN></DIV>
  <DIV><SPAN class=625443921-03082007><FONT face=宋体 
  color=#0000ff></FONT></SPAN> </DIV>
  <DIV><SPAN class=625443921-03082007><FONT face=宋体>I don't know what problem is 
  it? Please do me a favour.</FONT></SPAN></DIV>
  <DIV><SPAN class=625443921-03082007></SPAN> </DIV>
  <DIV><SPAN class=625443921-03082007><FONT face=宋体>Thank you very 
  much</FONT></SPAN></DIV>
  <DIV><SPAN 
class=625443921-03082007></SPAN> </DIV></BLOCKQUOTE>Chu,<BR><BR>there are 
several things in your program to be checked:<BR>
<OL>
  <LI>have you already defined the 'service' 'check_user' in your pam.d 
  directory?<BR>If not, the behaviour will fall back to service 'other', which 
  may be missing too. 
  <LI>Does your conversation function 'conv' as defined in pam_start() work 
  well, i.e.<BR>does it query for a password? If not, you must supply a password 
  via pam_set_item()<BR>to make pam_authenticate work. </LI></OL><BR>I suggest, 
you go and start a debugger (gdb) to look for what your example program<BR>is 
doing in detail.<BR><BR>Regards, <BR>Andreas<BR>
<DIV class=moz-signature>-- <BR>Dr.-Ing. Andreas Schindler<BR><BR>PDV Systeme 
AZ1 GmbH<BR>Frankfurter Str. 141<BR>63303 Dreieich<BR><BR>Telefon 
06103-57187-21<BR>Telefax 06103-373245<BR><BR><A class=moz-txt-link-abbreviated 
href="mailto:schindler@az1.de">schindler@az1.de</A><BR><A 
class=moz-txt-link-abbreviated 
href="http://www.az1.de">www.az1.de</A><BR><BR>PDV Systeme AZ1 GmbH, 
Brandeniusstr. 3, 44265 Dortmund<BR><SMALL>HRB 11089 Amtsgericht Dortmund, 
Geschäftsführer : Klaus-Jürgen Koke, Joachim Carle</SMALL> </DIV></BODY></HTML>