diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-05-06 22:43:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-06 22:43:08 +0200 |
| commit | f8bbe5124c0012865ea36f52d304313084a31fe9 (patch) | |
| tree | 803f46d75b4807c0bd1343eedfa1a3c1aeb0b8d0 /hyprpm/src/main.cpp | |
| parent | 948277895efba5e8bcc66d34dcafe87518fc7b61 (diff) | |
hyprpm: clean up root access and properly check input (#10304)
* manifest: reject bad names from parsing
* sys: restructure root functions
Diffstat (limited to 'hyprpm/src/main.cpp')
| -rw-r--r-- | hyprpm/src/main.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/hyprpm/src/main.cpp b/hyprpm/src/main.cpp index a70a0c0b..ca9c0fdb 100644 --- a/hyprpm/src/main.cpp +++ b/hyprpm/src/main.cpp @@ -101,8 +101,8 @@ int main(int argc, char** argv, char** envp) { if (command.size() >= 3) rev = command[2]; - NSys::cacheSudo(); - CScopeGuard x([] { NSys::dropSudo(); }); + NSys::root::cacheSudo(); + CScopeGuard x([] { NSys::root::dropSudo(); }); return g_pPluginManager->addNewPluginRepo(command[1], rev) ? 0 : 1; } else if (command[0] == "remove") { @@ -111,13 +111,13 @@ int main(int argc, char** argv, char** envp) { return 1; } - NSys::cacheSudo(); - CScopeGuard x([] { NSys::dropSudo(); }); + NSys::root::cacheSudo(); + CScopeGuard x([] { NSys::root::dropSudo(); }); return g_pPluginManager->removePluginRepo(command[1]) ? 0 : 1; } else if (command[0] == "update") { - NSys::cacheSudo(); - CScopeGuard x([] { NSys::dropSudo(); }); + NSys::root::cacheSudo(); + CScopeGuard x([] { NSys::root::dropSudo(); }); bool headersValid = g_pPluginManager->headersValid() == HEADERS_OK; bool headers = g_pPluginManager->updateHeaders(force); @@ -152,8 +152,8 @@ int main(int argc, char** argv, char** envp) { return 1; } - NSys::cacheSudo(); - CScopeGuard x([] { NSys::dropSudo(); }); + NSys::root::cacheSudo(); + CScopeGuard x([] { NSys::root::dropSudo(); }); auto ret = g_pPluginManager->ensurePluginsLoadState(); @@ -173,8 +173,8 @@ int main(int argc, char** argv, char** envp) { return 1; } - NSys::cacheSudo(); - CScopeGuard x([] { NSys::dropSudo(); }); + NSys::root::cacheSudo(); + CScopeGuard x([] { NSys::root::dropSudo(); }); auto ret = g_pPluginManager->ensurePluginsLoadState(); @@ -200,8 +200,8 @@ int main(int argc, char** argv, char** envp) { g_pPluginManager->notify(ICON_OK, 0, 4000, "[hyprpm] Loaded plugins"); } } else if (command[0] == "purge-cache") { - NSys::cacheSudo(); - CScopeGuard x([] { NSys::dropSudo(); }); + NSys::root::cacheSudo(); + CScopeGuard x([] { NSys::root::dropSudo(); }); DataState::purgeAllCache(); } else if (command[0] == "list") { g_pPluginManager->listAllPlugins(); |
