From nobody Thu May 15 12:01:50 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507577757166577.9550307752277; Mon, 9 Oct 2017 12:35:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E466C7E446; Mon, 9 Oct 2017 19:35:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4027179FD; Mon, 9 Oct 2017 19:35:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 80E8418355C9; Mon, 9 Oct 2017 19:35:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v99JFF9d008170 for ; Mon, 9 Oct 2017 15:15:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id EBFF36246C; Mon, 9 Oct 2017 19:15:15 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E462762468 for ; Mon, 9 Oct 2017 19:15:12 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0EBF5C0587E9 for ; Mon, 9 Oct 2017 19:15:11 +0000 (UTC) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v99JD36x036147 for ; Mon, 9 Oct 2017 15:15:10 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dgb0ewgn2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Oct 2017 15:15:10 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Oct 2017 20:15:08 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 9 Oct 2017 20:15:05 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v99JF5Mf13303836; Mon, 9 Oct 2017 19:15:05 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 28D6F11C050; Mon, 9 Oct 2017 20:10:41 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 03A3911C04A; Mon, 9 Oct 2017 20:10:41 +0100 (BST) Received: from marc-ibm.boeblingen.de.ibm.com (unknown [9.152.224.184]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 9 Oct 2017 20:10:40 +0100 (BST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E466C7E446 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E466C7E446 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0EBF5C0587E9 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=mhartmay@linux.vnet.ibm.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0EBF5C0587E9 From: Marc Hartmayer To: Libvirt Mailing List Date: Mon, 9 Oct 2017 21:14:55 +0200 In-Reply-To: <20171009191458.17685-1-mhartmay@linux.vnet.ibm.com> References: <20171009191458.17685-1-mhartmay@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17100919-0016-0000-0000-000004F408D6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17100919-0017-0000-0000-0000282F0952 Message-Id: <20171009191458.17685-2-mhartmay@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-09_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710090278 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 205 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 09 Oct 2017 19:15:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 09 Oct 2017 19:15:11 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'mhartmay@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: -3.5 (RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= , Marc Hartmayer Subject: [libvirt] [RFC PATCH 1/4] util: Add virCommandGetGID and virCommandGetUID X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 09 Oct 2017 19:35:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" These functions are used by an upcoming commit. Signed-off-by: Marc Hartmayer Reviewed-by: Boris Fiuczynski --- src/libvirt_private.syms | 2 ++ src/util/vircommand.c | 14 ++++++++++++++ src/util/vircommand.h | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 9243c5591042..26c5ddb40505 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1506,6 +1506,8 @@ virCommandDaemonize; virCommandDoAsyncIO; virCommandExec; virCommandFree; +virCommandGetGID; +virCommandGetUID; virCommandHandshakeNotify; virCommandHandshakeWait; virCommandNew; diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 60c1121dafea..fba73ca18eac 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -1073,6 +1073,20 @@ virCommandSetPidFile(virCommandPtr cmd, const char *= pidfile) } =20 =20 +gid_t +virCommandGetGID(virCommandPtr cmd) +{ + return cmd->gid; +} + + +uid_t +virCommandGetUID(virCommandPtr cmd) +{ + return cmd->uid; +} + + void virCommandSetGID(virCommandPtr cmd, gid_t gid) { diff --git a/src/util/vircommand.h b/src/util/vircommand.h index e7c2e513bae1..b401d7b238d7 100644 --- a/src/util/vircommand.h +++ b/src/util/vircommand.h @@ -68,6 +68,10 @@ int virCommandPassFDGetFDIndex(virCommandPtr cmd, void virCommandSetPidFile(virCommandPtr cmd, const char *pidfile) ATTRIBUTE_NONNULL(2); =20 +gid_t virCommandGetGID(virCommandPtr cmd) ATTRIBUTE_NONNULL(1); + +uid_t virCommandGetUID(virCommandPtr cmd) ATTRIBUTE_NONNULL(1); + void virCommandSetGID(virCommandPtr cmd, gid_t gid); =20 void virCommandSetUID(virCommandPtr cmd, uid_t uid); --=20 2.5.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list