Bug 1089729 - script.py does not set multiple groups for running user
Summary: script.py does not set multiple groups for running user
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 2.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space22 space23
TreeView+ depends on / blocked
 
Reported: 2014-04-21 19:50 UTC by Shannon Hughes
Modified: 2015-04-14 19:17 UTC (History)
2 users (show)

Fixed In Version: rhncfg-5.10.68-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1089730 (view as bug list)
Environment:
Last Closed: 2014-07-17 08:41:35 UTC
Embargoed:


Attachments (Terms of Use)

Description Shannon Hughes 2014-04-21 19:50:29 UTC
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

Comment 1 Shannon Hughes 2014-04-21 20:09:30 UTC
pull request 

https://github.com/spacewalkproject/spacewalk/pull/45

Comment 2 Shannon Hughes 2014-04-21 20:10:20 UTC
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.
----------------------------------------------

Comment 3 Shannon Hughes 2014-04-21 20:50:48 UTC
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.

Comment 4 Stephen Herr 2014-04-24 18:59:14 UTC
Wow, great reproducer, thanks!

Committing to Spacewalk master:
9b2612a1123ba62ed6cbf00f11f2908d7a434a69

Comment 5 Milan Zázrivec 2014-07-17 08:41:35 UTC
Spacewalk 2.2 has been released:

    https://fedorahosted.org/spacewalk/wiki/ReleaseNotes22


Note You need to log in before you can comment on or make changes to this bug.