4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd All Rights Reserved
6 * Contact: Bumjin Im <bj.im@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License
22 #ifndef SECURITY_SERVER_H
23 #define SECURITY_SERVER_H
27 * @file security-server.h
29 * @brief This file contains APIs of the Security Server
33 * @defgroup SecurityFW
36 * @defgroup SECURITY_SERVER Security Server
38 * @brief Security Server client library functions
43 * @addtogroup SECURITY_SERVER
48 * ====================================================================================================
53 * -- Company Name -- | Modification Date | Description of Changes
54 * -----------------------------------------------------------------------
55 * --- Samsung ------ | --- 2010-07-25 -- | First created
62 * exported by the foundation API.
63 * result codes begin with the start error code and extend into negative direction.
66 #define SECURITY_SERVER_API_SUCCESS 0
67 /*! \brief indicating the result of the one specific API is successful */
68 #define SECURITY_SERVER_API_ERROR_SOCKET -1
70 /*! \brief indicating the socket between client and Security Server has been failed */
71 #define SECURITY_SERVER_API_ERROR_BAD_REQUEST -2
73 /*! \brief indicating the response from Security Server is malformed */
74 #define SECURITY_SERVER_API_ERROR_BAD_RESPONSE -3
76 /*! \brief indicating the transmitting request has been failed */
77 #define SECURITY_SERVER_API_ERROR_SEND_FAILED -4
79 /*! \brief indicating the receiving response has been failed */
80 #define SECURITY_SERVER_API_ERROR_RECV_FAILED -5
82 /*! \brief indicating requesting object is not exist */
83 #define SECURITY_SERVER_API_ERROR_NO_SUCH_OBJECT -6
85 /*! \brief indicating the authentication between client and server has been failed */
86 #define SECURITY_SERVER_API_ERROR_AUTHENTICATION_FAILED -7
88 /*! \brief indicating the API's input parameter is malformed */
89 #define SECURITY_SERVER_API_ERROR_INPUT_PARAM -8
91 /*! \brief indicating the output buffer size which is passed as parameter is too small */
92 #define SECURITY_SERVER_API_ERROR_BUFFER_TOO_SMALL -9
94 /*! \brief indicating system is running out of memory state */
95 #define SECURITY_SERVER_API_ERROR_OUT_OF_MEMORY -10
97 /*! \brief indicating the access has been denied by Security Server */
98 #define SECURITY_SERVER_API_ERROR_ACCESS_DENIED -11
100 /*! \brief indicating Security Server has been failed for some reason */
101 #define SECURITY_SERVER_API_ERROR_SERVER_ERROR -12
103 /*! \brief indicating given cookie is not exist in the database */
104 #define SECURITY_SERVER_API_ERROR_NO_SUCH_COOKIE -13
106 /*! \brief indicating there is no phone password set */
107 #define SECURITY_SERVER_API_ERROR_NO_PASSWORD -14
109 /*! \brief indicating password exists in system */
110 #define SECURITY_SERVER_API_ERROR_PASSWORD_EXIST -15
112 /*! \brief indicating password mismatch */
113 #define SECURITY_SERVER_API_ERROR_PASSWORD_MISMATCH -16
115 /*! \brief indicating password retry timeout is not occurred yet */
116 #define SECURITY_SERVER_API_ERROR_PASSWORD_RETRY_TIMER -17
118 /*! \brief indicating password retry timeout is not occurred yet */
119 #define SECURITY_SERVER_API_ERROR_PASSWORD_MAX_ATTEMPTS_EXCEEDED -18
121 /*! \brief indicating password retry timeout is not occurred yet */
122 #define SECURITY_SERVER_API_ERROR_PASSWORD_EXPIRED -19
124 /*! \brief indicating password retry timeout is not occurred yet */
125 #define SECURITY_SERVER_API_ERROR_PASSWORD_REUSED -20
127 /*! \brief indicating the error with unknown reason */
128 #define SECURITY_SERVER_API_ERROR_UNKNOWN -255
139 * Retreives Linux group ID from object name which is passed by parameter
142 * This API may be used before security_server_check_privilege() API by middleware daemon to get group ID of a specific object.
144 * \par Typical use case:
145 * In middleware daemon, before checking privilege of a service the daemon need to know the GID of the service. This API support the functionality.
147 * \par Method of function operation:
148 * Opens /etc/group file and searches the object name as group name. If there is matching result, returns GID as integer
150 * \par Sync (or) Async:
151 * This is a Synchronous API.
153 * \par Important notes:
154 * - This API is only allowed to be called by pre-defined middleware daemon
156 * \param[in] object Name of the object which is kwnown by the caller.
158 * \return matching gid (positive integer) on success, or negative error code on error.
160 * \par Prospective clients:
163 * \par Known issues/bugs:
171 * security_server_get_object_name(), security_server_check_privilege()
177 * #include <security-server.h>
181 * // You have to make sure that the input param '*object' is defined in the platform
182 * retval = security_server_get_gid("telephony_makecall");
185 * printf("%s", "Error has occurred\n");
191 int security_server_get_gid(const char *object);
197 * Retreives object name as mull terminated string from Linux group ID which is passed by parameter
200 * This API may be used to get object name if the caller process only knows GID of the object.
202 * \par Typical use case:
203 * In middleware daemon, by some reason, need to know object name from the Linux group ID, then call this API to retrieve object name as string
205 * \par Method of function operation:
206 * Opens /etc/group file and searches matching gid. If there is matching result, returns name of the group as null terminated string
208 * \par Sync (or) Async:
209 * This is a Synchronous API.
211 * \par Important notes:
212 * - This API is only allowed to be called by pre-defined middleware daemon
214 * \param[in] gid Linux group ID which needed to be retrieved as object name.
215 * \param[out] object Place holder for matching object name for gid.
216 * \param[in] max_object_size Allocated byte size of parameter "object".
218 * \return 0 on success, or negative error code on error.
220 * \par Prospective clients:
221 * Inhouse middleware.
223 * \par Known issues/bugs:
226 * \pre output parameter object must be malloced before calling this API not to make memory curruption
231 * security_server_get_gid()
237 * #include <security-server.h>
240 * char objectname[20];
243 * retval = security_server_get_object_name(6005, objectname, sizeof(objectname));
246 * printf("%s", "Error has occurred\n");
252 int security_server_get_object_name(gid_t gid, char *object, size_t max_object_size);
258 * Request cookie to the Security Server. Cookie is a random bit stream which is used as ticket for user space object.
261 * This API may be used by application and client middleware process to get access to middleware daemons.
263 * \par Typical use case:
264 * When an application process wants to get access to some middleware object, first call this API to get cookie value. Then it calls the service API to get service with the cookie value.
266 * \par Method of function operation:
267 * Caller process just send request message. Security Server checks proc file system to get list of gIDs the caller belongs, then create a random cookie and responds to caller.
269 * \par Sync (or) Async:
270 * This is a Synchronous API.
272 * \par Important notes:
273 * Cookie needs to be stored relatively secure.
275 * \param[out] cookie Place holder for cookie value.
276 * \param[in] max_cookie Allocated byte size of parameter "cookie".
278 * \return 0 on success, or negative error code on error.
280 * \par Prospective clients:
283 * \par Known issues/bugs:
286 * \pre output parameter cookie must be malloced before calling this API not to make memory curruption
287 * Size of the cookie can be retrieved by security_server_get_cookie_size() API.
291 * \see security_server_check_privilege(), security_server_get_cookie_size()
297 * #include <security-server.h>
300 * size_t cookie_size;
301 * cookie_size = security_server_get_cookie_size();
302 * unsigned char cookie[cookie_size];
305 * retval = security_server_request_cookie(cookie, cookie_size);
308 * printf("%s", "Error has occurred\n");
314 int security_server_request_cookie(char *cookie, size_t max_cookie);
320 * This API gets the cookie's byte size which is issued by Security Server.
323 * This API may be used by application and middleware process to get size of cookie before getting and storing cookie value.
325 * \par Typical use case:
326 * When an application process wants to get access to some middleware object, first call this API to get cookie value. Then it calls the service API to get service with the cookie value.
328 * \par Method of function operation:
329 * This API just returns pre-defined integer value as cookie size.
331 * \par Sync (or) Async:
332 * This is a Synchronous API.
334 * \par Important notes:
337 * \return Always returns byte size of the cookie.
339 * \par Prospective clients:
342 * \par Known issues/bugs:
349 * \see security_server_request_cookie()
355 * #include <security-server.h>
358 * size_t cookie_size;
361 * cookie_size = security_server_get_cookie_size();
362 * unsigned char cookie[cookie_size];
364 * char objectname[20];
365 * retval = security_server_request_cookie(cookie, cookie_size);
368 * printf("%s", "Error has occurred\n");
374 int security_server_get_cookie_size(void);
380 * This API checks the cookie is allowed to access to given object.
383 * This API may be used by middleware process to ask the client application has privilege for the given object.
385 * \par Typical use case:
386 * When middleware server receives request message from client application process with cookie value, it calls this API to ask to Security Server that the client application has privilege to access the service. If yes, then the middleware daemon can continue service, if not, it can return error to client application.
388 * \par Method of function operation:
389 * When Security Server receives this request, it searches cookie database and check the cookie is there, if there is matching cookie, then it checks the cookie has the privilege. It returns success if there is match, if not, it returns error.
391 * \par Sync (or) Async:
392 * This is a Synchronous API.
394 * \par Important notes:
395 * Cookie value needs to be stored relatively secure\n
396 * Privilege should be pre-defined by Platform design.
398 * \param[in] cookie Received cookie value from client application
399 * \param[in] privilege Object group ID which the client application wants to access
401 * \return 0 on success, or negative error code on error.
403 * \par Prospective clients:
404 * Only pre-defiend middleware daemons
406 * \par Known issues/bugs:
412 * \see security_server_request_cookie(), security_server_get_gid(), security_server_get_cookie_size()
418 * #include <security-server.h>
421 * size_t cookie_size;
423 * cookie_size = security_server_get_cookie_size();
424 * unsigned char recved_cookie[cookie_size];
426 * ... // Receiving request with cookie
428 * call_gid = security_server_get_gid("telephony_makecall");
429 * retval = security_server_check_privilege(recved_cookie, (gid_t)call_gid);
432 * if(retval == SECURITY_SERVER_API_ERROR_ACCESS_DENIED)
434 * printf("%s", "access has been denied\n");
437 * printf("%s", "Error has occurred\n");
443 int security_server_check_privilege(const char *cookie, gid_t privilege);
445 int security_server_check_privilege_by_cookie(const char *cookie,
447 const char *access_rights);
449 int security_server_check_privilege_by_sockfd(int sockfd,
451 const char *access_rights);
455 * This API searchs a cookie value and returns PID of the given cookie.
458 * This API may be used by middleware process to ask the client application has privilege for the given object.
460 * \par Typical use case:
461 * In some cases, a middleware server wants to know PID of the application process. But if the middleware server uses non-direct IPC such as dbus, it's nearly impossible to know and guarantee peer PID. By using this API, the middleware server can retrieve a PID of the requesting process.
463 * \par Method of function operation:
464 * When Security Server receives this request, it searches cookie database and check the cookie is there, if there is matching cookie, then it returns corresponding PID for the cookie.
466 * \par Sync (or) Async:
467 * This is a Synchronous API.
469 * \par Important notes:
470 * Cookie value needs to be stored relatively secure\n
471 * This API is abled to be called only by pre-defined middleware servers.
473 * \param[in] cookie Received cookie value from client application. Cookie is not a null terminated human readable string. Make sure you're code doesn't have any string related process on the cookie.
475 * \return positive integer on success meaning the PID, 0 means the cookie is for root process, negative integer error code on error.
477 * \par Prospective clients:
478 * Only pre-defiend middleware daemons
480 * \par Known issues/bugs:
487 * \see security_server_request_cookie(), security_server_get_cookie_size()
489 * \remarks the cookie is not a null terminated string. Cookie is a BINARY byte stream of such length which can be retrieved by security_server_get_cookie_size() API.
490 * Therefore, please do not use strcpy() family to process cookie value. You MUST use memcpy() function to process cookie value.
491 * You also have to know that the cookie value doesn't carry any null terminator. So you don't need to allocate 1 more byte of the cookie size.
495 * #include <security-server.h>
498 * size_t cookie_size;
500 * cookie_size = security_server_get_cookie_size();
501 * unsigned char recved_cookie[cookie_size];
503 * ... // Receiving request with cookie
505 * peerpid = security_server_get_cookie_pid(recved_cookie);
508 * printf("%s", "Error has occurred\n");
514 int security_server_get_cookie_pid(const char *cookie);
520 * This API checks phone validity of password, to check existance, expiration, remaining attempts.
523 * This API should be used by applications which needs phone password check. Caller application should behave properly after this API call.
525 * \par Typical use case:
526 * Lock screen can call this API before it shows unlock screen, if there is password, lock screen can show password input UI, if not, lock screen can show just unlock screen
528 * \par Method of function operation:
529 * Sends a validate request to security server and security server replies with password information.
531 * \par Sync (or) Async:
532 * This is a Synchronous API.
534 * \par Important notes:
535 * Password file should be stored safely. The password file will be stored by security server and only allowed itself to read/write, and data is will be securely hashed\n
537 * \param[out] current_attempts Number of password check missed attempts.
538 * \param[out] max_attempts Number of maximum attempts that the password locks. 0 means infinite
539 * \param[out] valid_secs Remaining time in second which represents this password will be expired. 0xFFFFFFFF means infinite
541 * \return 0 if there is no password set, other negative integer error code on error.
543 * \par Prospective clients:
544 * Applications which can unlock UI
546 * \par Known issues/bugs:
553 * \see security_server_set_pwd(), security_server_chk_pwd()
555 * \remarks If password file is currupted or accitentally deleted, this API may not synchronized with security-server, but security-server will check file status on next request.
559 * #include <security-server.h>
562 * unsigned int attempt, max_attempt, expire_sec;
564 * ret = security_server_is_pwd_valid(&attempt, &max_attempt, &expire_sec);
565 * if(is_pwd_set == SECURITY_SERVER_API_ERROR_NO_PASSWORD)
567 * printf("%s", "There is no password exists\n");
569 * else if(is_pwd_set == SECURITY_SERVER_SUCCESS && expire_sec > 0 && attempt < max_attempts)
571 * printf("%s", "Password is valid by now\n");
575 * printf("%s", "Something wrong\n");
581 int security_server_is_pwd_valid(unsigned int *current_attempts,
582 unsigned int *max_attempts,
583 unsigned int *valid_secs);
589 * This API sets phone password only if current password matches.
592 * This API should be used by setting application when the user changes his/her phone password.
594 * \par Typical use case:
595 * Setting application calls this API to change phone password. Caller needs current password to grant the change.
597 * \par Method of function operation:
598 * Sends current password with new password to security-server, security-server checks current password and set new password to current only when current password is correct. Caller application can determine maximum number of attempts and expiration time in days
600 * \par Sync (or) Async:
601 * This is a Synchronous API.
603 * \par Important notes:
604 * There is retry timer on this API to limit replay attack. You will get error if you called this API too often.\n
606 * \param[in] cur_pwd Null terminated current password string. It can be NULL pointer if there is no password set yet - by calling security_server_is_pwd_empty()
607 * \param[in] new_pwd Null terminated new password string. It must not a NULL pointer.
608 * \param[in] max_challenge Maximum number of attempts that user can try to check the password without success in serial. 0 means infinity.
609 * \param[in] valid_period_in_days. Number of days that this password is valid. 0 means infinity
611 * \return 0 on seccuess, negative integer error code on error.
613 * \par Prospective clients:
614 * Platform's THE ONLY setting application and some dedicated privileged processes
616 * \par Known issues/bugs:
623 * \see security_server_is_pwd_valid(), security_server_chk_pwd(), security_server_reset_pwd()
625 * \remarks Only setting application can call this API. The password file will be acces controlled and securely hashed. Security-server will remain previous password file to recover unexpected password file curruption.
626 * \remarks If current password exists and it's expired, or max attempts reached, you cannot call this API. You have to call security_server_reset_pwd() API.
630 * #include <security-server.h>
633 * unsigned int attempt, max_attempt, expire_sec;
635 * ret = security_server_is_pwd_valid(&attempt, &max_attempt, &expire_sec);
636 * if(is_pwd_set == SECURITY_SERVER_API_ERROR_NO_PASSWORD)
638 * printf("%s", "There is no password exists\n");
639 * ret = security_server_set_pwd(NULL, "this_is_new_pwd", 20, 365);
640 * if(ret != SECURITY_SERVER_API_SUCCESS)
642 * printf("%s", "we have error\n");
646 * else if(is_pwd_set == SECURITY_SERVER_SUCCESS && expire_sec > 0 && attempt < max_attempts)
648 * printf("%s", "Password is valid by now\n");
649 * ret = security_server_set_pwd("this_is_current_pwd", "this_is_new_pwd", 20, 365);
650 * if(ret != SECURITY_SERVER_API_SUCCESS)
652 * printf("%s", "we have error\n");
658 * printf("%s", "Something wrong\n");
664 int security_server_set_pwd(const char *cur_pwd,
666 const unsigned int max_challenge,
667 const unsigned int valid_period_in_days);
672 * This API sets validity period for currently setup password.
675 * This API should be used by Enterprise authorities to modify password policy. To be used only with valid password setup.
677 * \par Typical use case:
678 * Authorized application calls this API to change current passwords validity when password policy needs to be changed.
680 * \par Method of function operation:
681 * Function attempts to find currently set password and changes its current validity to passed number of days. Retry counter for the password is reset to zero.
682 * If there is no password set, function returns proper error code.
684 * \par Sync (or) Async:
685 * This is a Synchronous API.
686 * \param[in] valid_period_in_days. Number of days that this password is valid. 0 means infinity
688 * \return 0 on success, negative integer error code on error.
690 * \par Prospective clients:
691 * Platform's THE ONLY setting application and some dedicated privileged processes
693 * \par Known issues/bugs:
694 * Identifying calling peer is not ready yet, should be based on SMACK somehow.
696 * \see security_server_is_pwd_valid(), security_server_chk_pwd(), security_server_reset_pwd()
698 int security_server_set_pwd_validity(const unsigned int valid_period_in_days);
703 * This API sets maximum number of attempts for currently setup password.
706 * This API should be used by Enterprise authorities to modify password policy. To be used only with valid password setup.
708 * \par Typical use case:
709 * Authorized application calls this API to change current passwords max attempt number when password policy needs to be changed.
711 * \par Method of function operation:
712 * Function attempts to find currently set password and changes its max attempt number to passed one. Retry counter for the password is reset to zero.
713 * If there is no password set, function returns proper error code.
715 * \par Sync (or) Async:
716 * This is a Synchronous API.
717 * \param[in] max_challenge Maximum number of attempts that user can try to check the password without success in serial. 0 means infinity.
719 * \return 0 on success, negative integer error code on error.
721 * \par Prospective clients:
722 * Platform's THE ONLY setting application and some dedicated privileged processes
724 * \par Known issues/bugs:
725 * Identifying calling peer is not ready yet, should be based on SMACK somehow.
727 * \see security_server_is_pwd_valid(), security_server_chk_pwd(), security_server_reset_pwd()
729 int security_server_set_pwd_max_challenge(const unsigned int max_challenge);
733 * This API sets phone password only if current password is invalid or user forgot the password.
736 * This API should be used by setting application or dedicated processes when the user changes his/her phone password.
738 * \par Typical use case:
739 * User forgots the password. He calls emergency manager(auto or manual) for reset password. Emergency manager calls this API and reset phone password.
741 * \par Method of function operation:
742 * Resetting phone password with input string without any matching current password.
744 * \par Sync (or) Async:
745 * This is a Synchronous API.
747 * \par Important notes:
748 * There is retry timer on this API to limit replay attack. You will get error if you called this API too often.\n
750 * \param[in] new_pwd Null terminated new password string. It must not a NULL pointer.
751 * \param[in] max_challenge Maximum number of attempts that user can try to check the password without success in serial. 0 means infinity.
752 * \param[in] valid_period_in_days. Number of days that this password is valid. 0 means infinity
754 * \return 0 on seccuess, negative integer error code on error.
756 * \par Prospective clients:
757 * Platform's THE ONLY setting application and some dedicated privileged processes
759 * \par Known issues/bugs:
766 * \see security_server_is_pwd_valid(), security_server_chk_pwd(), security_server_set_pwd()
768 * \remarks Only dedicated applications can call this API. The password file will be acces controlled and securely hashed. Security-server will remain previous password file to recover unexpected password file curruption.
772 * #include <security-server.h>
775 * unsigned int attempt, max_attempt, expire_sec;
777 * ret = security_server_set_pwd("this_is_new_pwd", 20, 365);
778 * if(retval != SECURITY_SERVER_API_SUCCESS)
780 * printf("%s", "we have error\n");
787 int security_server_reset_pwd(const char *new_pwd,
788 const unsigned int max_challenge,
789 const unsigned int valid_period_in_days);
793 * This API compares stored phone password with challenged input value.
796 * This API should be used by applications which has phone UI lock capability.
798 * \par Typical use case:
799 * Lock screen calls this API after user typed phone password and pressed okay.
801 * \par Method of function operation:
802 * Sends challenged password to security-server, security-server compares hashed current password and hashed challenged password.
804 * \par Sync (or) Async:
805 * This is a Synchronous API.
807 * \par Important notes:
808 * There is retry timer on this API to limit replay attack. You will get error if you called this API too often.\n
810 * \param[in] challenge Null terminated challenged password string. It must not a NULL pointer.
811 * \param[out] current_attempts Number of password check missed attempts.
812 * \param[out] max_attempts Number of maximum attempts that the password locks. 0 means infinite
813 * \param[out] valid_secs Remaining time in second which represents this password will be expired. 0xFFFFFFFF means infinite
815 * \return 0 on seccuess, negative integer error code on error.
817 * \par Prospective clients:
818 * Applications which has phone UI lock feature.
820 * \par Known issues/bugs:
827 * \see security_server_is_pwd_valid(), security_server_set_pwd()
829 * \remarks The password file will be acces controlled and securely hashed. Security-server will remain previous password file to recover unexpected password file curruption.
833 * #include <security-server.h>
836 * unsigned int attempt, max_attempt, expire_sec;
838 * retval = security_server_chk_pwd("is_this_password", &attmpt, &max_attempt, &expire_sec);
839 * if(retval == SECURITY_SERVER_API_ERROR_PASSWORD_MISMATCH)
841 * printf("%s", "Oh you typed wrong password\n");
844 * else if(retval == SECURITY_SERVER_API_SUCCESS)
846 * printf("%s", "You remember your password.\n");
853 int security_server_chk_pwd(const char *challenge,
854 unsigned int *current_attempt,
855 unsigned int *max_attempt,
856 unsigned int *valid_secs);
861 * This API set the number of password history which should be maintained. Once this number set, user cannot reuse recent number of passwords which is described in this history value
864 * This API should be used only by dedicated process in the platform.
866 * \par Typical use case:
867 * Enterprise manager calls this API when the enterprise wants to enforce harder password policy.
869 * \par Method of function operation:
870 * When enterprise manager (MDM) is trying to change the security policy for phone password, it calls this API background to change the history policy.
872 * \par Sync (or) Async:
873 * This is a Synchronous API.
875 * \par Important notes:
876 * There is retry timer on this API to limit replay attack. You will get error if you called this API too often.\n
878 * \param[in] number_of_history Number of history to be checked when user tries to change password. Maximum is currently 50
880 * \return 0 on seccuess, negative integer error code on error.
882 * \par Prospective clients:
883 * MDM client, Enterprise manager.
885 * \par Known issues/bugs:
892 * \see security_server_set_pwd()
894 * \remarks The password file will be acces controlled and securely hashed. Security-server will remain previous password file to recover unexpected password file curruption.
898 * #include <security-server.h>
902 * ret = security_server_set_pwd_history(100);
903 * if(ret != SECURITY_SERVER_API_SUCCESS)
905 * printf("%s", "You have error\n");
912 int security_server_set_pwd_history(int number_of_history);
918 * This API launches /usr/bin/debug-util as root privilege.
921 * This API will be used only by SDK with developer privilege to launch debugging tool to debug as the developing applicaion's privilege.
923 * \par Typical use case:
924 * During appliation development, SDK opens a shell to install, launch, and debug the developing application. But the shell will not have any privilege to control platform. Therefore we need a special utility to manage debugging environement as same privilege level of the application. If this API is called, security server will launch the debug utility as root privilege and the utility will drop its privilege same as developing application
927 * \par Method of function operation:
928 * When Security Server receives this request, it checks uid of the client, and launches /usr/bin/debug-util with given arguements.
930 * \par Sync (or) Async:
931 * This is a Synchronous API.
933 * \par Important notes:
934 * Caller process of this API must be owned by developer user.\n
935 * The caller process will be pre-defined.
936 * /usr/bin/debug-util itself must be omitted in the argv. Security server will put this as first argv in the execution procedure
938 * \param[in] argc Number of arguements.
940 * \param[in] argv Arguements
942 * \return 0 on success, negative integer error code on error.
944 * \par Prospective clients:
945 * Only pre-defiend debugging utility.
947 * \par Known issues/bugs:
956 * \remarks Calling this API, you have to put argv[1] of the debug-util as argv[0] of this API. Security server will put argv[0] automatically
960 * #include <security-server.h>
961 * #define DEVELOPER_UID 5500
963 * int main(int argc, char **argv)
967 * if(uid != DEVELOPER_UID)
969 * // You must be developer user
973 * ret = security_server_launch_debug_tool(argc -1, argv++)
974 * if(ret != SECURITY_SERVER_SUCCESS)
976 * // Some error occurred
984 int security_server_launch_debug_tool(int argc, const char **argv);