Description of problem: When running a remote script the script running as a user does not set all groups that specific user is part of. test and reproducer plan: create a testuser that is also part of the test1000 and test1100 groups #groups testuser testuser: testuser test1000 test1100 create /test1000 and /test1100 give group ownership drwxrwxr-x. 2 root test1000 4096 Apr 21 15:21 test1000 drwxrwxr-x. 2 root test1100 4096 Apr 21 15:21 test1100 now schedule remote script: #!/bin/sh echo "----------------------------------------------" echo " Test script running with..." echo " Effective User " $(id -un) " - " $(id -u) echo " Effective Group " $(id -gn) " - " $(id -g) echo " All groups " $(id -G) echo " " echo " Changing to test1000" cd /test1000 rm -f foo* touch foo-$(date +"%s") echo " Changing to test1100" cd /test1100 rm -f foo* touch foo-$(date +"%s") echo " Test complete." echo "----------------------------------------------" output from script: ---------------------------------------------- Test script running with... Effective User testuser - 500 Effective Group test1000 - 500 All groups 500 0 Changing to test1000 Changing to test1100 touch: cannot touch `foo-1398105014': Permission denied Test complete. ---------------------------------------------- A patch will be submitted and a pull request will be specified in another comment
pull request https://github.com/spacewalkproject/spacewalk/pull/45
results from patch: This action will be executed after 04/21/14 3:21:00 PM EDT. This action's status is: Completed. The client picked up this action on 04/21/14 3:21:46 PM EDT. The client completed this action on 04/21/14 3:21:46 PM EDT. Client execution returned "Script executed" (code 0) Run as: root:root Timeout: 600 seconds #!/bin/sh echo "----------------------------------------------" echo " Test script running with..." echo " Effective User " $(id -un) " - " $(id -u) echo " Effective Group " $(id -gn) " - " $(id -g) echo " All groups " $(id -G) echo " " echo " Changing to test1000" cd /test1000 rm -f foo* touch foo-$(date +"%s") echo " Changing to test1100" cd /test1100 rm -f foo* touch foo-$(date +"%s") echo " Test complete." echo "----------------------------------------------" Start Date: 2014-04-21 15:21:46 End Date: 2014-04-21 15:21:46 Return Code: 0 Raw Output: view/download raw script output Filtered Output: ---------------------------------------------- Test script running with... Effective User root - 0 Effective Group root - 0 All groups 0 Changing to test1000 Changing to test1100 Test complete. ----------------------------------------------
pasted wrong output above, here is the patch run: Start Date: 2014-04-21 20:49:41 End Date: 2014-04-21 20:49:41 Return Code: 0 Raw Output: view/download raw script output Filtered Output: ---------------------------------------------- Test script running with... Effective User testuser - 500 Effective Group test1000 - 500 All groups 500 501 502 Changing to test1000 Changing to test1100 Test complete.
Wow, great reproducer, thanks! Committing to Spacewalk master: 9b2612a1123ba62ed6cbf00f11f2908d7a434a69
Spacewalk 2.2 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes22