From: Christof Schmitt Date: Fri, 16 Mar 2018 20:52:14 +0000 (-0700) Subject: test_smbclient_s3.sh: Use correct separator in "list with backup privilege" test X-Git-Tag: ldb-1.4.0~682 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f07afad07d9c670a00d9d314a8134efdda5e424;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andreas Schneider --- diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 03f7b276d91..cc0d69dfb6e 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -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