]> git.saurik.com Git - ldid.git/commitdiff
Don't sign symlinks as part of old "files" schema.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 20 Feb 2021 01:27:47 +0000 (17:27 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 20 Feb 2021 01:27:47 +0000 (17:27 -0800)
ldid.cpp

index 1070e36acbfd31cacb606d06a710aec6252ada07..b228419f2414268cef9be2c4164a3656d62a4cd4 100644 (file)
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -2686,19 +2686,20 @@ Bundle Sign(const std::string &root, Folder &folder, const std::string &key, Sta
                     break;
                 }
 
-        for (const auto &link : links)
-            for (const auto &rule : version.second)
-                if (rule(link.first)) {
-                    if (rule.mode_ != OmitMode) {
-                        auto entry(plist_new_dict());
-                        plist_dict_set_item(entry, "symlink", plist_new_string(link.second.c_str()));
-                        if (rule.mode_ == OptionalMode)
-                            plist_dict_set_item(entry, "optional", plist_new_bool(true));
-                        plist_dict_set_item(files, link.first.c_str(), entry);
-                    }
+        if (!old)
+            for (const auto &link : local.links)
+                for (const auto &rule : version.second)
+                    if (rule(link.first)) {
+                        if (rule.mode_ != OmitMode) {
+                            auto entry(plist_new_dict());
+                            plist_dict_set_item(entry, "symlink", plist_new_string(link.second.c_str()));
+                            if (rule.mode_ == OptionalMode)
+                                plist_dict_set_item(entry, "optional", plist_new_bool(true));
+                            plist_dict_set_item(files, link.first.c_str(), entry);
+                        }
 
-                    break;
-                }
+                        break;
+                    }
 
         if (!old && mac)
             for (const auto &bundle : bundles) {