[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Looking for a perl script for linux
Oded Arbel wrote:
> On 10 May 1999, Oleg Goldshmidt wrote:
>
> > Elchanan Sharon <elchanan@smlink.com> writes:
> >
> > > I am looking for a perl script that adds user
> > > to linux OS.
> > > You can point me to RTFM pointer
> > > if the answer is too obvious.
> >
> > Will a bash script do? Look for adduser. It's probably
> > /usr/sbin/adduser, but your mileage may vary.
> I'm looking into it myself, and one thing I've found out already, assuming
> that you want to do it for the same reason as I - for a web interface,
> that using bash scripts (or perl for that matter - not that you can) is a
> very bad idea....
>
> you need to write a c program to do this, otherwise it's as secure as
> posting your passwords on a bill board (not that the whole practice is
> very secure, but it's better then letting your non-techs hang around in
> the system with root premissions).
>
> Oded
> --
I am actually working on a similar project (or I was and will be again L-RD
willing). Essentially, I realized quickly, as you said Oded, that I did not
want to use Perl script to do this (or at least make the actual change to the
password), but that I did want the
whole thing to initiate from a web form that got the users name (well really
it already should know whom the user is), the current password, and the the
new password twice.
I then would have this CGI information handed off to a perl script that did
some initial
error checking, and then it would call a program was setuid 0 setgid 0 which
took parameters from standard input in the form of a key value pair stream
(that is really much like the format used by CGI [since it already had the
parameters in this form its easy to pass them on thusly, once it is know that
they are OK]).
I guess the only thing that is holding me up is that I decided to support PAM
(a good decision I believe), and PAM need some sort of function pointer passed
to it to actually read in the data for itself (which is kind of weird and
clunky when its not an interactive program you trying to write). So anyway, I
am working on that part. Once I have figured out exactly how to write this
function, then the rest is pretty easy (actually its already there [one of the
results of top-down functional decomposition is you get all the easy stuff
done first and the nitty gritty ugly stuff is saved till last]).
Anyway, once its done I will make it available to anyone who needs it. I
would love to see any work you doing also.
Shalom...james