Merge "drop_privileges should also set HOME"

This commit is contained in:
Jenkins
2012年12月04日 20:08:29 +00:00
committed by Gerrit Code Review

View File

@@ -756,6 +756,7 @@ def drop_privileges(user):
os.setgroups([])
os.setgid(user[3])
os.setuid(user[2])
os.environ['HOME'] = user[5]
try:
os.setsid()
except OSError:

View File

@@ -632,6 +632,8 @@ log_name = %(yarr)s'''
utils.drop_privileges(user)
for func in required_func_calls:
self.assert_(utils.os.called_funcs[func])
import pwd
self.assertEquals(pwd.getpwnam(user)[5], utils.os.environ['HOME'])
# reset; test same args, OSError trying to get session leader
utils.os = MockOs(called_funcs=required_func_calls,
Reference in New Issue
openstack/swift
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.