Ahoj,

Dňa Tue, 11 Jan 2011 10:37:22 +0300 Alexander GQ Gerasiov
<[email protected]> 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 <[email protected]>
--- 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"

Attachment: signature.asc
Description: PGP signature

Reply via email to