<div>Jess,</div>  <div>&nbsp;</div>  <div>Thank you for the reply.&nbsp; Do you think I should be writing this in java instead of perl?&nbsp; Can it not be done in perl?&nbsp; Unfortunately, I know no java, but if that's what it's going to take I guess I'll have to look into it.<BR><BR><B><I>Jess Balint &lt;jbalint@gmail.com&gt;</I></B> wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">  <META content="Microsoft Word 11 (filtered medium)" name=Generator>  <STYLE>  v\:* {behavior:url(#default#VML);}  o\:* {behavior:url(#default#VML);}  w\:* {behavior:url(#default#VML);}  .shape {behavior:url(#default#VML);}  </STYLE>  <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:SmartTagType name="City" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><o:SmartTagType name="place" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><o:SmartTagType
 name="PersonName" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType>  <STYLE>  st1\:*{behavior:url(#default#ieooui) }  </STYLE>    <STYLE>  <!--   /* Font Definitions */   @font-face   {font-family:Tahoma;   panose-1:2 11 6 4 3 5 4 4 2 4;}   /* Style Definitions */   p.MsoNormal, li.MsoNormal, div.MsoNormal   {margin:0in;   margin-bottom:.0001pt;   font-size:12.0pt;   font-family:"Times New Roman";}  a:link, span.MsoHyperlink   {color:blue;   text-decoration:underline;}  a:visited, span.MsoHyperlinkFollowed   {color:purple;   text-decoration:underline;}  span.EmailStyle17   {mso-style-type:personal-reply;   font-family:Arial;   color:navy;}  @page Section1   {size:8.5in 11.0in;   margin:1.0in 1.25in 1.0in 1.25in;}  div.Section1   {page:Section1;}  -->  </STYLE>    <DIV class=Section1>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I would say, first, make sure the hashed password is
 returned and not ‘x’ (shadow). Then, check out this page:<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><A href="http://www-128.ibm.com/developerworks/linux/library/l-md5crypt/?ca=dgr-lnxwLinuxCrypt">http://www-128.ibm.com/developerworks/linux/library/l-md5crypt/?ca=dgr-lnxwLinuxCrypt</A><o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Should have enough details.<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
 style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Jess Balint<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <DIV>  <DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">  <HR tabIndex=-1 align=center width="100%" SIZE=2>  </SPAN></FONT></DIV>  <div class=MsoNormal><B><FONT face=Tahoma size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> chicago-talk-bounces+jbalint=gmail.com@pm.org [mailto:chicago-talk-bounces+jbalint=gmail.com@pm.org] <B><SPAN style="FONT-WEIGHT: bold">On Behalf Of
 </SPAN></B>Richard Reina<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, March 10, 2006 9:06 AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:PersonName w:st="on">Chicago.pm chatter</st1:PersonName><BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [Chicago-talk] accessing <st1:City w:st="on"><st1:place w:st="on">NIS</st1:place></st1:City> password</SPAN></FONT><o:p></o:p></div></DIV>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Dear Darren,<BR><BR>I still stumped and under increasing pressure to get this figured out.&nbsp; I know it's not a lot of money, but for a $100 would it be worth your while to help me out.<BR><BR>Richard<BR><BR><B><I><SPAN style="FONT-WEIGHT: bold; FONT-STYLE:
 italic">"Young, Darren" &lt;Darren.Young@ChicagoGSB.edu&gt;</SPAN></I></B> wrote:<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><BR>Use the getpw* (getpwnam) functions to return the user's password entry,<BR>if your name service switch is configured correctly it'll return the<BR>entry regardless of location.<BR><BR>You MUST have the encrypted first to perform the comparision. This is<BR>also assuming you're password is in crypt format and not something else<BR>(MD5, etc). If it is crypt, take the first 2 characters to get the salt<BR>then re-crypt() the plain from the user with that salt. Once that's done<BR>just string compare the 2, if they match, the password was correct,<BR>else, it was wrong.<BR><BR>&gt;&gt;&gt;<BR><BR>my $username = 'foo';<BR>my $plainfromuser = 'hispass';<BR>my $currentsalt;<BR><BR>my ($name, $passwd, $uid, $gid, $quota, $comment, <BR>$gcos, $dir, $shell) =
 getpwnam($username);<BR><BR>$currentsalt = substr($passwd,0,2);<BR><BR>my $tpass = crypt($plainfromuser, $currentsalt);<BR><BR>if ( $tpass eq $passwd ) {<BR>print "good\n";<BR>} else {<BR>print "bad\n";<BR>}<BR><BR>Just tried that on my <st1:City w:st="on"><st1:place w:st="on">NIS</st1:place></st1:City> enabled Solaris 8 system and it worked.<BR><BR><BR><BR><BR>I am trying to write a script that prompts a user ( that is<BR>already logged in ) for his password when he runs certain perl<BR>applications. I am able to write the part that prompts the user for the<BR>password with "no echo" however I have no idea how to compare the entry<BR>to his password especially since we use <st1:City w:st="on"><st1:place w:st="on">NIS</st1:place></st1:City> and thus the passwords are<BR>not on the local machine but on the server ( on the same LAN). Can<BR>anyone provide any help on how I would compare the entry ag ainst the <st1:City w:st="on"><st1:place
 w:st="on">NIS</st1:place></st1:City><BR>password?<BR><BR>Thanks in advance,<BR><BR>Richard<BR><BR><BR>A people that values its privileges above its principles soon<BR>loses both.<BR>-Dwight D. Eisenhower.<BR><BR>_______________________________________________<BR>Chicago-talk mailing list<BR>Chicago-talk@pm.org<BR>http://mail.pm.org/mailman/listinfo/chicago-talk<o:p></o:p></SPAN></FONT></div>  <div class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><BR><BR><BR>A people that values its privileges above its principles soon loses both.<BR>-Dwight D. Eisenhower.<o:p></o:p></SPAN></FONT></div></DIV>_______________________________________________<BR>Chicago-talk mailing list<BR>Chicago-talk@pm.org<BR>http://mail.pm.org/mailman/listinfo/chicago-talk</BLOCKQUOTE><BR><BR><BR>A people that values its privileges above its principles soon loses both.<br> -Dwight D. Eisenhower.