]> err.no Git - dak/commitdiff
daklib/utils.py: lookup gid for group.
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 16 Sep 2012 16:35:54 +0000 (18:35 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 16 Sep 2012 16:35:54 +0000 (18:35 +0200)
daklib/utils.py

index 8a160356f721f0ded72533d5dfed40207fb41c77..03cd589463c5e81908529c8d8ed17927d6082abc 100755 (executable)
@@ -27,6 +27,7 @@ import datetime
 import email.Header
 import os
 import pwd
+import grp
 import select
 import socket
 import shutil
@@ -1468,7 +1469,8 @@ def temp_filename(directory=None, prefix="dak", suffix="", mode=None, group=None
     if mode:
         os.chmod(tfname, mode)
     if group:
-        os.chown(tfname, -1, group)
+        gid = grp.getgrnam(group).gr_gid
+        os.chown(tfname, -1, gid)
     return (tfd, tfname)
 
 ################################################################################