/***************************************************************************
*
* libpolkit-rbac.c : RBAC implementation of the libpolkit API
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Licensed under the Academic Free License version 2.1
*
**************************************************************************/
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>
#include <auth_attr.h>
#include <secdb.h>
#include <glib.h>
#include <dbus/dbus-glib.h>
#include "libpolkit.h"
#ifdef __SUNPRO_C
#endif
do { \
g_warning ("%s: given LibPolKitContext is NULL", \
__FUNCTION__); \
return _ret_; \
} \
g_warning ("%s: given LibPolKitContext is invalid (read magic 0x%08x, should be 0x%08x)", \
return _ret_; \
} \
} while(0)
struct LibPolKitContext_s
{
};
/** Get a new context.
*
* @return Pointer to new context or NULL if an error occured
*/
{
return ctx;
}
/** Free a context
*
* @param ctx The context obtained from libpolkit_new_context
* @return Pointer to new context or NULL if an error occured
*/
{
return TRUE;
}
const char *user,
const char *privilege,
int *num_non_temporary)
{
char **resource_list;
int num_resources;
char **restriction_list;
int num_restrictions;
*restrictions = NULL;
return res;
}
const char *system_bus_unique_name,
const char *user,
const char *privilege,
const char *resource,
{
char *authname;
int i;
*out_is_allowed = FALSE;
return LIBPOLKIT_RESULT_NO_SUCH_USER;
}
/* map PolicyKit privilege to RBAC authorization */
authname = "solaris.device.mount.removable";
authname = "solaris.device.mount.alloptions.removable";
authname = "solaris.device.mount.fixed";
authname = "solaris.device.mount.alloptions.fixed";
authname = "solaris.system.power.suspend.ram";
authname = "solaris.system.power.suspend.disk";
authname = "solaris.system.shutdown";
authname = "solaris.system.power.cpu";
authname = "solaris.system.power.cpu";
} else {
/* replace '-' with '.' */
if (authname[i] == '-') {
authname[i] = '.';
}
}
}
if (authname_free) {
}
return LIBPOLKIT_RESULT_OK;
}
{
char **privilege_list;
int num_privileges = 0;
int i;
for (i = 0; i < num_privileges; i++) {
}
return res;
}
const char *user,
const char *privilege,
const char *resource,
{
return LIBPOLKIT_RESULT_OK;
}