util: Add virCommandGetGID and virCommandGetUID

These functions are used by an upcoming commit.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
This commit is contained in:
Marc Hartmayer 2017-10-09 21:14:55 +02:00 committed by Daniel P. Berrange
parent 9020c7d7e4
commit 2e88eeebb1
3 changed files with 20 additions and 0 deletions

View File

@ -1506,6 +1506,8 @@ virCommandDaemonize;
virCommandDoAsyncIO;
virCommandExec;
virCommandFree;
virCommandGetGID;
virCommandGetUID;
virCommandHandshakeNotify;
virCommandHandshakeWait;
virCommandNew;

View File

@ -1073,6 +1073,20 @@ virCommandSetPidFile(virCommandPtr cmd, const char *pidfile)
}
gid_t
virCommandGetGID(virCommandPtr cmd)
{
return cmd->gid;
}
uid_t
virCommandGetUID(virCommandPtr cmd)
{
return cmd->uid;
}
void
virCommandSetGID(virCommandPtr cmd, gid_t gid)
{

View File

@ -68,6 +68,10 @@ int virCommandPassFDGetFDIndex(virCommandPtr cmd,
void virCommandSetPidFile(virCommandPtr cmd,
const char *pidfile) ATTRIBUTE_NONNULL(2);
gid_t virCommandGetGID(virCommandPtr cmd) ATTRIBUTE_NONNULL(1);
uid_t virCommandGetUID(virCommandPtr cmd) ATTRIBUTE_NONNULL(1);
void virCommandSetGID(virCommandPtr cmd, gid_t gid);
void virCommandSetUID(virCommandPtr cmd, uid_t uid);