The branch, master has been updated via 91d8bc7ac2b gitlab-ci: Update Fedora to version 36 via 00e31d9d069 lib:util: Do not error for array-bounds warning via f2eb411646b gitlab-ci: Use openSUSE 15.3 for coverity via e8938c56679 s3:tests: Reformat test_local_s3.sh via 32ca178ecc8 s3:tests: Reformat test_libwbclient_threads.sh via 15a0ae9ee7a s3:tests: Reformat test_large_acl.sh via 39cdbec04d1 s3:tests: Reformat test_inherit_owner.sh via 4cc48c8d5bb s3:tests: Reformat test_homes.sh via e9079b356ad s3:tests: Reformat test_guest_auth.sh via db882106399 s3:tests: Reformat test_groupmap.sh via 268ae191477 s3:tests: Reformat test_give_owner.sh from 637e7cbdbab lzxpress: compress shortcut if we've reached maximum length
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 91d8bc7ac2b9482b29039278ae091f74332f1945 Author: Andreas Schneider <a...@samba.org> Date: Tue May 17 10:08:35 2022 +0200 gitlab-ci: Update Fedora to version 36 Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org> Autobuild-Date(master): Wed May 18 07:56:52 UTC 2022 on sn-devel-184 commit 00e31d9d069db9fd36bf2e668047921a5645351d Author: Andreas Schneider <a...@samba.org> Date: Tue May 17 12:43:51 2022 +0200 lib:util: Do not error for array-bounds warning This just prints a warning for: ms_fnmatch.c:95:51: error: array subscript 0 is outside array bounds of ‘struct max_n[0]’ [-Werror=array-bounds] 95 | if (max_n != NULL && max_n->predot && | Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit f2eb411646bbc3cbedd4aecaba98bd363a6cd3df Author: Andreas Schneider <a...@samba.org> Date: Tue May 17 10:03:41 2022 +0200 gitlab-ci: Use openSUSE 15.3 for coverity It provides gcc 10.3 and MIT krb5 1.19. The current coverity version only supports gcc up to 11.1. Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit e8938c566795c88cbe1d70e6d9ed0b9b19f0f9d2 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:09 2022 +0200 s3:tests: Reformat test_local_s3.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit 32ca178ecc8cb1bfd911a9c996a36c449461b92f Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:09 2022 +0200 s3:tests: Reformat test_libwbclient_threads.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit 15a0ae9ee7ad3db6d309450c69c8a6a1710a7bc1 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:09 2022 +0200 s3:tests: Reformat test_large_acl.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit 39cdbec04d1c1261f01892c105558faacab684f1 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:09 2022 +0200 s3:tests: Reformat test_inherit_owner.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit 4cc48c8d5bbf3f90ae6b16c2bc3d6485fc242898 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:09 2022 +0200 s3:tests: Reformat test_homes.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit e9079b356ad655c23ea0791c9cdc24ba0101976a Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:09 2022 +0200 s3:tests: Reformat test_guest_auth.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit db882106399103e0653e2d01cfc09e9ca531b891 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:09 2022 +0200 s3:tests: Reformat test_groupmap.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> commit 268ae191477a8d6a5081dd86644e7858a971ac2d Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:09 2022 +0200 s3:tests: Reformat test_give_owner.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> Reviewed-by: Alexander Bokovoy <a...@samba.org> ----------------------------------------------------------------------- Summary of changes: .gitlab-ci-main.yml | 24 +-- bootstrap/.gitlab-ci.yml | 4 +- bootstrap/config.py | 12 +- bootstrap/generated-dists/Vagrantfile | 20 +-- .../{fedora35 => f36mit120}/Dockerfile | 2 +- .../{f35mit120 => f36mit120}/bootstrap.sh | 0 .../{f35mit120 => f36mit120}/locale.sh | 0 .../{f35mit120 => f36mit120}/packages.yml | 0 .../{f35mit120 => fedora36}/Dockerfile | 2 +- .../{fedora35 => fedora36}/bootstrap.sh | 0 .../{fedora35 => fedora36}/locale.sh | 0 .../{fedora35 => fedora36}/packages.yml | 0 bootstrap/sha1sum.txt | 2 +- lib/util/wscript_build | 1 + source3/script/tests/test_give_owner.sh | 192 +++++++++++---------- source3/script/tests/test_groupmap.sh | 181 +++++++++---------- source3/script/tests/test_guest_auth.sh | 109 ++++++------ source3/script/tests/test_homes.sh | 164 +++++++++--------- source3/script/tests/test_inherit_owner.sh | 184 ++++++++++---------- source3/script/tests/test_large_acl.sh | 32 ++-- source3/script/tests/test_libwbclient_threads.sh | 8 +- source3/script/tests/test_local_s3.sh | 26 +-- 22 files changed, 492 insertions(+), 471 deletions(-) rename bootstrap/generated-dists/{fedora35 => f36mit120}/Dockerfile (93%) rename bootstrap/generated-dists/{f35mit120 => f36mit120}/bootstrap.sh (100%) rename bootstrap/generated-dists/{f35mit120 => f36mit120}/locale.sh (100%) rename bootstrap/generated-dists/{f35mit120 => f36mit120}/packages.yml (100%) rename bootstrap/generated-dists/{f35mit120 => fedora36}/Dockerfile (93%) rename bootstrap/generated-dists/{fedora35 => fedora36}/bootstrap.sh (100%) rename bootstrap/generated-dists/{fedora35 => fedora36}/locale.sh (100%) rename bootstrap/generated-dists/{fedora35 => fedora36}/packages.yml (100%) Changeset truncated at 500 lines: diff --git a/.gitlab-ci-main.yml b/.gitlab-ci-main.yml index 95ca23475e6..02b22b1571f 100644 --- a/.gitlab-ci-main.yml +++ b/.gitlab-ci-main.yml @@ -42,7 +42,7 @@ variables: # Set this to the contents of bootstrap/sha1sum.txt # which is generated by bootstrap/template.py --render # - SAMBA_CI_CONTAINER_TAG: a4bf899c9709c67254c5bb3964e3dce6bb2e4d1e + SAMBA_CI_CONTAINER_TAG: a6e30c371ba434b89af5628bd1974e5cc947eb9f # # We use the ubuntu1804 image as default as # it matches what we have on sn-devel-184. @@ -57,8 +57,8 @@ variables: SAMBA_CI_CONTAINER_IMAGE_ubuntu2004: ubuntu2004 SAMBA_CI_CONTAINER_IMAGE_debian11: debian11 SAMBA_CI_CONTAINER_IMAGE_opensuse153: opensuse153 - SAMBA_CI_CONTAINER_IMAGE_fedora35: fedora35 - SAMBA_CI_CONTAINER_IMAGE_f35mit120: f35mit120 + SAMBA_CI_CONTAINER_IMAGE_fedora36: fedora36 + SAMBA_CI_CONTAINER_IMAGE_f36mit120: f36mit120 SAMBA_CI_CONTAINER_IMAGE_centos7: centos7 SAMBA_CI_CONTAINER_IMAGE_centos8s: centos8s @@ -255,20 +255,20 @@ samba-def-build: samba-mit-build: extends: .shared_template_build_only variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora35} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora36} stage: build_first samba-mit120-build: extends: .shared_template_build_only variables: AUTOBUILD_JOB_NAME: samba-mit-build - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_f35mit120} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_f36mit120} stage: build_first .needs_samba-mit-build: extends: .shared_template_test_only variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora35} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora36} needs: - job: samba-mit-build artifacts: true @@ -276,7 +276,7 @@ samba-mit120-build: .needs_samba-mit120-build: extends: .shared_template_test_only variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_f35mit120} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_f36mit120} needs: - job: samba-mit120-build artifacts: true @@ -323,7 +323,7 @@ samba: samba-mitkrb5: extends: .shared_template variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora35} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora36} samba-minimal-smbd: extends: .shared_template @@ -392,7 +392,7 @@ samba-addc-mit-4b: samba-fips: extends: .shared_template variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora35} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora36} .private_test_only: extends: .private_runner_test @@ -533,7 +533,7 @@ pages: coverity: extends: .shared_runner_build_image variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_ubuntu2004} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_opensuse153} stage: build script: - wget https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=$COVERITY_SCAN_PROJECT_NAME" -O /tmp/coverity_tool.tgz @@ -634,10 +634,10 @@ centos8s-samba-o3: variables: SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_centos8s} -fedora35-samba-o3: +fedora36-samba-o3: extends: .samba-o3-template variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora35} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora36} # # Keep the samba-o3 sections at the end ... diff --git a/bootstrap/.gitlab-ci.yml b/bootstrap/.gitlab-ci.yml index 57979463aa1..111be1556ff 100644 --- a/bootstrap/.gitlab-ci.yml +++ b/bootstrap/.gitlab-ci.yml @@ -97,10 +97,10 @@ ubuntu2004: debian11: extends: .build_image_template -fedora35: +fedora36: extends: .build_image_template -f35mit120: +f36mit120: extends: .build_image_template centos8s: diff --git a/bootstrap/config.py b/bootstrap/config.py index 6b3f97d4fd0..59d93b14686 100644 --- a/bootstrap/config.py +++ b/bootstrap/config.py @@ -488,9 +488,9 @@ RPM_DISTS = { 'mold': '', } }, - 'fedora35': { - 'docker_image': 'fedora:35', - 'vagrant_box': 'fedora/35-cloud-base', + 'fedora36': { + 'docker_image': 'fedora:36', + 'vagrant_box': 'fedora/36-cloud-base', 'bootstrap': DNF_BOOTSTRAP, 'replace': { 'lsb-release': 'redhat-lsb', @@ -499,9 +499,9 @@ RPM_DISTS = { 'libtracker-sparql-2.0-dev': '', # only tracker 3.x is available } }, - 'f35mit120': { - 'docker_image': 'fedora:35', - 'vagrant_box': 'fedora/35-cloud-base', + 'f36mit120': { + 'docker_image': 'fedora:36', + 'vagrant_box': 'fedora/36-cloud-base', 'bootstrap': DNF_BOOTSTRAP_MIT, 'replace': { 'lsb-release': 'redhat-lsb', diff --git a/bootstrap/generated-dists/Vagrantfile b/bootstrap/generated-dists/Vagrantfile index 88afbaafb01..9b1b3f154d7 100644 --- a/bootstrap/generated-dists/Vagrantfile +++ b/bootstrap/generated-dists/Vagrantfile @@ -31,18 +31,18 @@ Vagrant.configure("2") do |config| v.vm.provision :shell, path: "debian11/locale.sh" end - config.vm.define "f35mit120" do |v| - v.vm.box = "fedora/35-cloud-base" - v.vm.hostname = "f35mit120" - v.vm.provision :shell, path: "f35mit120/bootstrap.sh" - v.vm.provision :shell, path: "f35mit120/locale.sh" + config.vm.define "f36mit120" do |v| + v.vm.box = "fedora/36-cloud-base" + v.vm.hostname = "f36mit120" + v.vm.provision :shell, path: "f36mit120/bootstrap.sh" + v.vm.provision :shell, path: "f36mit120/locale.sh" end - config.vm.define "fedora35" do |v| - v.vm.box = "fedora/35-cloud-base" - v.vm.hostname = "fedora35" - v.vm.provision :shell, path: "fedora35/bootstrap.sh" - v.vm.provision :shell, path: "fedora35/locale.sh" + config.vm.define "fedora36" do |v| + v.vm.box = "fedora/36-cloud-base" + v.vm.hostname = "fedora36" + v.vm.provision :shell, path: "fedora36/bootstrap.sh" + v.vm.provision :shell, path: "fedora36/locale.sh" end config.vm.define "opensuse153" do |v| diff --git a/bootstrap/generated-dists/fedora35/Dockerfile b/bootstrap/generated-dists/f36mit120/Dockerfile similarity index 93% rename from bootstrap/generated-dists/fedora35/Dockerfile rename to bootstrap/generated-dists/f36mit120/Dockerfile index e66eb84d9f3..8a4ecb6f97e 100644 --- a/bootstrap/generated-dists/fedora35/Dockerfile +++ b/bootstrap/generated-dists/f36mit120/Dockerfile @@ -3,7 +3,7 @@ # See also bootstrap/config.py # -FROM fedora:35 +FROM fedora:36 # pass in with --build-arg while build ARG SHA1SUM diff --git a/bootstrap/generated-dists/f35mit120/bootstrap.sh b/bootstrap/generated-dists/f36mit120/bootstrap.sh similarity index 100% rename from bootstrap/generated-dists/f35mit120/bootstrap.sh rename to bootstrap/generated-dists/f36mit120/bootstrap.sh diff --git a/bootstrap/generated-dists/f35mit120/locale.sh b/bootstrap/generated-dists/f36mit120/locale.sh similarity index 100% rename from bootstrap/generated-dists/f35mit120/locale.sh rename to bootstrap/generated-dists/f36mit120/locale.sh diff --git a/bootstrap/generated-dists/f35mit120/packages.yml b/bootstrap/generated-dists/f36mit120/packages.yml similarity index 100% rename from bootstrap/generated-dists/f35mit120/packages.yml rename to bootstrap/generated-dists/f36mit120/packages.yml diff --git a/bootstrap/generated-dists/f35mit120/Dockerfile b/bootstrap/generated-dists/fedora36/Dockerfile similarity index 93% rename from bootstrap/generated-dists/f35mit120/Dockerfile rename to bootstrap/generated-dists/fedora36/Dockerfile index e66eb84d9f3..8a4ecb6f97e 100644 --- a/bootstrap/generated-dists/f35mit120/Dockerfile +++ b/bootstrap/generated-dists/fedora36/Dockerfile @@ -3,7 +3,7 @@ # See also bootstrap/config.py # -FROM fedora:35 +FROM fedora:36 # pass in with --build-arg while build ARG SHA1SUM diff --git a/bootstrap/generated-dists/fedora35/bootstrap.sh b/bootstrap/generated-dists/fedora36/bootstrap.sh similarity index 100% rename from bootstrap/generated-dists/fedora35/bootstrap.sh rename to bootstrap/generated-dists/fedora36/bootstrap.sh diff --git a/bootstrap/generated-dists/fedora35/locale.sh b/bootstrap/generated-dists/fedora36/locale.sh similarity index 100% rename from bootstrap/generated-dists/fedora35/locale.sh rename to bootstrap/generated-dists/fedora36/locale.sh diff --git a/bootstrap/generated-dists/fedora35/packages.yml b/bootstrap/generated-dists/fedora36/packages.yml similarity index 100% rename from bootstrap/generated-dists/fedora35/packages.yml rename to bootstrap/generated-dists/fedora36/packages.yml diff --git a/bootstrap/sha1sum.txt b/bootstrap/sha1sum.txt index d0359be9b54..9c3a115d95f 100644 --- a/bootstrap/sha1sum.txt +++ b/bootstrap/sha1sum.txt @@ -1 +1 @@ -a4bf899c9709c67254c5bb3964e3dce6bb2e4d1e +a6e30c371ba434b89af5628bd1974e5cc947eb9f diff --git a/lib/util/wscript_build b/lib/util/wscript_build index 2f31e8fa5b1..08a551038c8 100644 --- a/lib/util/wscript_build +++ b/lib/util/wscript_build @@ -210,6 +210,7 @@ else: tfork.h ''', header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ], + cflags='-Wno-error=array-bounds', local_include=False, vnum='0.0.1', pc_files='samba-util.pc' diff --git a/source3/script/tests/test_give_owner.sh b/source3/script/tests/test_give_owner.sh index 7ee37341b42..9d0091884a9 100755 --- a/source3/script/tests/test_give_owner.sh +++ b/source3/script/tests/test_give_owner.sh @@ -5,8 +5,8 @@ # if [ $# -lt 9 ]; then - echo "Usage: $0 SERVER SERVER_IP USERNAME PASSWORD PREFIX SMBCLIENT SMBCACLS NET SHARE" - exit 1 + echo "Usage: $0 SERVER SERVER_IP USERNAME PASSWORD PREFIX SMBCLIENT SMBCACLS NET SHARE" + exit 1 fi SERVER="$1" @@ -24,118 +24,124 @@ SMBCACLS="$VALGRIND ${SMBCACLS}" NET="$VALGRIND ${NET}" failed=0 -incdir=`dirname $0`/../../../testprogs/blackbox +incdir=$(dirname $0)/../../../testprogs/blackbox . $incdir/subunit.sh -setup_testfile() { - local share=$1 - local fname=$2 - touch $PREFIX/$fname - $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "rm $fname" - $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "ls" | grep "$fname" && return 1 - $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "lcd $PREFIX; put $fname" || return 1 +setup_testfile() +{ + local share=$1 + local fname=$2 + touch $PREFIX/$fname + $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "rm $fname" + $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "ls" | grep "$fname" && return 1 + $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "lcd $PREFIX; put $fname" || return 1 } -remove_testfile() { - local share=$1 - local fname=$2 - $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "rm $fname" +remove_testfile() +{ + local share=$1 + local fname=$2 + $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "rm $fname" } -set_win_owner() { - local share=$1 - local fname=$2 - local owner=$3 - echo "$SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -C '$owner'" - $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -C "$owner" || return 1 +set_win_owner() +{ + local share=$1 + local fname=$2 + local owner=$3 + echo "$SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -C '$owner'" + $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -C "$owner" || return 1 } -win_owner_is() { - local share=$1 - local fname=$2 - local expected_owner=$3 - local actual_owner - - echo "$SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD" - $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD - actual_owner=$($SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD | sed -rn 's/^OWNER:(.*)/\1/p') - echo "actual_owner = $actual_owner" - if ! test "x$actual_owner" = "x$expected_owner" ; then - echo "Actual owner of $share/$fname is [$actual_owner] expected [$expected_owner]" - return 1 - fi - return 0 +win_owner_is() +{ + local share=$1 + local fname=$2 + local expected_owner=$3 + local actual_owner + + echo "$SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD" + $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD + actual_owner=$($SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD | sed -rn 's/^OWNER:(.*)/\1/p') + echo "actual_owner = $actual_owner" + if ! test "x$actual_owner" = "x$expected_owner"; then + echo "Actual owner of $share/$fname is [$actual_owner] expected [$expected_owner]" + return 1 + fi + return 0 } -add_ace() { - local share=$1 - local fname=$2 - local ace=$3 - - local_ace=$(printf '%s' "$ace" | sed 's|\\|/|') - - # avoid duplicate - out=$($SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD) - if [ $? -ne 0 ] ; then - echo "get acl failed" - echo "$out" - return 1 - fi - echo "Original ACL" - echo $out - echo "$out" | grep "$local_ace" && return 0 - - # add it - $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -a "$ace" - if [ $? -ne 0 ] ; then - echo "add acl failed" - return 1 - fi - - # check it's there - out=$($SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD) - if [ $? -ne 0 ] ; then - echo "get new acl failed" - echo "$out" - return 1 - fi - echo "New ACL" - echo $out - echo "Checking if new ACL has \"$local_ace\"" - echo "$out" | grep "$local_ace" || return 1 - echo "ok" +add_ace() +{ + local share=$1 + local fname=$2 + local ace=$3 + + local_ace=$(printf '%s' "$ace" | sed 's|\\|/|') + + # avoid duplicate + out=$($SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD) + if [ $? -ne 0 ]; then + echo "get acl failed" + echo "$out" + return 1 + fi + echo "Original ACL" + echo $out + echo "$out" | grep "$local_ace" && return 0 + + # add it + $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -a "$ace" + if [ $? -ne 0 ]; then + echo "add acl failed" + return 1 + fi + + # check it's there + out=$($SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD) + if [ $? -ne 0 ]; then + echo "get new acl failed" + echo "$out" + return 1 + fi + echo "New ACL" + echo $out + echo "Checking if new ACL has \"$local_ace\"" + echo "$out" | grep "$local_ace" || return 1 + echo "ok" } -chown_give_fails() { - local share=$1 - local fname=$2 - local user=$3 - local expected_error=$4 - - # this must fail - out=$($SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -C "$user") && return 1 - # it failed, now check it returned the expected error code - echo "$out" | grep $expected_error || return 1 +chown_give_fails() +{ + local share=$1 + local fname=$2 + local user=$3 + local expected_error=$4 + + # this must fail + out=$($SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -C "$user") && return 1 + # it failed, now check it returned the expected error code + echo "$out" | grep $expected_error || return 1 } # Create a testfile -testit "create testfile" setup_testfile $SHARE afile || failed=`expr $failed + 1` -testit "verify owner" win_owner_is $SHARE afile "$SERVER/$USERNAME" || failed=`expr $failed + 1` +testit "create testfile" setup_testfile $SHARE afile || failed=$(expr $failed + 1) +testit "verify owner" win_owner_is $SHARE afile "$SERVER/$USERNAME" || failed=$(expr $failed + 1) # Grant SeRestorePrivilege to the user and full rights on the file -testit "grant SeRestorePrivilege" $NET rpc rights grant $USERNAME SeRestorePrivilege -U $USERNAME%$PASSWORD -I $SERVER_IP || failed=`expr $failed + 1` -testit "grant full rights" add_ace $SHARE afile "ACL:$SERVER\\$USERNAME:ALLOWED/0x0/FULL" || failed=`expr $failed + 1` +testit "grant SeRestorePrivilege" $NET rpc rights grant $USERNAME SeRestorePrivilege -U $USERNAME%$PASSWORD -I $SERVER_IP || failed=$(expr $failed + 1) +testit "grant full rights" add_ace $SHARE afile "ACL:$SERVER\\$USERNAME:ALLOWED/0x0/FULL" || failed=$(expr $failed + 1) # We have SeRestorePrivilege, so both give and take ownership must succeed -testit "give owner with SeRestorePrivilege" set_win_owner $SHARE afile "$SERVER\user1" || failed=`expr $failed + 1` -testit "verify owner" win_owner_is $SHARE afile "$SERVER/user1" || failed=`expr $failed + 1` -testit "take owner" set_win_owner $SHARE afile "$SERVER\\$USERNAME" || failed=`expr $failed + 1` -testit "verify owner" win_owner_is $SHARE afile "$SERVER/$USERNAME" || failed=`expr $failed + 1` +testit "give owner with SeRestorePrivilege" set_win_owner $SHARE afile "$SERVER\user1" || failed=$(expr $failed + 1) +testit "verify owner" win_owner_is $SHARE afile "$SERVER/user1" || failed=$(expr $failed + 1) +testit "take owner" set_win_owner $SHARE afile "$SERVER\\$USERNAME" || failed=$(expr $failed + 1) +testit "verify owner" win_owner_is $SHARE afile "$SERVER/$USERNAME" || failed=$(expr $failed + 1) # Revoke SeRestorePrivilege, give ownership must fail now with NT_STATUS_INVALID_OWNER -testit "revoke SeRestorePrivilege" $NET rpc rights revoke $USERNAME SeRestorePrivilege -U $USERNAME%$PASSWORD -I $SERVER_IP || failed=`expr $failed + 1` -testit "give owner without SeRestorePrivilege" chown_give_fails $SHARE afile "$SERVER\user1" NT_STATUS_INVALID_OWNER || failed=`expr $failed + 1` +testit "revoke SeRestorePrivilege" $NET rpc rights revoke $USERNAME SeRestorePrivilege -U $USERNAME%$PASSWORD -I $SERVER_IP || failed=$(expr $failed + 1) +testit "give owner without SeRestorePrivilege" chown_give_fails $SHARE afile "$SERVER\user1" NT_STATUS_INVALID_OWNER || failed=$(expr $failed + 1) -testit "delete testfile" remove_testfile $SHARE afile || failed=`expr $failed + 1` +testit "delete testfile" remove_testfile $SHARE afile || failed=$(expr $failed + 1) exit $failed diff --git a/source3/script/tests/test_groupmap.sh b/source3/script/tests/test_groupmap.sh index 46640a91312..a1e9a0832df 100755 --- a/source3/script/tests/test_groupmap.sh +++ b/source3/script/tests/test_groupmap.sh @@ -3,19 +3,22 @@ # note that this needs root access to add unix groups, # so this cannot be run on the build farm -testone() { - echo $* - $VALGRIND bin/net groupmap $* +testone() +{ + echo $* + $VALGRIND bin/net groupmap $* } -- Samba Shared Repository