Thread View: comp.sys.next.sysadmin
3 messages
3 total messages
Started by Mike Matthews
Mon, 02 Nov 1992 17:25
Preferences Password module
Author: Mike Matthews
Date: Mon, 02 Nov 1992 17:25
Date: Mon, 02 Nov 1992 17:25
22 lines
1189 bytes
1189 bytes
Has anyone else written a replacement Password changing module for Preferences (for NeXTstep 2.2 and/or 3.0) that changes the user's NIS password a la yppasswd instead of their NetInfo password? Right now I'm thinking of making a module (at least 3.0 has the API) that does nothing but subprocess out to yppasswd since you can't just say yppasword userid oldpassword newpassword. [At least, I HOPE you can't.] ------ Mike Matthews, matthews@oberon.umd.edu (NeXTmail accepted) ------ INVENTORY Four be the things I am wiser to know: Idleness, sorrow, a friend, and a foe. Four be the things I'd been better without: Love, curiosity, freckles, and doubt. Three be the things I shall never attain: Envy, content, and sufficient champagne. Three be the things I shall have till I die: Laughter and hope and a sock in the eye.
Re: Preferences Password module
Author: David Lemson
Date: Wed, 04 Nov 1992 05:15
Date: Wed, 04 Nov 1992 05:15
22 lines
1615 bytes
1615 bytes
matthews@oberon.umd.edu (Mike Matthews) writes: >Has anyone else written a replacement Password changing module for >Preferences (for NeXTstep 2.2 and/or 3.0) that changes the user's NIS >password a la yppasswd instead of their NetInfo password? >Right now I'm thinking of making a module (at least 3.0 has the API) that >does nothing but subprocess out to yppasswd since you can't just say >yppasword userid oldpassword newpassword. [At least, I HOPE you can't.] I hacked up a perl script written by a guy in Norway so that it does this. Then, I hade one of our DevGuys write a shell over it and we made an app. This was in 2.1, so we did not have the API to interface it into Preferences. This is still being used at the company I wrote this for last summer, First National Bank of Chicago. If you want the password daemon/ client combo, I can mail them to you. It works OK. -- David Lemson (217) 244-1205 University of Illinois NeXT Campus Consultant / CCSO NeXT Lab System Admin Internet : lemson@uiuc.edu UUCP :...!uiucuxc!uiucux1!lemson NeXTMail accepted BITNET : LEMSON@UIUCVMD
Re: Preferences Password module
Author: Eric P. Scott
Date: Wed, 04 Nov 1992 07:45
Date: Wed, 04 Nov 1992 07:45
60 lines
2968 bytes
2968 bytes
In article <16657@umd5.umd.edu> matthews@oberon.umd.edu
(Mike Matthews) writes:
>Has anyone else written a replacement Password changing module for
>Preferences (for NeXTstep 2.2 and/or 3.0) that changes the user's NIS
>password a la yppasswd instead of their NetInfo password?
Preferences' Password module already does this.
>Right now I'm thinking of making a module (at least 3.0 has the API) that
>does nothing but subprocess out to yppasswd since you can't just say
>yppasword userid oldpassword newpassword. [At least, I HOPE you can't.]
(1) Subprocesses are bad. Avoid them unless absolutely
necessary. (Especially for something as trivial as this.)
(2) yppasswd simply does a getpwent(getlogin()) to obtain the old
passwd information--it doesn't "specifically" look things up
in NIS. [i.e. if Preferences doesn't do what you want, this
probably won't either.]
(3) There's nothing wrong with the yppasswd(3r) routine, other
than not returning detailed error status if it fails.
(4) It's not that difficult to write a "better" version of
yppasswd():
#include <pwd.h>
#include <rpc/rpc.h>
#include <rpcsvc/ypclnt.h>
#include <rpcsvc/yppasswd.h>
+ use getdomainname() or yp_get_default_domain() to obtain
your NIS domain name
+ yp_master() to find which host serves that domain
+ getrpcport() to verify that the server can be trusted
+ callrpc() with xdr_yppasswd() as inproc and xdr_int() as
outproc
[Note that using lower-level RPC functions would be more
efficient and secure. The code would be somewhat more
complex, and you would need to be reasonably comfortable with
TCP/IP programming using the sockets interface.]
Link with -lrpcsvc
If you're not familiar with ONC/RPC, consider this a valuable
learning opportunity. The usual UNIX Networking resources
(technical books, magazine articles, seminars/tutorials, college
courses, etc.) will help you here. NeXT still provides the man
pages (but you really want to read the "real" documentation
first, which NeXT stopped shipping when 2.0 came out).
Of course, the "real" documentation--along with the source code
and some examples--is widely available on the net (try
ftp.uu.net:~ftp/systems/sun/sextape/rpc4.0/).
It's also included as part of BSD's NET2 release (lib/librpc/).
Or find someone with a SunOS 4.x doc set. It's all the same.
-=EPS=-
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads