In the linux system, permission of symlink file is meaningless.
(Also, lchmod alwasy returns -1 because it is not implemented.)
To remove unnecessary error message while installing application,
remove lchmod related code.
free(label);
}
- // change owner, groups and mode for symbolic link.
+ // change owner and groupsfor symbolic link.
+ // change mode is skipped for symlink because permission of symlink file is meaningless.
if (!lstat(fromPath.c_str(), &info)) {
if (lchown(toPath.c_str(), info.st_uid, info.st_gid) == -1)
_SERR("Failed to change owner and group name");
- if (lchmod(toPath.c_str(), info.st_mode) == -1)
- _SERR("Failed to change mode");
}
} else {
// change smack label