]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/acfilter.sh
check for overflows
[openldap] / tests / scripts / acfilter.sh
index 9df3765ec0a55f94f50936fdc40f62a6d141ed5f..00ea8933175e4184b5278f18f8d58d9deb7c832b 100755 (executable)
 ## 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