Re: Slightly OT: check creation of a group

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Mon, Mar 1, 2010 at 11:08 AM, Laurent Wandrebeck
<l.wandrebeck@xxxxxxxxx> wrote:

>> Niki
> Why don't you use groupadd -f ? It will not override the group if it
> already exists, and shortens the code :)
>

That gets my vote :)

I have seen code that creates a temp file then does a chgrp on the
file. If it fails then the group is created. If not, the existing
group was used. This was done to get around some differences between
SunOS and Linux and unknown state of LDAP/local auth.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux