It took some experimenting but I got this to work.  Thanks!

----- Original Message -----
From: Joseph A. Knapka <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 22, 2001 4:47 PM
Subject: Re: vncpasswd & scripting


> Lee Allen wrote:
> >
> > I am (still) setting up a Linux system to host a bunch of VNC sessions.
> > This will probably be implemented on many systems, so I very much want
to
> > get it right: to make it smooth, robust, and maintainable.
> >
> > Today's challenge is vncpasswd.
> >
> > We have a C program that maintains users.  It calls useradd, passwd,
> > smbpasswd, creates login scripts -- everything necessary to create a
fully
> > functional user profile on Linux and in our application database.
> >
> > I need to incorporate vncpasswd into this program.  But, unlike passwd
and
> > smbpasswd, vncpasswd does not seem to accept input from stdin.  I looked
at
> > the source code (Notice: I am *NOT* the world's smartest C programmer)
and
> > it seems to call getpass().  I looked at the man page for getpass() and
it
> > seems able to accept input from stdin.  But many different variations of
> > this (at the command line) utterly fail to work:
> >
> > echo -e "newpass\nnewpass" | vncpasswd
> >
> > It still prompts for the password, twice.
> >
> > Any suggestions?
> >
>
> For what it's worth, Expect ( http://expect.nist.gov ) interacts
> with vncpasswd quite nicely; the following expect script changes
> my password to "hithere" on my Linux machine:
>
> spawn vncpasswd
> expect Password:
> send hithere\r
> expect Verify:
> send hithere\r
> exit
>
> So maybe you could have a look at the Expect code and see
> how it's interacting with spawned apps. Note that I didn't
> have to do anything special to make this work, so whatever
> Expect is doing is probably the Right Way to handle
> this sort of thing.
>
> -- Joe Knapka
> ---------------------------------------------------------------------
> To unsubscribe, send a message with the line: unsubscribe vnc-list
> to [EMAIL PROTECTED]
> See also: http://www.uk.research.att.com/vnc/intouch.html
> ---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, send a message with the line: unsubscribe vnc-list
to [EMAIL PROTECTED]
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------

Reply via email to