2012-01-20 17:49:32 +00:00
|
|
|
/*
|
|
|
|
* viridentity.h: helper APIs for managing user identities
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012-2013 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-06-18 16:13:08 +00:00
|
|
|
#pragma once
|
2012-01-20 17:49:32 +00:00
|
|
|
|
2019-09-19 14:38:03 +00:00
|
|
|
#include "internal.h"
|
|
|
|
#include <glib-object.h>
|
2012-01-20 17:49:32 +00:00
|
|
|
|
2019-09-19 14:38:03 +00:00
|
|
|
#define VIR_TYPE_IDENTITY vir_identity_get_type()
|
|
|
|
G_DECLARE_FINAL_TYPE(virIdentity, vir_identity, VIR, IDENTITY, GObject);
|
2012-01-20 17:49:32 +00:00
|
|
|
|
2019-09-19 14:38:03 +00:00
|
|
|
typedef virIdentity *virIdentityPtr;
|
2019-10-04 16:14:10 +00:00
|
|
|
|
2013-03-06 10:53:47 +00:00
|
|
|
virIdentityPtr virIdentityGetCurrent(void);
|
|
|
|
int virIdentitySetCurrent(virIdentityPtr ident);
|
|
|
|
|
2013-03-06 11:00:16 +00:00
|
|
|
virIdentityPtr virIdentityGetSystem(void);
|
|
|
|
|
2012-01-20 17:49:32 +00:00
|
|
|
virIdentityPtr virIdentityNew(void);
|
|
|
|
|
2019-07-26 10:59:15 +00:00
|
|
|
int virIdentityGetUserName(virIdentityPtr ident,
|
|
|
|
const char **username);
|
2013-08-22 15:43:35 +00:00
|
|
|
int virIdentityGetUNIXUserID(virIdentityPtr ident,
|
|
|
|
uid_t *uid);
|
2019-07-26 10:59:15 +00:00
|
|
|
int virIdentityGetGroupName(virIdentityPtr ident,
|
|
|
|
const char **groupname);
|
2013-08-22 15:43:35 +00:00
|
|
|
int virIdentityGetUNIXGroupID(virIdentityPtr ident,
|
|
|
|
gid_t *gid);
|
2019-07-26 10:59:15 +00:00
|
|
|
int virIdentityGetProcessID(virIdentityPtr ident,
|
|
|
|
pid_t *pid);
|
|
|
|
int virIdentityGetProcessTime(virIdentityPtr ident,
|
|
|
|
unsigned long long *timestamp);
|
2013-08-22 15:43:35 +00:00
|
|
|
int virIdentityGetSASLUserName(virIdentityPtr ident,
|
|
|
|
const char **username);
|
|
|
|
int virIdentityGetX509DName(virIdentityPtr ident,
|
|
|
|
const char **dname);
|
|
|
|
int virIdentityGetSELinuxContext(virIdentityPtr ident,
|
|
|
|
const char **context);
|
|
|
|
|
|
|
|
|
2019-07-26 10:59:15 +00:00
|
|
|
int virIdentitySetUserName(virIdentityPtr ident,
|
|
|
|
const char *username);
|
2013-08-22 15:43:35 +00:00
|
|
|
int virIdentitySetUNIXUserID(virIdentityPtr ident,
|
|
|
|
uid_t uid);
|
2019-07-26 10:59:15 +00:00
|
|
|
int virIdentitySetGroupName(virIdentityPtr ident,
|
|
|
|
const char *groupname);
|
2013-08-22 15:43:35 +00:00
|
|
|
int virIdentitySetUNIXGroupID(virIdentityPtr ident,
|
|
|
|
gid_t gid);
|
2019-07-26 10:59:15 +00:00
|
|
|
int virIdentitySetProcessID(virIdentityPtr ident,
|
|
|
|
pid_t pid);
|
|
|
|
int virIdentitySetProcessTime(virIdentityPtr ident,
|
|
|
|
unsigned long long timestamp);
|
2013-08-22 15:43:35 +00:00
|
|
|
int virIdentitySetSASLUserName(virIdentityPtr ident,
|
|
|
|
const char *username);
|
|
|
|
int virIdentitySetX509DName(virIdentityPtr ident,
|
|
|
|
const char *dname);
|
|
|
|
int virIdentitySetSELinuxContext(virIdentityPtr ident,
|
|
|
|
const char *context);
|
2019-07-26 15:36:29 +00:00
|
|
|
|
|
|
|
int virIdentitySetParameters(virIdentityPtr ident,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams);
|
|
|
|
|
|
|
|
int virIdentityGetParameters(virIdentityPtr ident,
|
|
|
|
virTypedParameterPtr *params,
|
|
|
|
int *nparams);
|