diff options
author | Volker Lendecke <vl@samba.org> | 2017-04-04 14:15:26 +0200 |
---|---|---|
committer | Christof Schmitt <cs@samba.org> | 2017-05-08 21:08:23 +0200 |
commit | 1893bb9bc48d9251820a185c95c65562f2878074 (patch) | |
tree | a21ff76d656deb0c96b4012ece5ef0673e96c138 | |
parent | 9e816ea2f8d21d392b4e9050e443ef936629202e (diff) | |
download | samba-1893bb9bc48d9251820a185c95c65562f2878074.tar.gz |
test_idmap_rfc2307: Avoid a tmpfile
We can << directly into ldbadd
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12757
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
-rwxr-xr-x | nsswitch/tests/test_idmap_rfc2307.sh | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/nsswitch/tests/test_idmap_rfc2307.sh b/nsswitch/tests/test_idmap_rfc2307.sh index a125f77e0c5..b5f8ce573be 100755 --- a/nsswitch/tests/test_idmap_rfc2307.sh +++ b/nsswitch/tests/test_idmap_rfc2307.sh @@ -45,14 +45,14 @@ $VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "$LDA # Add id mapping information to LDAP -cat > $PREFIX/tmpldb <<EOF +testit "add ldap prefix" $VALGRIND $ldbadd -H ldap://$DC_SERVER \ + -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD <<EOF dn: $LDAPPREFIX objectclass: organizationalUnit EOF -testit "add ldap prefix" $VALGRIND $ldbadd -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD $PREFIX/tmpldb - -cat > $PREFIX/tmpldb <<EOF +testit "add ldap user mapping record" $VALGRIND $ldbadd -H ldap://$DC_SERVER \ + -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD <<EOF dn: cn=$USERNAME,$LDAPPREFIX objectClass: organizationalPerson objectClass: posixAccount @@ -64,9 +64,8 @@ gidNumber: 1 homeDirectory: /home/admin EOF -testit "add ldap user mapping record" $VALGRIND $ldbadd -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD $PREFIX/tmpldb - -cat > $PREFIX/tmpldb <<EOF +testit "add second ldap user mapping record" $VALGRIND $ldbadd \ + -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD <<EOF dn: cn=$USERNAME2,$LDAPPREFIX objectClass: organizationalPerson objectClass: posixAccount @@ -78,9 +77,8 @@ gidNumber: 2 homeDirectory: /home/admin EOF -testit "add second ldap user mapping record" $VALGRIND $ldbadd -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD $PREFIX/tmpldb - -cat > $PREFIX/tmpldb <<EOF +testit "add ldap group mapping record" $VALGRIND $ldbadd \ + -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD <<EOF dn: cn=$GROUPNAME,$LDAPPREFIX objectClass: posixGroup objectClass: groupOfNames @@ -89,9 +87,8 @@ gidNumber: $GROUPGID member: cn=$USERNAME,$LDAPPREFIX EOF -testit "add ldap group mapping record" $VALGRIND $ldbadd -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD $PREFIX/tmpldb - -cat > $PREFIX/tmpldb <<EOF +testit "add second ldap group mapping record" $VALGRIND $ldbadd \ + -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD <<EOF dn: cn=$GROUPNAME2,$LDAPPREFIX objectClass: posixGroup objectClass: groupOfNames @@ -100,10 +97,6 @@ gidNumber: $GROUPGID2 member: cn=$USERNAME,$LDAPPREFIX EOF -testit "add second ldap group mapping record" $VALGRIND $ldbadd -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD $PREFIX/tmpldb - -rm -f $PREFIX/tmpldb - testit "wbinfo --name-to-sid" $wbinfo --name-to-sid "$DOMAIN/$USERNAME" || failed=$(expr $failed + 1) user_sid=$($wbinfo -n "$DOMAIN/$USERNAME" | cut -d " " -f1) echo "$DOMAIN/$USERNAME resolved to $user_sid" |