[Issue#] SSDWSSP-80
[Bug] set_smack_from_binary() gets label from symlink, not its target.
[Cause] Used function for getting label doesn't follow symlinks.
[Solution] Change the function to the symlink-following one.
[Verification] Build, install, run latest tests from security-tests package.
Change-Id: Ibc67d8f91621ad0ab05c1690d87604acdc78c995
char* label;
C_LOGD("Path: %s", path);
- ret = smack_lgetlabel(path, &label, SMACK_LABEL_EXEC);
+ ret = smack_getlabel(path, &label, SMACK_LABEL_EXEC);
if (ret != 0) {
- C_LOGE("smack_lgetlabel returned PC_ERR_INVALID_OPERATION");
+ C_LOGE("Getting exec label from file %s failed", path);
return PC_ERR_INVALID_OPERATION;
}