Re: Perl module for managing user groups (UNIX)
- From: Tim Greer <tim@xxxxxxxxxxxxx>
- Date: Mon, 01 Dec 2008 11:36:04 -0800
J.D. Baldwin wrote:
In the previous article, Tim Greer <tim@xxxxxxxxxxxxx> wrote:
What OS are you using, specifically? There are likely commands that
will do all of the error checking, file locking, etc. for you (i.e.,
usermod, groupmod, etc.)
While platform-independence is a nice-to-have objective for the longer
term, all the hosts in the system in question are Solaris 8/9/10 at
the moment.
What I do now involves usermod -- but you can't just tell usermod "add
this guy to this group." You have to say "Assign this guy to
secondary membership of all these groups." As a result, I have to
collect all the existing groups, figure out which ones are
secondaries, error-check the request, then execute the comment. That
error-checking is the most involved step by far; there are a lot of
ways to malform a request. Then we have the case of asking to delete
a user's primary group, which of course involves picking one of the
secondary groups to assign in its place ... and so on and so forth.
It's not that I can't do this, it's just that I'd rather not write 500
lines of code if someone has module-ized the tasks.
Got ya. I can't see the earlier articles in this thread, as my news
reader is configured to drop articles which I've already read after 30
days has passed (that is intentional), so could you (re)post the
relevant code you have now, if you have any? Pardon me if you've
already posted it. Sorry, I don't personally know of an existing
module for this, but there could be one. I'm sure there are some
existing solutions out there posted, which could probably be modified
if they aren't exactly what you need now... but your own code might be
close enough now for that task, too.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
.
- Follow-Ups:
- Re: Perl module for managing user groups (UNIX)
- From: J.D. Baldwin
- Re: Perl module for managing user groups (UNIX)
- References:
- Re: Perl module for managing user groups (UNIX)
- From: J.D. Baldwin
- Re: Perl module for managing user groups (UNIX)
- Prev by Date: Re: FAQ 9.4 How do I remove HTML from a string?
- Next by Date: Re: Perl module for managing user groups (UNIX)
- Previous by thread: Re: Perl module for managing user groups (UNIX)
- Next by thread: Re: Perl module for managing user groups (UNIX)
- Index(es):
Relevant Pages
|