]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
update-utmp,initctl: drop ppid check
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 2 Jul 2020 11:44:43 +0000 (13:44 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 2 Jul 2020 15:12:23 +0000 (17:12 +0200)
Such checks make debugging harder but serve no useful purpose otherwise.
We got rid of all the checks for root, let's kill those too.

src/initctl/initctl.c
src/update-utmp/update-utmp.c

index 7505512fe7e4f5a5f1185545d2f7005ebab2b88f..7b93de0d8ab61722bbd5ce4e6c8f013d836f0124 100644 (file)
@@ -341,11 +341,6 @@ int main(int argc, char *argv[]) {
         Server server;
         int r = EXIT_FAILURE, n;
 
-        if (getppid() != 1) {
-                log_error("This program should be invoked by init only.");
-                return EXIT_FAILURE;
-        }
-
         if (argc > 1) {
                 log_error("This program does not take arguments.");
                 return EXIT_FAILURE;
index fd24cdc789a9cb4aa97237b5bdf21008b3a0d143..28f1aadabcb7744304af041548f8b1fa29115ee7 100644 (file)
@@ -223,9 +223,6 @@ static int run(int argc, char *argv[]) {
         };
         int r;
 
-        if (getppid() != 1)
-                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
-                                       "This program should be invoked by init only.");
         if (argc != 2)
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "This program requires one argument.");