]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/acfilter.sh
check for overflows
[openldap] / tests / scripts / acfilter.sh
index 7e3659e568860de28ba98a82108cbd1a03ae69c3..00ea8933175e4184b5278f18f8d58d9deb7c832b 100755 (executable)
@@ -1,6 +1,22 @@
 #! /bin/sh
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2008 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
 #
-# Strip operational attributes
+# Strip comments, sort attributes. Requires GNU awk
 #
-egrep -iv '^modifiersname:|^modifytimestamp:|^creatorsname:|^createtimestamp'
+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