G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_AUTH_SESSION, \
GSignondAuthSessionPrivate)
-#define VALIDATE_READ_ACCESS(info, ctx, ret) \
+#define VALIDATE_X_ACCESS(info, ctx, ret) \
{ \
GSignondAccessControlManager *acm = gsignond_get_access_control_manager(); \
GSignondSecurityContextList *acl = gsignond_identity_info_get_access_control_list (info); \
return NULL;
}
- VALIDATE_READ_ACCESS (self->priv->identity_info, ctx, NULL);
+ VALIDATE_X_ACCESS (self->priv->identity_info, ctx, NULL);
gchar **mechanisms, **iter;
const gchar **src_iter;
return FALSE;
}
- VALIDATE_READ_ACCESS (self->priv->identity_info, ctx, FALSE);
+ VALIDATE_X_ACCESS (self->priv->identity_info, ctx, FALSE);
_create_mechanism_cache (self);
if (!g_sequence_lookup (self->priv->available_mechanisms,
if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error");
return FALSE;
}
- VALIDATE_READ_ACCESS (self->priv->identity_info, ctx, FALSE);
+ VALIDATE_X_ACCESS (self->priv->identity_info, ctx, FALSE);
gsignond_plugin_proxy_cancel(self->priv->proxy, self);
g_signal_emit (self, signals[SIG_PROCESS_CANCELED], 0, NULL);
/*
* This file is part of gsignond
*
- * Copyright (C) 2012 - 2013 Intel Corporation.
+ * Copyright (C) 2012 - 2014 Intel Corporation.
*
* Contact: Jussi Laako <jussi.laako@linux.intel.com>
*
GSignondIdentity *identity = NULL;
GSignondIdentityInfo *identity_info = NULL;
-#define VALIDATE_IDENTITY_READ_ACCESS(info, ctx, ret) \
+#define VALIDATE_IDENTITY_X_ACCESS(info, ctx, ret) \
{ \
GSignondAccessControlManager *acm = daemon->priv->acm; \
GSignondSecurityContextList *acl = gsignond_identity_info_get_access_control_list (info); \
if (identity) {
identity_info = gsignond_identity_get_identity_info (identity);
gsignond_identity_info_ref (identity_info);
- VALIDATE_IDENTITY_READ_ACCESS (identity_info, ctx, NULL);
+ VALIDATE_IDENTITY_X_ACCESS (identity_info, ctx, NULL);
DBG ("using cased Identity '%p' for id %d", identity, id);
gsignond_identity_info_unref (identity_info);
return NULL;
}
- VALIDATE_IDENTITY_READ_ACCESS (identity_info, ctx, NULL);
+ VALIDATE_IDENTITY_X_ACCESS (identity_info, ctx, NULL);
identity = gsignond_identity_new (daemon, identity_info);
if (!identity) {
/*
* This file is part of gsignond
*
- * Copyright (C) 2012 Intel Corporation.
+ * Copyright (C) 2012 - 2014 Intel Corporation.
*
* Contact: Jussi Laako <jussi.laako@linux.intel.com>
Amarnath Valluri <amarnath.valluri@linux.intel.com>
#define GSIGNOND_IDENTITY_PRIV(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSIGNOND_TYPE_IDENTITY, GSignondIdentityPrivate)
-#define VALIDATE_IDENTITY_READ_ACCESS(identity, ctx, ret) \
+#define VALIDATE_IDENTITY_X_ACCESS(identity, ctx, ret) \
{ \
GSignondAccessControlManager *acm = gsignond_daemon_get_access_control_manager (identity->priv->owner); \
GSignondSecurityContextList *acl = gsignond_identity_info_get_access_control_list (identity->priv->info); \
} \
}
-#define VALIDATE_IDENTITY_WRITE_ACCESS(identity, ctx, ret) \
+#define VALIDATE_IDENTITY_RW_ACCESS(identity, ctx, ret) \
{ \
GSignondAccessControlManager *acm = gsignond_daemon_get_access_control_manager (identity->priv->owner); \
GSignondSecurityContext *owner = gsignond_identity_info_get_owner (identity->priv->info); \
return NULL;
}
- VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, NULL);
+ VALIDATE_IDENTITY_RW_ACCESS (identity, ctx, NULL);
/* prepare identity info, excluding password and username if secret */
vinfo = gsignond_identity_info_to_variant (identity->priv->info);
guint32 identity_id ;
GSignondDictionary *token_data = NULL;
- VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, NULL);
+ VALIDATE_IDENTITY_X_ACCESS (identity, ctx, NULL);
if (!method) {
WARN ("assertion (method) failed");
return FALSE;
}
- VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, FALSE);
+ VALIDATE_IDENTITY_X_ACCESS (identity, ctx, FALSE);
if (!gsignond_identity_info_get_store_secret (identity->priv->info)) {
if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_CREDENTIALS_NOT_AVAILABLE, "Password can not be stored.");
return FALSE;
}
- VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, FALSE);
+ VALIDATE_IDENTITY_X_ACCESS (identity, ctx, FALSE);
if (!gsignond_identity_info_get_store_secret (identity->priv->info) ||
!(passwd = gsignond_identity_info_get_secret (identity->priv->info)) ||
return FALSE;
}
- VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, FALSE);
+ VALIDATE_IDENTITY_X_ACCESS (identity, ctx, FALSE);
if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Not supported");
gboolean success = FALSE;
guint32 identity_id = GSIGNOND_IDENTITY_INFO_NEW_IDENTITY;
- VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, FALSE);
+ VALIDATE_IDENTITY_X_ACCESS (identity, ctx, FALSE);
identity_id = gsignond_identity_info_get_id (identity->priv->info);
priv = identity->priv;
- VALIDATE_IDENTITY_WRITE_ACCESS (identity, ctx, 0);
+ VALIDATE_IDENTITY_RW_ACCESS (identity, ctx, 0);
was_new_identity = gsignond_identity_info_get_is_identity_new (priv->info);
}
gboolean is_removed = FALSE;
- VALIDATE_IDENTITY_WRITE_ACCESS (identity, ctx, FALSE);
+ VALIDATE_IDENTITY_RW_ACCESS (identity, ctx, FALSE);
is_removed = gsignond_identity_clear (identity);
guint32 res = 0;
guint32 identity_id = 0;
- VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, 0);
+ VALIDATE_IDENTITY_X_ACCESS (identity, ctx, 0);
identity_id = gsignond_identity_info_get_id (identity->priv->info);
if (!identity_id) {
gboolean res = 0;
guint32 identity_id = 0;
- VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, 0);
+ VALIDATE_IDENTITY_X_ACCESS (identity, ctx, 0);
identity_id = gsignond_identity_info_get_id (identity->priv->info);
if (!identity_id) {