]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: fix acl_xattr test: grep ouput before munging
authorRalph Boehme <slow@samba.org>
Sun, 8 Oct 2017 09:16:27 +0000 (11:16 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 9 Oct 2017 21:01:17 +0000 (23:01 +0200)
The check of the smbclient getfacl output for presence of a "^# group:"
line must be done before munging the saved output with a sed filter.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=7933

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/script/tests/test_acl_xattr.sh

index bc3326cf91908e77837d556a2bc7a165a9746eee..463969363fba34585aa4ac271fff393f6d5b55d7 100755 (executable)
@@ -109,8 +109,8 @@ nt_affects_chgrp() {
     test "$b4_expected" != "$af_expected" || exit 1
 
     b4_actual=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
-    b4_actual=$(echo "$b4_actual" | sed -rn 's/^# group: (.*)/\1/p')
     echo "${b4_actual}" | grep -q "^# group:" || exit 1
+    b4_actual=$(echo "$b4_actual" | sed -rn 's/^# group: (.*)/\1/p')
     $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -G domadmins 2>/dev/null || exit 1
     af_actual=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
     echo "${af_actual}" | grep -q "^# group:" || exit 1