1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-24 13:57:43 +03:00

test_smbclient_s3.sh: Use correct separator in "list with backup privilege" test

Samba selftest uses the forward slash as winbind separator and in the
USERNAME passed to the test. "net sam rights" expect the backslash. Map
the separator used in selftest to a backslash to avoid creating an
incorrect username DOMAIN\DOMAIN/USERNAME.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13312

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 6f07afad07d9c670a00d9d314a8134efdda5e424)
This commit is contained in:
Christof Schmitt 2018-03-16 13:52:14 -07:00 committed by Karolin Seeger
parent 7abe54b57f
commit d2799ab5e4

View File

@ -643,13 +643,17 @@ test_backup_privilege_list()
{
tmpfile=$PREFIX/smbclient_backup_privilege_list
# selftest uses the forward slash as a separator, but "net sam rights
# grant" requires the backslash separator
USER_TMP=$(printf '%s' "$USERNAME" | tr '/' '\\')
# If we don't have a DOMAIN component to the username, add it.
echo "$USERNAME" | grep '\\' 2>&1
printf '%s' "$USER_TMP" | grep '\\' 2>&1
ret=$?
if [ $ret != 0 ] ; then
priv_username="$DOMAIN\\$USERNAME"
priv_username="$DOMAIN\\$USER_TMP"
else
priv_username=$USERNAME
priv_username="$USER_TMP"
fi
$NET sam rights grant $priv_username SeBackupPrivilege 2>&1