]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/acfilter.sh
check for overflows
[openldap] / tests / scripts / acfilter.sh
index 2d6023842e9795bd02dd7eee64a826f099d8709a..00ea8933175e4184b5278f18f8d58d9deb7c832b 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2005 The OpenLDAP Foundation.
+## Copyright 1998-2008 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
 ## top-level directory of the distribution or, alternatively, at
 ## <http://www.OpenLDAP.org/license.html>.
 #
-# Strip comments
+# Strip comments, sort attributes. Requires GNU awk
 #
+if [ "$BACKEND" != ndb ]; then
 grep -v '^#'
+else
+grep -v '^#'| awk 'BEGIN{FS="\n";RS=""} {j=0; for (i=1; i<=NF; i++){ if ($i ~ /^ /){ x[j] = x[j] "\n" $i; } else { j++; x[j] = $i } } print x[1]; delete x[1]; j=asort(x); for (i=1; i<=j; i++){ print x[i]; } delete x; print "" }'
+fi