|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From ac528e3e3b93981cc9692250556b113acce7eb17 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Lennart Poettering <lennart@poettering.net>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Thu, 28 Aug 2014 20:24:12 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] hibernate-resume: refuse to run outside of an initrd
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/hibernate-resume/hibernate-resume.c | 4 ++++
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 4 insertions(+)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/hibernate-resume/hibernate-resume.c b/src/hibernate-resume/hibernate-resume.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 8f68f81f9e..b234a0b49a 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/hibernate-resume/hibernate-resume.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/hibernate-resume/hibernate-resume.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -46,6 +46,10 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
umask(0022);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ /* Refuse to run unless we are in an initrd() */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (!in_initrd())
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ return EXIT_SUCCESS;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
device = argv[1];
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (stat(device, &st) < 0) {
|