From 1fe8112a03b57b5a4b43d417711e4457f27d1e02cc02b774cb625be9810440d8 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 7 May 2014 10:43:30 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=621 --- parse-crypttab-for-noauto-option.patch | 79 ++++++++++++++++++++++++++ systemd-mini.changes | 6 ++ systemd-mini.spec | 3 + systemd.changes | 6 ++ systemd.spec | 3 + 5 files changed, 97 insertions(+) create mode 100644 parse-crypttab-for-noauto-option.patch diff --git a/parse-crypttab-for-noauto-option.patch b/parse-crypttab-for-noauto-option.patch new file mode 100644 index 0000000..cb390f8 --- /dev/null +++ b/parse-crypttab-for-noauto-option.patch @@ -0,0 +1,79 @@ +--- + src/fstab-generator/fstab-generator.c | 52 ++++++++++++++++++++++++++++++++-- + 1 file changed, 50 insertions(+), 2 deletions(-) + +--- systemd-210/src/fstab-generator/fstab-generator.c ++++ systemd-210/src/fstab-generator/fstab-generator.c 2014-05-07 09:15:01.003911151 +0000 +@@ -37,6 +37,53 @@ + static const char *arg_dest = "/tmp"; + static bool arg_enabled = true; + ++static int check_crypttab(const char *what) { ++ _cleanup_fclose_ FILE *f = NULL; ++ unsigned n = 0; ++ int r; ++ ++ f = fopen("/etc/crypttab", "re"); ++ if (!f) { ++ if (errno == ENOENT) ++ r = EXIT_SUCCESS; ++ else ++ log_error("Failed to open /etc/crypttab: %m"); ++ ++ return 1; ++ } ++ ++ ++ for (;;) { ++ char line[LINE_MAX], *l; ++ _cleanup_free_ char *name = NULL, *device = NULL, *password = NULL, *options = NULL; ++ int k; ++ ++ if (!fgets(line, sizeof(line), f)) ++ break; ++ ++ n++; ++ ++ l = strstrip(line); ++ if (*l == '#' || *l == 0) ++ continue; ++ ++ k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options); ++ if (k < 2 || k > 4) { ++ log_error("Failed to parse /etc/crypttab:%u, ignoring.", n); ++ continue; ++ } ++ ++ if (strcmp((what + 12), name) == 0) { ++ if (strstr(options, "noauto")) ++ return 0; ++ ++ return 1; ++ } ++ } ++ return 1; ++} ++ ++ + static int mount_find_pri(struct mntent *me, int *ret) { + char *end, *pri; + unsigned long r; +@@ -212,7 +259,7 @@ + *name = NULL, *unit = NULL, *lnk = NULL, + *automount_name = NULL, *automount_unit = NULL; + _cleanup_fclose_ FILE *f = NULL; +- int r; ++ int r, c; + + assert(what); + assert(where); +@@ -286,7 +333,8 @@ + return -errno; + } + +- if (!noauto) { ++ c = check_crypttab(what); ++ if (!noauto && (c != 0)) { + if (post) { + lnk = strjoin(arg_dest, "/", post, nofail || automount ? ".wants/" : ".requires/", name, NULL); + if (!lnk) diff --git a/systemd-mini.changes b/systemd-mini.changes index 2c74d48..99f35b9 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 7 10:42:27 UTC 2014 - werner@suse.de + +- Add patch parse-crypttab-for-noauto-option.patch from Thomas Blume + to handle the option 'noauto' in /etc/crypttab (bnc#742774) + ------------------------------------------------------------------- Wed May 7 09:23:01 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index c0d498d..cfb4be0 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -405,6 +405,8 @@ Patch205: keep-crypt-password-prompt.patch Patch206: 0001-sd-rtnl-message-append-fix-uninitialized-memory.patch # PATCH-FIX-UPSTREAM Make systemd user journal accessible by users (bnc#876694) Patch207: 0001-tmpfiles-fix-permissions-on-new-journal-files.patch +# PATCH-FIX-SUSE Do not ignores option 'noauto' in /etc/crypttab (bnc#742774) +Patch208: parse-crypttab-for-noauto-option.patch # UDEV PATCHES # ============ @@ -795,6 +797,7 @@ cp %{SOURCE7} m4/ %patch205 -p1 %patch206 -p0 %patch207 -p0 +%patch208 -p1 # udev patches %patch1001 -p1 diff --git a/systemd.changes b/systemd.changes index 2c74d48..99f35b9 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 7 10:42:27 UTC 2014 - werner@suse.de + +- Add patch parse-crypttab-for-noauto-option.patch from Thomas Blume + to handle the option 'noauto' in /etc/crypttab (bnc#742774) + ------------------------------------------------------------------- Wed May 7 09:23:01 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 46db447..d08fdb1 100644 --- a/systemd.spec +++ b/systemd.spec @@ -400,6 +400,8 @@ Patch205: keep-crypt-password-prompt.patch Patch206: 0001-sd-rtnl-message-append-fix-uninitialized-memory.patch # PATCH-FIX-UPSTREAM Make systemd user journal accessible by users (bnc#876694) Patch207: 0001-tmpfiles-fix-permissions-on-new-journal-files.patch +# PATCH-FIX-SUSE Do not ignores option 'noauto' in /etc/crypttab (bnc#742774) +Patch208: parse-crypttab-for-noauto-option.patch # UDEV PATCHES # ============ @@ -790,6 +792,7 @@ cp %{SOURCE7} m4/ %patch205 -p1 %patch206 -p0 %patch207 -p0 +%patch208 -p1 # udev patches %patch1001 -p1