[ANNOUNCE] Samba 4.0 beta4
steve at steve-ss.com
Wed Jul 18 01:59:25 MDT 2012
On 18/07/12 01:37, Andrew Bartlett wrote:
> On Tue, 2012-07-17 at 15:21 +0200, Marc Muehlfeld wrote:
>> And one more questions about posix attributes:
>> Is there a way to get automatically free UIDs assigned and filled into the
>> attribute fields or do I always have to do this by myself (find a free UID and
>> assign it) when I create users?
> This we have been discussing in some of the other threads. In short,
> distributed ID assignment is hard, so far we only have this for the RID.
> The schema provides for a store of a 'next' value, but it is not
> multi-master replication safe, but is used as a default next UID/GID
> value when adding users with the GUI.
> Andrew Bartlett
We get the next available uidNumber by:
# get the next free uidNumber
getent passwd | cut -d ":" -f3 | sort -n > /tmp/uid.txt
maxnum=$(sort -n /tmp/uid.txt |tail -1)
uid=$(expr $maxnum + 1)
echo "Next available uidNumber = $uid"
It's worked for 100 users and a few groups so far without any collisions.
The main problem is that gidNumber does not get pulled from the
directory for us at the moment. So we have a different range of
gidNumber. E.g. group RID+20000 works for groups and makes it all
readable. E.g. a uidNumber is 3000241, a gidNumber is 21108. Easily
Please tell me how wrong this is.
More information about the samba-technical