mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-20 11:35:19 +00:00
util: change identity class attribute names
Remove the "UNIX" tag from the names for user name, group name, process ID and process time, since these attributes are all usable for non-UNIX platforms like Windows. User ID and group ID are left with a "UNIX" tag, since there's no equivalent on Windows. The closest equivalent concept on Windows, SID, is a struct containing a number of integer fields, which is commonly represented in string format instead. This would require a separate attribute, and is left for a future exercise, since the daemons are not currently built on Windows anyway. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
305cdc37f0
commit
4597a23f50
@ -88,14 +88,14 @@ virAccessDriverPolkitGetCaller(const char *actionid,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virIdentityGetUNIXProcessID(identity, pid) < 0) {
|
if (virIdentityGetProcessID(identity, pid) < 0) {
|
||||||
virAccessError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virAccessError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("No UNIX process ID available"));
|
_("No process ID available"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virIdentityGetUNIXProcessTime(identity, startTime) < 0) {
|
if (virIdentityGetProcessTime(identity, startTime) < 0) {
|
||||||
virAccessError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virAccessError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("No UNIX process start time available"));
|
_("No process start time available"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virIdentityGetUNIXUserID(identity, uid) < 0) {
|
if (virIdentityGetUNIXUserID(identity, uid) < 0) {
|
||||||
|
@ -262,7 +262,7 @@ adminClientGetInfo(virNetServerClientPtr client,
|
|||||||
VIR_CLIENT_INFO_UNIX_USER_ID, uid) < 0)
|
VIR_CLIENT_INFO_UNIX_USER_ID, uid) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virIdentityGetUNIXUserName(identity, &attr) < 0 ||
|
if (virIdentityGetUserName(identity, &attr) < 0 ||
|
||||||
virTypedParamsAddString(&tmpparams, nparams, &maxparams,
|
virTypedParamsAddString(&tmpparams, nparams, &maxparams,
|
||||||
VIR_CLIENT_INFO_UNIX_USER_NAME,
|
VIR_CLIENT_INFO_UNIX_USER_NAME,
|
||||||
attr) < 0)
|
attr) < 0)
|
||||||
@ -273,13 +273,13 @@ adminClientGetInfo(virNetServerClientPtr client,
|
|||||||
VIR_CLIENT_INFO_UNIX_GROUP_ID, gid) < 0)
|
VIR_CLIENT_INFO_UNIX_GROUP_ID, gid) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virIdentityGetUNIXGroupName(identity, &attr) < 0 ||
|
if (virIdentityGetGroupName(identity, &attr) < 0 ||
|
||||||
virTypedParamsAddString(&tmpparams, nparams, &maxparams,
|
virTypedParamsAddString(&tmpparams, nparams, &maxparams,
|
||||||
VIR_CLIENT_INFO_UNIX_GROUP_NAME,
|
VIR_CLIENT_INFO_UNIX_GROUP_NAME,
|
||||||
attr) < 0)
|
attr) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virIdentityGetUNIXProcessID(identity, &pid) < 0 ||
|
if (virIdentityGetProcessID(identity, &pid) < 0 ||
|
||||||
virTypedParamsAddInt(&tmpparams, nparams, &maxparams,
|
virTypedParamsAddInt(&tmpparams, nparams, &maxparams,
|
||||||
VIR_CLIENT_INFO_UNIX_PROCESS_ID, pid) < 0)
|
VIR_CLIENT_INFO_UNIX_PROCESS_ID, pid) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -2144,28 +2144,28 @@ virHostGetBootTime;
|
|||||||
# util/viridentity.h
|
# util/viridentity.h
|
||||||
virIdentityGetAttr;
|
virIdentityGetAttr;
|
||||||
virIdentityGetCurrent;
|
virIdentityGetCurrent;
|
||||||
|
virIdentityGetGroupName;
|
||||||
|
virIdentityGetProcessID;
|
||||||
|
virIdentityGetProcessTime;
|
||||||
virIdentityGetSASLUserName;
|
virIdentityGetSASLUserName;
|
||||||
virIdentityGetSELinuxContext;
|
virIdentityGetSELinuxContext;
|
||||||
virIdentityGetSystem;
|
virIdentityGetSystem;
|
||||||
virIdentityGetUNIXGroupID;
|
virIdentityGetUNIXGroupID;
|
||||||
virIdentityGetUNIXGroupName;
|
|
||||||
virIdentityGetUNIXProcessID;
|
|
||||||
virIdentityGetUNIXProcessTime;
|
|
||||||
virIdentityGetUNIXUserID;
|
virIdentityGetUNIXUserID;
|
||||||
virIdentityGetUNIXUserName;
|
virIdentityGetUserName;
|
||||||
virIdentityGetX509DName;
|
virIdentityGetX509DName;
|
||||||
virIdentityIsEqual;
|
virIdentityIsEqual;
|
||||||
virIdentityNew;
|
virIdentityNew;
|
||||||
virIdentitySetAttr;
|
virIdentitySetAttr;
|
||||||
virIdentitySetCurrent;
|
virIdentitySetCurrent;
|
||||||
|
virIdentitySetGroupName;
|
||||||
|
virIdentitySetProcessID;
|
||||||
|
virIdentitySetProcessTime;
|
||||||
virIdentitySetSASLUserName;
|
virIdentitySetSASLUserName;
|
||||||
virIdentitySetSELinuxContext;
|
virIdentitySetSELinuxContext;
|
||||||
virIdentitySetUNIXGroupID;
|
virIdentitySetUNIXGroupID;
|
||||||
virIdentitySetUNIXGroupName;
|
|
||||||
virIdentitySetUNIXProcessID;
|
|
||||||
virIdentitySetUNIXProcessTime;
|
|
||||||
virIdentitySetUNIXUserID;
|
virIdentitySetUNIXUserID;
|
||||||
virIdentitySetUNIXUserName;
|
virIdentitySetUserName;
|
||||||
virIdentitySetX509DName;
|
virIdentitySetX509DName;
|
||||||
|
|
||||||
|
|
||||||
|
@ -779,21 +779,21 @@ virNetServerClientCreateIdentity(virNetServerClientPtr client)
|
|||||||
|
|
||||||
if (!(username = virGetUserName(uid)))
|
if (!(username = virGetUserName(uid)))
|
||||||
goto error;
|
goto error;
|
||||||
if (virIdentitySetUNIXUserName(ret, username) < 0)
|
if (virIdentitySetUserName(ret, username) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
if (virIdentitySetUNIXUserID(ret, uid) < 0)
|
if (virIdentitySetUNIXUserID(ret, uid) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!(groupname = virGetGroupName(gid)))
|
if (!(groupname = virGetGroupName(gid)))
|
||||||
goto error;
|
goto error;
|
||||||
if (virIdentitySetUNIXGroupName(ret, groupname) < 0)
|
if (virIdentitySetGroupName(ret, groupname) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
if (virIdentitySetUNIXGroupID(ret, gid) < 0)
|
if (virIdentitySetUNIXGroupID(ret, gid) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virIdentitySetUNIXProcessID(ret, pid) < 0)
|
if (virIdentitySetProcessID(ret, pid) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
if (virIdentitySetUNIXProcessTime(ret, timestamp) < 0)
|
if (virIdentitySetProcessTime(ret, timestamp) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,25 +144,25 @@ virIdentityPtr virIdentityGetSystem(void)
|
|||||||
if (!(ret = virIdentityNew()))
|
if (!(ret = virIdentityNew()))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virIdentitySetUNIXProcessID(ret, getpid()) < 0)
|
if (virIdentitySetProcessID(ret, getpid()) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virProcessGetStartTime(getpid(), &startTime) < 0)
|
if (virProcessGetStartTime(getpid(), &startTime) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
if (startTime != 0 &&
|
if (startTime != 0 &&
|
||||||
virIdentitySetUNIXProcessTime(ret, startTime) < 0)
|
virIdentitySetProcessTime(ret, startTime) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!(username = virGetUserName(geteuid())))
|
if (!(username = virGetUserName(geteuid())))
|
||||||
return ret;
|
return ret;
|
||||||
if (virIdentitySetUNIXUserName(ret, username) < 0)
|
if (virIdentitySetUserName(ret, username) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
if (virIdentitySetUNIXUserID(ret, getuid()) < 0)
|
if (virIdentitySetUNIXUserID(ret, getuid()) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!(groupname = virGetGroupName(getegid())))
|
if (!(groupname = virGetGroupName(getegid())))
|
||||||
return ret;
|
return ret;
|
||||||
if (virIdentitySetUNIXGroupName(ret, groupname) < 0)
|
if (virIdentitySetGroupName(ret, groupname) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
if (virIdentitySetUNIXGroupID(ret, getgid()) < 0)
|
if (virIdentitySetUNIXGroupID(ret, getgid()) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
@ -310,11 +310,11 @@ bool virIdentityIsEqual(virIdentityPtr identA,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int virIdentityGetUNIXUserName(virIdentityPtr ident,
|
int virIdentityGetUserName(virIdentityPtr ident,
|
||||||
const char **username)
|
const char **username)
|
||||||
{
|
{
|
||||||
return virIdentityGetAttr(ident,
|
return virIdentityGetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_NAME,
|
VIR_IDENTITY_ATTR_USER_NAME,
|
||||||
username);
|
username);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,11 +342,11 @@ int virIdentityGetUNIXUserID(virIdentityPtr ident,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int virIdentityGetUNIXGroupName(virIdentityPtr ident,
|
int virIdentityGetGroupName(virIdentityPtr ident,
|
||||||
const char **groupname)
|
const char **groupname)
|
||||||
{
|
{
|
||||||
return virIdentityGetAttr(ident,
|
return virIdentityGetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_GROUP_NAME,
|
VIR_IDENTITY_ATTR_GROUP_NAME,
|
||||||
groupname);
|
groupname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,15 +375,15 @@ int virIdentityGetUNIXGroupID(virIdentityPtr ident,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int virIdentityGetUNIXProcessID(virIdentityPtr ident,
|
int virIdentityGetProcessID(virIdentityPtr ident,
|
||||||
pid_t *pid)
|
pid_t *pid)
|
||||||
{
|
{
|
||||||
unsigned long long val;
|
unsigned long long val;
|
||||||
const char *processid;
|
const char *processid;
|
||||||
|
|
||||||
*pid = 0;
|
*pid = 0;
|
||||||
if (virIdentityGetAttr(ident,
|
if (virIdentityGetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_PROCESS_ID,
|
VIR_IDENTITY_ATTR_PROCESS_ID,
|
||||||
&processid) < 0)
|
&processid) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -399,12 +399,12 @@ int virIdentityGetUNIXProcessID(virIdentityPtr ident,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int virIdentityGetUNIXProcessTime(virIdentityPtr ident,
|
int virIdentityGetProcessTime(virIdentityPtr ident,
|
||||||
unsigned long long *timestamp)
|
unsigned long long *timestamp)
|
||||||
{
|
{
|
||||||
const char *processtime;
|
const char *processtime;
|
||||||
if (virIdentityGetAttr(ident,
|
if (virIdentityGetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_PROCESS_TIME,
|
VIR_IDENTITY_ATTR_PROCESS_TIME,
|
||||||
&processtime) < 0)
|
&processtime) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -445,11 +445,11 @@ int virIdentityGetSELinuxContext(virIdentityPtr ident,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int virIdentitySetUNIXUserName(virIdentityPtr ident,
|
int virIdentitySetUserName(virIdentityPtr ident,
|
||||||
const char *username)
|
const char *username)
|
||||||
{
|
{
|
||||||
return virIdentitySetAttr(ident,
|
return virIdentitySetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_NAME,
|
VIR_IDENTITY_ATTR_USER_NAME,
|
||||||
username);
|
username);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,11 +468,11 @@ int virIdentitySetUNIXUserID(virIdentityPtr ident,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int virIdentitySetUNIXGroupName(virIdentityPtr ident,
|
int virIdentitySetGroupName(virIdentityPtr ident,
|
||||||
const char *groupname)
|
const char *groupname)
|
||||||
{
|
{
|
||||||
return virIdentitySetAttr(ident,
|
return virIdentitySetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_GROUP_NAME,
|
VIR_IDENTITY_ATTR_GROUP_NAME,
|
||||||
groupname);
|
groupname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -491,8 +491,8 @@ int virIdentitySetUNIXGroupID(virIdentityPtr ident,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int virIdentitySetUNIXProcessID(virIdentityPtr ident,
|
int virIdentitySetProcessID(virIdentityPtr ident,
|
||||||
pid_t pid)
|
pid_t pid)
|
||||||
{
|
{
|
||||||
VIR_AUTOFREE(char *) val = NULL;
|
VIR_AUTOFREE(char *) val = NULL;
|
||||||
|
|
||||||
@ -500,13 +500,13 @@ int virIdentitySetUNIXProcessID(virIdentityPtr ident,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return virIdentitySetAttr(ident,
|
return virIdentitySetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_PROCESS_ID,
|
VIR_IDENTITY_ATTR_PROCESS_ID,
|
||||||
val);
|
val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int virIdentitySetUNIXProcessTime(virIdentityPtr ident,
|
int virIdentitySetProcessTime(virIdentityPtr ident,
|
||||||
unsigned long long timestamp)
|
unsigned long long timestamp)
|
||||||
{
|
{
|
||||||
VIR_AUTOFREE(char *) val = NULL;
|
VIR_AUTOFREE(char *) val = NULL;
|
||||||
|
|
||||||
@ -514,7 +514,7 @@ int virIdentitySetUNIXProcessTime(virIdentityPtr ident,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return virIdentitySetAttr(ident,
|
return virIdentitySetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_PROCESS_TIME,
|
VIR_IDENTITY_ATTR_PROCESS_TIME,
|
||||||
val);
|
val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,12 +27,12 @@ typedef struct _virIdentity virIdentity;
|
|||||||
typedef virIdentity *virIdentityPtr;
|
typedef virIdentity *virIdentityPtr;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_NAME,
|
VIR_IDENTITY_ATTR_USER_NAME,
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_ID,
|
VIR_IDENTITY_ATTR_UNIX_USER_ID,
|
||||||
VIR_IDENTITY_ATTR_UNIX_GROUP_NAME,
|
VIR_IDENTITY_ATTR_GROUP_NAME,
|
||||||
VIR_IDENTITY_ATTR_UNIX_GROUP_ID,
|
VIR_IDENTITY_ATTR_UNIX_GROUP_ID,
|
||||||
VIR_IDENTITY_ATTR_UNIX_PROCESS_ID,
|
VIR_IDENTITY_ATTR_PROCESS_ID,
|
||||||
VIR_IDENTITY_ATTR_UNIX_PROCESS_TIME,
|
VIR_IDENTITY_ATTR_PROCESS_TIME,
|
||||||
VIR_IDENTITY_ATTR_SASL_USER_NAME,
|
VIR_IDENTITY_ATTR_SASL_USER_NAME,
|
||||||
VIR_IDENTITY_ATTR_X509_DISTINGUISHED_NAME,
|
VIR_IDENTITY_ATTR_X509_DISTINGUISHED_NAME,
|
||||||
VIR_IDENTITY_ATTR_SELINUX_CONTEXT,
|
VIR_IDENTITY_ATTR_SELINUX_CONTEXT,
|
||||||
@ -64,18 +64,18 @@ bool virIdentityIsEqual(virIdentityPtr identA,
|
|||||||
ATTRIBUTE_NONNULL(1)
|
ATTRIBUTE_NONNULL(1)
|
||||||
ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
int virIdentityGetUNIXUserName(virIdentityPtr ident,
|
int virIdentityGetUserName(virIdentityPtr ident,
|
||||||
const char **username);
|
const char **username);
|
||||||
int virIdentityGetUNIXUserID(virIdentityPtr ident,
|
int virIdentityGetUNIXUserID(virIdentityPtr ident,
|
||||||
uid_t *uid);
|
uid_t *uid);
|
||||||
int virIdentityGetUNIXGroupName(virIdentityPtr ident,
|
int virIdentityGetGroupName(virIdentityPtr ident,
|
||||||
const char **groupname);
|
const char **groupname);
|
||||||
int virIdentityGetUNIXGroupID(virIdentityPtr ident,
|
int virIdentityGetUNIXGroupID(virIdentityPtr ident,
|
||||||
gid_t *gid);
|
gid_t *gid);
|
||||||
int virIdentityGetUNIXProcessID(virIdentityPtr ident,
|
int virIdentityGetProcessID(virIdentityPtr ident,
|
||||||
pid_t *pid);
|
pid_t *pid);
|
||||||
int virIdentityGetUNIXProcessTime(virIdentityPtr ident,
|
int virIdentityGetProcessTime(virIdentityPtr ident,
|
||||||
unsigned long long *timestamp);
|
unsigned long long *timestamp);
|
||||||
int virIdentityGetSASLUserName(virIdentityPtr ident,
|
int virIdentityGetSASLUserName(virIdentityPtr ident,
|
||||||
const char **username);
|
const char **username);
|
||||||
int virIdentityGetX509DName(virIdentityPtr ident,
|
int virIdentityGetX509DName(virIdentityPtr ident,
|
||||||
@ -84,18 +84,18 @@ int virIdentityGetSELinuxContext(virIdentityPtr ident,
|
|||||||
const char **context);
|
const char **context);
|
||||||
|
|
||||||
|
|
||||||
int virIdentitySetUNIXUserName(virIdentityPtr ident,
|
int virIdentitySetUserName(virIdentityPtr ident,
|
||||||
const char *username);
|
const char *username);
|
||||||
int virIdentitySetUNIXUserID(virIdentityPtr ident,
|
int virIdentitySetUNIXUserID(virIdentityPtr ident,
|
||||||
uid_t uid);
|
uid_t uid);
|
||||||
int virIdentitySetUNIXGroupName(virIdentityPtr ident,
|
int virIdentitySetGroupName(virIdentityPtr ident,
|
||||||
const char *groupname);
|
const char *groupname);
|
||||||
int virIdentitySetUNIXGroupID(virIdentityPtr ident,
|
int virIdentitySetUNIXGroupID(virIdentityPtr ident,
|
||||||
gid_t gid);
|
gid_t gid);
|
||||||
int virIdentitySetUNIXProcessID(virIdentityPtr ident,
|
int virIdentitySetProcessID(virIdentityPtr ident,
|
||||||
pid_t pid);
|
pid_t pid);
|
||||||
int virIdentitySetUNIXProcessTime(virIdentityPtr ident,
|
int virIdentitySetProcessTime(virIdentityPtr ident,
|
||||||
unsigned long long timestamp);
|
unsigned long long timestamp);
|
||||||
int virIdentitySetSASLUserName(virIdentityPtr ident,
|
int virIdentitySetSASLUserName(virIdentityPtr ident,
|
||||||
const char *username);
|
const char *username);
|
||||||
int virIdentitySetX509DName(virIdentityPtr ident,
|
int virIdentitySetX509DName(virIdentityPtr ident,
|
||||||
|
@ -46,12 +46,12 @@ static int testIdentityAttrs(const void *data ATTRIBUTE_UNUSED)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virIdentitySetAttr(ident,
|
if (virIdentitySetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_NAME,
|
VIR_IDENTITY_ATTR_USER_NAME,
|
||||||
"fred") < 0)
|
"fred") < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virIdentityGetAttr(ident,
|
if (virIdentityGetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_NAME,
|
VIR_IDENTITY_ATTR_USER_NAME,
|
||||||
&val) < 0)
|
&val) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ static int testIdentityAttrs(const void *data ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virIdentityGetAttr(ident,
|
if (virIdentityGetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_GROUP_NAME,
|
VIR_IDENTITY_ATTR_GROUP_NAME,
|
||||||
&val) < 0)
|
&val) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -71,14 +71,14 @@ static int testIdentityAttrs(const void *data ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virIdentitySetAttr(ident,
|
if (virIdentitySetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_NAME,
|
VIR_IDENTITY_ATTR_USER_NAME,
|
||||||
"joe") != -1) {
|
"joe") != -1) {
|
||||||
VIR_DEBUG("Unexpectedly overwrote attribute");
|
VIR_DEBUG("Unexpectedly overwrote attribute");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virIdentityGetAttr(ident,
|
if (virIdentityGetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_NAME,
|
VIR_IDENTITY_ATTR_USER_NAME,
|
||||||
&val) < 0)
|
&val) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ static int testIdentityEqual(const void *data ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virIdentitySetAttr(identa,
|
if (virIdentitySetAttr(identa,
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_NAME,
|
VIR_IDENTITY_ATTR_USER_NAME,
|
||||||
"fred") < 0)
|
"fred") < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ static int testIdentityEqual(const void *data ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virIdentitySetAttr(identb,
|
if (virIdentitySetAttr(identb,
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_NAME,
|
VIR_IDENTITY_ATTR_USER_NAME,
|
||||||
"fred") < 0)
|
"fred") < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -131,11 +131,11 @@ static int testIdentityEqual(const void *data ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virIdentitySetAttr(identa,
|
if (virIdentitySetAttr(identa,
|
||||||
VIR_IDENTITY_ATTR_UNIX_GROUP_NAME,
|
VIR_IDENTITY_ATTR_GROUP_NAME,
|
||||||
"flintstone") < 0)
|
"flintstone") < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
if (virIdentitySetAttr(identb,
|
if (virIdentitySetAttr(identb,
|
||||||
VIR_IDENTITY_ATTR_UNIX_GROUP_NAME,
|
VIR_IDENTITY_ATTR_GROUP_NAME,
|
||||||
"flintstone") < 0)
|
"flintstone") < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ static int testIdentity(const void *opaque ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virIdentityGetAttr(ident,
|
if (virIdentityGetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_USER_NAME,
|
VIR_IDENTITY_ATTR_USER_NAME,
|
||||||
&gotUsername) < 0) {
|
&gotUsername) < 0) {
|
||||||
fprintf(stderr, "Missing username in identity\n");
|
fprintf(stderr, "Missing username in identity\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -110,7 +110,7 @@ static int testIdentity(const void *opaque ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virIdentityGetAttr(ident,
|
if (virIdentityGetAttr(ident,
|
||||||
VIR_IDENTITY_ATTR_UNIX_GROUP_NAME,
|
VIR_IDENTITY_ATTR_GROUP_NAME,
|
||||||
&gotGroupname) < 0) {
|
&gotGroupname) < 0) {
|
||||||
fprintf(stderr, "Missing groupname in identity\n");
|
fprintf(stderr, "Missing groupname in identity\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user