/*
- * Copyright (C) 2013 Intel Corporation.
+ * Copyright (C) 2013-2014 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
uid_t tzplatform_getuid(enum tzplatform_variable id);
/*
- Return the gid for a given group name, stored in variable <id>
+ Return the gid for a given user name, stored in variable <id>
Retun -1 in case of error.
Example:
- if TZ_USER_GROUP=="app" then calling:
+ if TZ_USER_NAME=="app" then calling:
- tzplatform_getuid(TZ_USER_GROUP)
+ tzplatform_getuid(TZ_USER_NAME)
- will return the gid of the group 'app'
+ will return the gid of the user 'app'
*/
extern
gid_t tzplatform_getgid(enum tzplatform_variable id);
/*
Enforces the removal of the previously evaluated tizen platform variables.
-
- Call this function in case of changing of user inside the application.
*/
extern
void tzplatform_context_reset(struct tzplatform_context *context);
int tzplatform_context_set_user(struct tzplatform_context *context, uid_t uid);
/*
+ Get the user set to the context.
*/
extern
uid_t tzplatform_context_get_user(struct tzplatform_context *context);
uid_t tzplatform_context_getuid(struct tzplatform_context *context, enum tzplatform_variable id);
/*
- Return the gid for a given group name, stored in variable <id>
+ Return the gid for a given user name, stored in variable <id>
Retun -1 in case of error.
Example:
- if TZ_USER_GROUP=="app" then calling:
+ if TZ_USER_NAME=="app" then calling:
- tzplatform_context_getuid(context, TZ_USER_GROUP)
+ tzplatform_context_getuid(context, TZ_USER_NAME)
- will return the gid of the group 'app'
+ will return the gid of the user 'app'
*/
extern
gid_t tzplatform_context_getgid(struct tzplatform_context *context, enum tzplatform_variable id);
+
+/*
+ Return 1 if given uid is in the system admin group (named "system")
+ Return 0 if not
+ Return -1 in case of error.
+
+ Example:
+ tzplatform_has_system_group(1000)
+
+ will return 0 or 1 depends on right of given uid.
+
+ NOTE :
+ * If you pass the -1 value to this function it will take the current uid given
+ * by the POSIX function getuid();
+
+ *** WARNING : ***
+ * This is a temporary feature
+ * This will be managed by Cynara
+
+*/
+extern
+int tzplatform_has_system_group(uid_t uid);
+
#ifdef __cplusplus
}
#endif