Merge "add tzplatform_has_users_group() api" into tizen submit/tizen_3.0.2015.q1_common/20150316.105130 submit/tizen_common/20150316.103635 submit/tizen_common/20150316.105034
authorStéphane Desneux (sdx) <stephane.desneux@open.eurogiciel.org>
Mon, 16 Mar 2015 10:39:03 +0000 (03:39 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Mon, 16 Mar 2015 10:39:03 +0000 (03:39 -0700)
1  2 
src/tzplatform_config.h

diff --combined src/tzplatform_config.h
@@@ -197,15 -197,15 +197,15 @@@ exter
  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);
@@@ -368,15 -368,15 +368,15 @@@ exter
  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);
  extern
  int tzplatform_has_system_group(uid_t uid);
  
+ /*
+  Return 1 if given uid is in the regular users group (named "users")
+  Return 0 if not
+  Return -1 in case of error.
+  Example:
+         tzplatform_has_users_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();
+ */
+ extern
+ int tzplatform_has_users_group(uid_t uid);
  #ifdef __cplusplus
  }
  #endif