[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem in output to a kinit process



Sanjay Upadhyay wrote:
> Hi,
> I am sure this would make a good question for a perl list, however as
> the problem I am facing is only when I use heimdal version, has
> prompted me to write to you all, Please bear my newbie question.
> I have an automated process (ie. like webmin) a cgi program to
> configure a kerberos client. However as I am taking the input from the
> users in a form I pass it to a perl program which authenticates the
> kinit process against the kdc. This script works perfectly in Redhat,
> with MIT Kerberos Library, however when I switched my machine to Suse,
> the script fails. here is my script.
>
> ======The Main Part=====
> #!/usr/bin/env perl
> use warnings;
>
>
> open (WTR, "| kinit Administrator\@IN.CAL 2> error.txt");
> print WTR "password\n";
> print WTR "\n";
> close WTR;
> ======
>
> I am encountering problem, where the kinit process waits for user
> input, however the requirement is that it should not wait as I am
> writing the password to STDIN of the process.

You have to take Perl Expect as kinit is reading the password directly 
from the tty.

Greetings
Andreas

-- 
| Andreas Haupt                    | E-Mail:  andreas.haupt@hmi.de
| Hahn-Meitner-Institut (DN)       | WWW:
| Glienicker Straße 100            | Phone:   +49/30/8062-2597
| 14109 Berlin                     | Fax:     +49/30/8062-2096