| Chunky Bacon sighting |
[Mar. 29th, 2005|06:46 am] |
I was reading Beth Skwarecki's blog, casually perusing some pictures she posted from her latest FSF meeting, when I noticed something interesting. Take a look at this picture. Left side of the picture, on the blackboard, next to the word "Firefox". See anything familiar?
For those who don't get the joke, go read the Poignant Guide to Ruby. |
|
|
| Valor, meet Discretion |
[Mar. 29th, 2005|06:52 am] |
I've been working on methods for adding, configuring, and deleting users and groups as part of the Admin package. This is fairly trivial on the Win32 platform, where the Win32 API is kind enough to provide me with some handy methods for performing such operations.
Unix, on the other hand, is very unfriendly in this regard. The only functions I could find to help me were putpwent() and putspent(), and these are "discouraged" because it's a multi-step process to add a passwd entry, and it only works for local entries (i.e. no NIS). You have to open the file, lock the, write the entry to the passwd file, write the entry to the shadow file, unlock the passwd file, and then close the file. This is to say nothing of handling password encryption, or figuring out if and where shadow password files exist on other platforms. Oh, and there are no methods for configuring or deleting users or groups.
So, I have two choices. The first is to write my own functions for adding, deleting and configuring users. Ick. That could take a while, and would require lots of thorough testing. I don't want to mess up someone's passwd file, you know. The second choice, and the one I'm heavily leaning towards now, is to simply use a system call, e.g. system("useradd -blah blah").
I'll have to see just how "standard" the options to useradd, etc, are across different flavors of Unix, though. |
|
|