From: Ansgar Burchardt Date: Sun, 16 Sep 2012 16:35:54 +0000 (+0200) Subject: daklib/utils.py: lookup gid for group. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=922bd52cf4fc88bdb802ff7f3f26beeca1f171c5;p=dak daklib/utils.py: lookup gid for group. --- diff --git a/daklib/utils.py b/daklib/utils.py index 8a160356..03cd5894 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -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) ################################################################################