Bug#609148: ldapscripts: Bad autoenerated User ID, when machine account exists
Ahoj, Dňa Tue, 11 Jan 2011 10:37:22 +0300 Alexander GQ Gerasiov g...@cs.msu.su napísal: Hi. Thanks for report. Could you provide patch in diff format? I don't use ldapscripts for machine accounting so it would be better if you create and test one yourself. i am sorry for delay. diff attached, as created directly by quilt. It works for me, but maybe more testing is needed. regards -- Slavko http://slavino.sk Description: Fix the lastuser and lastmachine UID LDAP searches Author: Slavko li...@slavino.sk --- a/lib/runtime +++ b/lib/runtime @@ -479,7 +479,7 @@ # Input : nothing # Output : the last machine id used + 1 (so the first useable machine id) ($_UID) _findlastmachine () { - _UID=`_ldapsearch $SUFFIX '(objectClass=posixAccount)' uidNumber | grep uidNumber: | sed s|uidNumber: || | uniq | sort -n | tail -n 1` + _UID=`_ldapsearch $MSUFFIX,$SUFFIX '(objectClass=posixAccount)' uidNumber | grep uidNumber: | sed s|uidNumber: || | uniq | sort -n | tail -n 1` if [ -z $_UID ] || [ ! $_UID -gt $MIDSTART ] then _UID=$MIDSTART @@ -491,7 +491,7 @@ # Input : nothing # Output : the last user id used + 1 (so the first useable user id) ($_UID) _findlastuser () { - _UID=`_ldapsearch $SUFFIX '(objectClass=posixAccount)' uidNumber | grep uidNumber: | sed s|uidNumber: || | uniq | sort -n | tail -n 1` + _UID=`_ldapsearch $USUFFIX,$SUFFIX '(objectClass=posixAccount)' uidNumber | grep uidNumber: | sed s|uidNumber: || | uniq | sort -n | tail -n 1` if [ -z $_UID ] || [ ! $_UID -gt $UIDSTART ] then _UID=$UIDSTART signature.asc Description: PGP signature
Bug#609148: ldapscripts: Bad autoenerated User ID, when machine account exists
Thu, 6 Jan 2011 20:55:54 +0100 Slavko li...@slavino.sk wrote: Package: ldapscripts Version: 1.9.0-2 Severity: normal Tags: patch By default the User IDs starts at 1 and machine IDs starts at 2. When no machine account exists, all works as expected and new users get last used User ID + 1. But when a machine account is created, this gets the Machine ID 2 and next created user gets the User ID 20001 (last used Machine ID + 1), because there is no difference between searches last used User ID and Machine ID in runtime file. Simple adding $USUFFIX to _ldapsearch parameter, in _findlastuser() is enough to solve this. But IMHO adding $MSUFFIX to _findlastmachine() is good idea too. Both added in the same manner as in _findlastgroup() is $GSUFFIX. Hi. Thanks for report. Could you provide patch in diff format? I don't use ldapscripts for machine accounting so it would be better if you create and test one yourself. -- Best regards, Alexander GQ Gerasiov Contacts: e-mail:g...@cs.msu.su Jabber: g...@jabber.ru Homepage: http://gq.net.ru ICQ: 7272757 PGP fingerprint: 04B5 9D90 DF7C C2AB CD49 BAEA CA87 E9E8 2AAC 33F1 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#609148: ldapscripts: Bad autoenerated User ID, when machine account exists
Package: ldapscripts Version: 1.9.0-2 Severity: normal Tags: patch By default the User IDs starts at 1 and machine IDs starts at 2. When no machine account exists, all works as expected and new users get last used User ID + 1. But when a machine account is created, this gets the Machine ID 2 and next created user gets the User ID 20001 (last used Machine ID + 1), because there is no difference between searches last used User ID and Machine ID in runtime file. Simple adding $USUFFIX to _ldapsearch parameter, in _findlastuser() is enough to solve this. But IMHO adding $MSUFFIX to _findlastmachine() is good idea too. Both added in the same manner as in _findlastgroup() is $GSUFFIX. -- System Information: Packages ldapscripts not on tis machine regards Slavko -- Slavko http://slavino.sk signature.asc Description: PGP signature