Adapt code for new libsmack API
authorJan Cybulski <j.cybulski@samsung.com>
Mon, 29 Jul 2013 11:06:32 +0000 (13:06 +0200)
committerJan Cybulski <j.cybulski@samsung.com>
Wed, 14 Aug 2013 06:39:45 +0000 (08:39 +0200)
    [Issue#] SSDWSSP-433
    [Feature] Change libsmack for compatibility with a newly changed smack API.
    [Cause] Now libsmack functions: smack_new_label_from_self() and smack_new_label_from_socket(), in case of success, are returning value greater than 0.
    [Solution] Change expected result.
    [Verification]  Run tests.

Change-Id: Idca56a593179f02d84df808bdc6c5ca01685e62d

src/privilege-control.c

index 27d975c..c1a515d 100644 (file)
@@ -940,7 +940,7 @@ API char* perm_app_id_from_socket(int sockfd)
        int ret;
 
        ret = smack_new_label_from_socket(sockfd, &app_id);
-       if (ret != 0) {
+       if (ret < 0) {
                C_LOGE("smack_new_label_from_socket failed");
                return NULL;
        }