Libprivilege API cleanup
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 4 Sep 2013 15:51:03 +0000 (17:51 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 11 Sep 2013 12:48:25 +0000 (14:48 +0200)
[Issue#] N/A
[Feature/Bug] N/A
[Problem] Fixed array instead of pointer was used as an API function argument
[Cause] N/A
[Solution] Function modified. Unnecessary include removed

[Verification] Successfull compilation of libprivilege-control and security-tests

Change-Id: I333611c51e9f17152e1353d38516024212ce91e1

include/common.h
include/privilege-control.h
src/privilege-control.c

index 0c967d9..f0b6c53 100644 (file)
@@ -26,6 +26,7 @@
 #include <dlog.h>
 #include <fts.h>
 #include <stdbool.h>
+#include <sys/smack.h>
 
 #ifdef LOG_TAG
     #undef LOG_TAG
index 5e8d064..2abbe19 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <stdbool.h>
 #include <sys/types.h>
-#include <sys/smack.h>
 
 #ifndef _PRIVILEGE_CONTROL_H_
 #define _PRIVILEGE_CONTROL_H_
@@ -79,7 +78,7 @@ int set_privilege(const char* pkg_name) DEPRECATED;
  * @param out: label of process
  * @return PC_OPERATION_SUCCESS on success PC_ERR_* on error.
  */
-int get_smack_label_from_process(pid_t pid, char smack_label[SMACK_LABEL_LEN + 1]);
+int get_smack_label_from_process(pid_t pid, char *smack_label);
 
 /**
  * Check if process with pid has access to object.
index f41c5e3..dd78219 100644 (file)
@@ -110,7 +110,7 @@ API int control_privilege(void)//deprecated
 /**
  * TODO: this function should be moved to libsmack in open-source.
  */
-API int get_smack_label_from_process(pid_t pid, char smack_label[SMACK_LABEL_LEN + 1])
+API int get_smack_label_from_process(pid_t pid, char *smack_label)
 {
        SECURE_C_LOGD("Entering function: %s. Params: pid=%i", __func__, pid);