Permalink
Browse files

Covers a corner case where getgroups() did not return any groups.

git-svn-id: svn://cherokee-project.com/cherokee/trunk@6364 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
alobbs committed Feb 24, 2011
1 parent fa0a50c commit 84d418dbc0337be0de5380f26a33f3159b6ab1f1
Showing with 5 additions and 1 deletion.
  1. +5 −1 admin/market/CommandProgress.py
@@ -72,7 +72,11 @@ def __init__ (self):
root_group = InstallUtil.get_installation_GID()
# Server user (www-data, server, nobody, etc)
- groups = os.getgroups()
+ #
+ # Unusual case: getgroups() might return []. We try to cover
+ # the corner case by assuming a safety value of [0] (because
+ # we haven't any other better option, actually).
+ groups = os.getgroups() or [0]
groups.sort()
server_user = CTK.cfg.get_val ('server!user', str(os.getuid()))

0 comments on commit 84d418d

Please sign in to comment.