From 57aaa870c6b59c29d57bb1984dcbd9927728c1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bahad=C4=B1r=20Kandemir?= Date: Thu, 13 Oct 2005 19:32:23 +0000 Subject: [PATCH] =?UTF-8?q?UID,=20pwd.getpwnam()=20ile=20al=C4=B1n=C4=B1r;?= =?UTF-8?q?=20GID=20ise=20grp.getgrnam()=20ile.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/actionsapi/shelltools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pisi/actionsapi/shelltools.py b/pisi/actionsapi/shelltools.py index b52368a5..1a7c3104 100644 --- a/pisi/actionsapi/shelltools.py +++ b/pisi/actionsapi/shelltools.py @@ -15,6 +15,7 @@ import os import glob import shutil import pwd +import grp import gettext __trans = gettext.translation('pisi', fallback=True) @@ -69,7 +70,7 @@ def chown(sourceFile, uid = "root", gid = "root"): '''change the owner and group id of sourceFile to uid and gid''' if can_access_file(sourceFile): try: - os.chown(sourceFile, pwd.getpwnam(uid)[2], pwd.getpwnam(gid)[3]) + os.chown(sourceFile, pwd.getpwnam(uid)[2], grp.getgrnam(gid)[2]) except OSError: ctx.ui.error(_(' ActionsAPI [chown]: Operation not permitted: %s (uid: %s, gid: %s)') \ % (sourceFile, uid, gid))