chiark / gitweb /
hibernate-resume: refuse to run outside of an initrd
authorLennart Poettering <lennart@poettering.net>
Thu, 28 Aug 2014 18:24:12 +0000 (20:24 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 28 Aug 2014 18:26:14 +0000 (20:26 +0200)
src/hibernate-resume/hibernate-resume.c

index 8f68f81..b234a0b 100644 (file)
@@ -46,6 +46,10 @@ int main(int argc, char *argv[]) {
 
         umask(0022);
 
 
         umask(0022);
 
+        /* Refuse to run unless we are in an initrd() */
+        if (!in_initrd())
+                return EXIT_SUCCESS;
+
         device = argv[1];
 
         if (stat(device, &st) < 0) {
         device = argv[1];
 
         if (stat(device, &st) < 0) {