Commit Diff


commit - ff260661299dea92ad32c7d92d4e206bac21fb1b
commit + ead7040796132aa6410e20b81613404232634d8c
blob - be6e907b0b228adb916c00a7d370b73d769dd8ed
blob + 3d2d7b038e39e28938dbdfc3407293b2035dc52b
--- regress/gotd/Makefile
+++ regress/gotd/Makefile
@@ -1,4 +1,5 @@
-REGRESS_TARGETS=test_repo_read test_repo_read_group test_repo_read_bad_group \
+REGRESS_TARGETS=test_repo_read test_repo_read_group \
+	test_repo_read_bad_user test_repo_read_bad_group \
 	test_repo_write test_repo_write_empty
 NOOBJ=Yes
 
@@ -58,6 +59,18 @@ start_gotd_ro_group: ensure_root
 	@$(GOTD_TRAP); $(GOTD_START_CMD)
 	@$(GOTD_TRAP); sleep .5
 
+# $GOTD_DEVUSER should not equal $GOTD_USER
+start_gotd_ro_bad_user: ensure_root
+	@echo 'unix_socket "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
+	@echo "unix_group $(GOTD_GROUP)" >> $(PWD)/gotd.conf
+	@echo "user $(GOTD_USER)" >> $(PWD)/gotd.conf
+	@echo 'repository "test-repo" {' >> $(PWD)/gotd.conf
+	@echo '    path "$(GOTD_TEST_REPO)"' >> $(PWD)/gotd.conf
+	@echo '    permit ro $(GOTD_USER)' >> $(PWD)/gotd.conf
+	@echo "}" >> $(PWD)/gotd.conf
+	@$(GOTD_TRAP); $(GOTD_START_CMD)
+	@$(GOTD_TRAP); sleep .5
+
 # $GOTD_DEVUSER should not be in group wheel
 start_gotd_ro_bad_group: ensure_root
 	@echo 'unix_socket "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
@@ -70,7 +83,6 @@ start_gotd_ro_bad_group: ensure_root
 	@$(GOTD_TRAP); $(GOTD_START_CMD)
 	@$(GOTD_TRAP); sleep .5
 
-
 start_gotd_rw: ensure_root
 	@echo 'unix_socket "$(GOTD_SOCK)"' > $(PWD)/gotd.conf
 	@echo "unix_group $(GOTD_GROUP)" >> $(PWD)/gotd.conf
@@ -102,6 +114,12 @@ test_repo_read_group: prepare_test_repo start_gotd_ro_
 	@$(GOTD_STOP_CMD) 2>/dev/null
 	@su -m ${GOTD_USER} -c 'env $(GOTD_TEST_ENV) sh ./check_test_repo.sh'
 
+test_repo_read_bad_user: prepare_test_repo start_gotd_ro_bad_user
+	@-$(GOTD_TRAP); su ${GOTD_TEST_USER} -c \
+		'env $(GOTD_TEST_ENV) sh ./repo_read_access_denied.sh'
+	@$(GOTD_STOP_CMD) 2>/dev/null
+	@su -m ${GOTD_USER} -c 'env $(GOTD_TEST_ENV) sh ./check_test_repo.sh'
+
 test_repo_read_bad_group: prepare_test_repo start_gotd_ro_bad_group
 	@-$(GOTD_TRAP); su ${GOTD_TEST_USER} -c \
 		'env $(GOTD_TEST_ENV) sh ./repo_read_access_denied.sh'