Remove lchmod related code (#375)
author조웅석/Common Platform Lab(SR)/삼성전자 <ws77.cho@samsung.com>
Tue, 8 Feb 2022 00:23:29 +0000 (09:23 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 8 Feb 2022 00:23:29 +0000 (09:23 +0900)
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.

NativeLauncher/util/utils.cc

index 6958529..a12af28 100644 (file)
@@ -424,12 +424,11 @@ void copySmackAndOwnership(const std::string& fromPath, const std::string& toPat
                        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