commit systemd for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package systemd for openSUSE:Factory checked in at 2014-05-02 20:51:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/systemd (Old) and /work/SRC/openSUSE:Factory/.systemd.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "systemd" Changes: -------- --- /work/SRC/openSUSE:Factory/systemd/systemd-mini.changes 2014-04-26 11:45:05.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.systemd.new/systemd-mini.changes 2014-05-02 20:51:27.000000000 +0200 @@ -1,0 +2,36 @@ +Fri May 2 10:12:26 UTC 2014 - werner@suse.de + +- Add patch shut-up-annoying-assertion-monotonic-clock-message.patch + to avoid annyoing messages on failing dual_timestamp_is_set in the + kernel's message ring buffer + +------------------------------------------------------------------- +Wed Apr 30 12:14:32 UTC 2014 - werner@suse.de + +- Update udev-generate-peristent-rule.sh from latest git + +------------------------------------------------------------------- +Wed Apr 30 10:55:54 UTC 2014 - werner@suse.de + +- Modify and extend patch + 0001-On_s390_con3270_disable_ANSI_colour_esc.patch + to avoid also ANSI escape sequences for busy jobs on s390 + +------------------------------------------------------------------- +Mon Apr 28 09:51:35 UTC 2014 - werner@suse.de + +- Add or port upstram bugfix patches: + 0001-bash-completion-fix-__get_startable_units.patch + 0002-sysctl-replaces-some-slashes-with-dots.patch + 0003-delta-do-not-use-unicode-chars-in-C-locale.patch + 0004-implement-a-union-to-pad-out-file_handle.patch +- Add patch respect-nfs-bg-option.patch from Thomas Blume: + System fails to boot if nfs mounts get added to fstab (bnc#874665) + +------------------------------------------------------------------- +Wed Apr 23 11:46:41 UTC 2014 - oneukum@suse.com + +- Do not use runtime PM for some IBM consoles (bnc#868931) + 1013-no-runtime-PM-for-IBM-consoles.patch + +------------------------------------------------------------------- systemd.changes: same change New: ---- 0001-bash-completion-fix-__get_startable_units.patch 0002-sysctl-replaces-some-slashes-with-dots.patch 0003-delta-do-not-use-unicode-chars-in-C-locale.patch 0004-implement-a-union-to-pad-out-file_handle.patch 1013-no-runtime-PM-for-IBM-consoles.patch respect-nfs-bg-option.patch shut-up-annoying-assertion-monotonic-clock-message.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ systemd-mini.spec ++++++ --- /var/tmp/diff_new_pack.7uSWKo/_old 2014-05-02 20:51:29.000000000 +0200 +++ /var/tmp/diff_new_pack.7uSWKo/_new 2014-05-02 20:51:29.000000000 +0200 @@ -387,6 +387,18 @@ Patch197: rescue-emergency-target-conflicts.patch # PATCH-FIX-SUSE Avoid a divide by zero sigtrap Patch198: avoid-divide-by-zero-sigtrap.patch +# PATCH-FIX-USTREAM added at 2014/04/28 +Patch199: 0001-bash-completion-fix-__get_startable_units.patch +# PATCH-FIX-USTREAM added at 2014/04/28 +Patch200: 0002-sysctl-replaces-some-slashes-with-dots.patch +# PATCH-FIX-USTREAM added at 2014/04/28 +Patch201: 0003-delta-do-not-use-unicode-chars-in-C-locale.patch +# PATCH-FIX-USTREAM added at 2014/04/28 +Patch202: 0004-implement-a-union-to-pad-out-file_handle.patch +# PATCH-FIX-SUSE System fails to boot if nfs mounts get added to fstab (bnc#874665) +Patch203: respect-nfs-bg-option.patch +# PATCH-FIX-UPSTREAM Stop useless messages on dual_timestamp_is_set is failed. +Patch204: shut-up-annoying-assertion-monotonic-clock-message.patch # UDEV PATCHES # ============ @@ -418,6 +430,8 @@ Patch1011: 1011-64-btrfs.rules-skip-btrfs-check-if-devices-are-not-r.patch # PATCH-FIX-SUSE skip persistent device link creation on mp device (bnc#872929) Patch1012: 1012-Skip-persistent-device-link-creation-on-multipath-de.patch +# PATCH-FIX-SUSE Do not use runtime PM for some IBM consoles (bnc#868931) +Patch1013: 1013-no-runtime-PM-for-IBM-consoles.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -764,6 +778,12 @@ %patch196 -p1 %patch197 -p1 %patch198 -p1 +%patch199 -p0 +%patch200 -p0 +%patch201 -p0 +%patch202 -p0 +%patch203 -p1 +%patch204 -p1 # udev patches %patch1001 -p1 @@ -779,6 +799,7 @@ %patch1010 -p1 %patch1011 -p1 %patch1012 -p1 +%patch1013 -p1 # ensure generate files are removed rm -f units/emergency.service systemd.spec: same change ++++++ 0001-On_s390_con3270_disable_ANSI_colour_esc.patch ++++++ --- /var/tmp/diff_new_pack.7uSWKo/_old 2014-05-02 20:51:29.000000000 +0200 +++ /var/tmp/diff_new_pack.7uSWKo/_new 2014-05-02 20:51:29.000000000 +0200 @@ -1,8 +1,9 @@ --- - rules/99-systemd.rules.in | 2 - - src/getty-generator/getty-generator.c | 2 - - src/shared/util.c | 62 ++++++++++++++++++++++++++++++++-- - 3 files changed, 61 insertions(+), 5 deletions(-) + rules/99-systemd.rules.in | 2 - + src/core/manager.c | 24 +++++++++++--- + src/shared/util.c | 77 ++++++++++++++++++++++++++++++++++++++++++++-- + src/shared/util.h | 1 + 4 files changed, 95 insertions(+), 9 deletions(-) --- systemd-208/rules/99-systemd.rules.in +++ systemd-208/rules/99-systemd.rules.in 2014-02-05 10:34:17.346235540 +0000 @@ -15,34 +16,92 @@ KERNEL=="vport*", TAG+="systemd" ---- systemd-208/src/shared/util.c -+++ systemd-208/src/shared/util.c 2014-01-31 11:54:07.222235280 +0000 -@@ -2967,6 +2967,7 @@ int status_vprintf(const char *status, b +--- systemd-210/src/core/manager.c ++++ systemd-210/src/core/manager.c 2014-04-30 10:51:43.398735332 +0000 +@@ -110,7 +110,7 @@ static int manager_watch_jobs_in_progres + + #define CYLON_BUFFER_EXTRA (2*(sizeof(ANSI_RED_ON)-1) + sizeof(ANSI_HIGHLIGHT_RED_ON)-1 + 2*(sizeof(ANSI_HIGHLIGHT_OFF)-1)) + +-static void draw_cylon(char buffer[], size_t buflen, unsigned width, unsigned pos) { ++static void draw_cylon(char buffer[], size_t buflen, unsigned width, unsigned pos, bool ansi_console) { + char *p = buffer; + + assert(buflen >= CYLON_BUFFER_EXTRA + width + 1); +@@ -119,12 +119,14 @@ static void draw_cylon(char buffer[], si + if (pos > 1) { + if (pos > 2) + p = mempset(p, ' ', pos-2); +- p = stpcpy(p, ANSI_RED_ON); ++ if (ansi_console) ++ p = stpcpy(p, ANSI_RED_ON); + *p++ = '*'; + } + + if (pos > 0 && pos <= width) { +- p = stpcpy(p, ANSI_HIGHLIGHT_RED_ON); ++ if (ansi_console) ++ p = stpcpy(p, ANSI_HIGHLIGHT_RED_ON); + *p++ = '*'; + } + +@@ -135,7 +137,8 @@ static void draw_cylon(char buffer[], si + *p++ = '*'; + if (pos < width-1) + p = mempset(p, ' ', width-1-pos); +- strcpy(p, ANSI_HIGHLIGHT_OFF); ++ if (ansi_console) ++ strcpy(p, ANSI_HIGHLIGHT_OFF); + } + } + +@@ -150,6 +153,7 @@ void manager_flip_auto_status(Manager *m + } + + static void manager_print_jobs_in_progress(Manager *m) { ++ static int is_ansi_console = -1; + _cleanup_free_ char *job_of_n = NULL; + Iterator i; + Job *j; +@@ -174,10 +178,20 @@ static void manager_print_jobs_in_progre + assert(counter == print_nr + 1); + assert(j); + ++ if (_unlikely_(is_ansi_console < 0)) { ++ int fd = open_terminal("/dev/console", O_RDONLY|O_NOCTTY|O_CLOEXEC); ++ if (fd < 0) ++ is_ansi_console = 0; ++ else { ++ is_ansi_console = (int)ansi_console(fd); ++ close(fd); ++ } ++ } ++ + cylon_pos = m->jobs_in_progress_iteration % 14; + if (cylon_pos >= 8) + cylon_pos = 14 - cylon_pos; +- draw_cylon(cylon, sizeof(cylon), 6, cylon_pos); ++ draw_cylon(cylon, sizeof(cylon), 6, cylon_pos, (bool)is_ansi_console); + + m->jobs_in_progress_iteration++; + +--- systemd-210/src/shared/util.c ++++ systemd-210/src/shared/util.c 2014-04-30 10:39:17.154736438 +0000 +@@ -2886,6 +2886,7 @@ int status_vprintf(const char *status, b struct iovec iovec[6] = {}; int n = 0; static bool prev_ephemeral; -+ static int cached_on_tty = -1; ++ static int is_ansi_console = -1; assert(format); -@@ -2980,6 +2981,51 @@ int status_vprintf(const char *status, b +@@ -2899,6 +2900,41 @@ int status_vprintf(const char *status, b if (fd < 0) return fd; -+ if (_unlikely_(cached_on_tty < 0)) { -+ cached_on_tty = isatty(fd) > 0; -+ if (cached_on_tty) { -+ const char *e = getenv("TERM"); -+ if (e && (strcmp(e, "dumb") == 0 || strcmp(e, "ibm327x") == 0)) { -+ char *mode = NULL; -+ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode", &mode, NULL); -+ if (r < 0 || !mode || !streq(mode, "3270")) -+ cached_on_tty = 0; -+ } -+ } -+ } ++ if (_unlikely_(is_ansi_console < 0)) ++ is_ansi_console = (int)ansi_console(fd); + -+ if (status && !cached_on_tty) { ++ if (status && !is_ansi_console) { + const char *esc, *ptr; + esc = strchr(status, 0x1B); + if (esc && (ptr = strpbrk(esc, "SOFDTI*"))) { @@ -77,14 +136,14 @@ if (ellipse) { char *e; size_t emax, sl; -@@ -3002,8 +3048,12 @@ int status_vprintf(const char *status, b +@@ -2921,8 +2957,12 @@ int status_vprintf(const char *status, b } } - if (prev_ephemeral) - IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE); + if (prev_ephemeral) { -+ if (cached_on_tty) ++ if (is_ansi_console) + IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE); + else + IOVEC_SET_STRING(iovec[n++], "\r"); @@ -92,7 +151,7 @@ prev_ephemeral = ephemeral; if (status) { -@@ -3267,8 +3317,14 @@ void columns_lines_cache_reset(int signu +@@ -3169,12 +3209,43 @@ void columns_lines_cache_reset(int signu bool on_tty(void) { static int cached_on_tty = -1; @@ -101,10 +160,49 @@ cached_on_tty = isatty(STDOUT_FILENO) > 0; + if (cached_on_tty) { + const char *e = getenv("TERM"); -+ if (e && (strcmp(e, "dumb") == 0)) -+ cached_on_tty = 0; ++ if (!e) ++ return cached_on_tty; ++ if (streq(e, "dumb") || strneq(e, "ibm3", 4)) { ++ char *mode = NULL; ++ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode", &mode, NULL); ++ if (r < 0 || !mode || !streq(mode, "3270")) ++ cached_on_tty = 0; ++ } + } + } return cached_on_tty; } + ++bool ansi_console(int fd) { ++ static int cached_ansi_console = -1; ++ ++ if (_unlikely_(cached_ansi_console < 0)) { ++ cached_ansi_console = isatty(fd) > 0; ++ if (cached_ansi_console) { ++ const char *e = getenv("TERM"); ++ if (e && (streq(e, "dumb") || strneq(e, "ibm3", 4))) { ++ char *mode = NULL; ++ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode", &mode, NULL); ++ if (r < 0 || !mode || !streq(mode, "3270")) ++ cached_ansi_console = 0; ++ } ++ } ++ } ++ ++ return cached_ansi_console; ++} ++ + int running_in_chroot(void) { + struct stat a = {}, b = {}; + +--- systemd-210/src/shared/util.h ++++ systemd-210/src/shared/util.h 2014-04-30 10:24:51.134235665 +0000 +@@ -418,6 +418,7 @@ unsigned lines(void); + void columns_lines_cache_reset(int _unused_ signum); + + bool on_tty(void); ++bool ansi_console(int fd); + + static inline const char *ansi_highlight(void) { + return on_tty() ? ANSI_HIGHLIGHT_ON : ""; ++++++ 0001-bash-completion-fix-__get_startable_units.patch ++++++
From a163b64c4b08e8a4ad39a9a295acf3d1634024a3 Mon Sep 17 00:00:00 2001 From: Dan Kilman
Date: Sun, 13 Apr 2014 18:06:13 +0300 Subject: [PATCH] bash completion: fix __get_startable_units
--- shell-completion/bash/systemctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git shell-completion/bash/systemctl shell-completion/bash/systemctl index 992e52d..e1c8420 100644 --- shell-completion/bash/systemctl +++ shell-completion/bash/systemctl @@ -56,7 +56,7 @@ __get_all_units () { __systemctl $1 list-units --all \ __get_active_units () { __systemctl $1 list-units \ | { while read -r a b; do echo " $a"; done; }; } __get_startable_units () { __systemctl $1 list-units --all -t service,timer,socket,mount,automount,path,snapshot,swap \ - | { while read -r a b c d; do [[ $c == "inactive" || $c == "failed " ]] && echo " $a"; done; }; } + | { while read -r a b c d; do [[ $c == "inactive" || $c == "failed" ]] && echo " $a"; done; }; } __get_failed_units () { __systemctl $1 list-units \ | { while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }; } __get_enabled_units () { __systemctl $1 list-unit-files \ -- 1.7.9.2 ++++++ 0002-sysctl-replaces-some-slashes-with-dots.patch ++++++
From 2e573fcf8754fdfe0db0a783b1631ec1679b063a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?=
Date: Wed, 16 Apr 2014 21:33:46 -0400 Subject: [PATCH] sysctl: replaces some slashes with dots
It turns out that plain sysctl understands a.b/c syntax to write to /proc/sys/a/b.c. Support this for compatibility. https://bugs.freedesktop.org/show_bug.cgi?id=77466 --- man/sysctl.d.xml | 29 +++++++++++++++++++++-------- src/sysctl/sysctl.c | 18 ++++++++++++++++-- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git man/sysctl.d.xml man/sysctl.d.xml index 00a857b..db53b49 100644 --- man/sysctl.d.xml +++ man/sysctl.d.xml @@ -68,13 +68,26 @@ <para>The configuration files contain a list of variable assignments, separated by newlines. Empty lines and lines whose first non-whitespace character - is # or ; are ignored.</para> - - <para>Note that both / and . are accepted as label - separators within sysctl variable - names. <literal>kernel.domainname=foo</literal> and - <literal>kernel/domainname=foo</literal> hence are - entirely equivalent.</para> + is <literal>#</literal> or <literal>;</literal> are + ignored.</para> + + <para>Note that either <literal>/</literal> or + <literal>.</literal> may be used as separators within + sysctl variable names. If the first separator is a + slash, remaining slashes and dots are left intact. If + the first separator is a dot, dots and slashes are + interchanged. <literal>kernel.domainname=foo</literal> + and <literal>kernel/domainname=foo</literal> are + equivalent and will cause <literal>foo</literal> to + be written to + <filename>/proc/sys/kernel/domainname</filename>. + Either + <literal>net.ipv4.conf.enp3s0/200.forwarding</literal> + or + <literal>net/ipv4/conf/enp3s0.200/forwarding</literal> + may be used to refer to + <filename>/proc/sys/net/ipv4/conf/enp3s0.200/forwarding</filename>. + </para> <para>Each configuration file shall be named in the style of <filename><replaceable>program</replaceable>.conf</filename>. @@ -109,7 +122,7 @@ early on boot. The network interface-specific options will also be applied individually for each network interface as it shows up in the system. (More - specifically, that is + specifically, <filename>net.ipv4.conf.*</filename>, <filename>net.ipv6.conf.*</filename>, <filename>net.ipv4.neigh.*</filename> and <filename>net.ipv6.neigh.*</filename>)</para> diff --git src/sysctl/sysctl.c src/sysctl/sysctl.c index 283eefe..06defa5 100644 --- src/sysctl/sysctl.c +++ src/sysctl/sysctl.c @@ -48,12 +48,26 @@ static const char conf_file_dirs[] = #endif ; -static char *normalize_sysctl(char *s) { +static char* normalize_sysctl(char *s) { char *n; - for (n = s; *n; n++) + n = strpbrk(s, "/."); + /* If the first separator is a slash, the path is + * assumed to be normalized and slashes remain slashes + * and dots remains dots. */ + if (!n || *n == '/') + return s; + + /* Otherwise, dots become slashes and slashes become + * dots. Fun. */ + while (n) { if (*n == '.') *n = '/'; + else + *n = '.'; + + n = strpbrk(n + 1, "/."); + } return s; } -- 1.7.9.2 ++++++ 0003-delta-do-not-use-unicode-chars-in-C-locale.patch ++++++
From 00a5cc3a63c125633e822f39efd9c32223169f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?=
Date: Wed, 16 Apr 2014 23:33:41 -0400 Subject: [PATCH] delta: do not use unicode chars in C locale
https://bugzilla.redhat.com/show_bug.cgi?id=1088418 --- src/delta/delta.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git src/delta/delta.c src/delta/delta.c index 369f8f8..8fc37c5 100644 --- src/delta/delta.c +++ src/delta/delta.c @@ -85,6 +85,10 @@ static void pager_open_if_enabled(void) { pager_open(false); } +static inline const char* arrow(void) { + return is_locale_utf8() ? "→" : "->"; +} + static int equivalent(const char *a, const char *b) { _cleanup_free_ char *x = NULL, *y = NULL; @@ -103,8 +107,9 @@ static int notify_override_masked(const char *top, const char *bottom) { if (!(arg_flags & SHOW_MASKED)) return 0; - printf("%s%s%s %s → %s\n", - ansi_highlight_red(), "[MASKED]", ansi_highlight_off(), top, bottom); + printf("%s%s%s %s %s %s\n", + ansi_highlight_red(), "[MASKED]", ansi_highlight_off(), + top, arrow(), bottom); return 1; } @@ -112,8 +117,9 @@ static int notify_override_equivalent(const char *top, const char *bottom) { if (!(arg_flags & SHOW_EQUIVALENT)) return 0; - printf("%s%s%s %s → %s\n", - ansi_highlight_green(), "[EQUIVALENT]", ansi_highlight_off(), top, bottom); + printf("%s%s%s %s %s %s\n", + ansi_highlight_green(), "[EQUIVALENT]", ansi_highlight_off(), + top, arrow(), bottom); return 1; } @@ -121,8 +127,9 @@ static int notify_override_redirected(const char *top, const char *bottom) { if (!(arg_flags & SHOW_REDIRECTED)) return 0; - printf("%s%s%s %s → %s\n", - ansi_highlight(), "[REDIRECTED]", ansi_highlight_off(), top, bottom); + printf("%s%s%s %s %s %s\n", + ansi_highlight(), "[REDIRECTED]", ansi_highlight_off(), + top, arrow(), bottom); return 1; } @@ -130,8 +137,9 @@ static int notify_override_overridden(const char *top, const char *bottom) { if (!(arg_flags & SHOW_OVERRIDDEN)) return 0; - printf("%s%s%s %s → %s\n", - ansi_highlight(), "[OVERRIDDEN]", ansi_highlight_off(), top, bottom); + printf("%s%s%s %s %s %s\n", + ansi_highlight(), "[OVERRIDDEN]", ansi_highlight_off(), + top, arrow(), bottom); return 1; } @@ -139,8 +147,9 @@ static int notify_override_extended(const char *top, const char *bottom) { if (!(arg_flags & SHOW_EXTENDED)) return 0; - printf("%s%s%s %s → %s\n", - ansi_highlight(), "[EXTENDED]", ansi_highlight_off(), top, bottom); + printf("%s%s%s %s %s %s\n", + ansi_highlight(), "[EXTENDED]", ansi_highlight_off(), + top, arrow(), bottom); return 1; } @@ -241,7 +250,7 @@ static int enumerate_dir_d(Hashmap *top, Hashmap *bottom, Hashmap *drops, const return -ENOMEM; d = p + strlen(toppath) + 1; - log_debug("Adding at top: %s → %s", d, p); + log_debug("Adding at top: %s %s %s", d, arrow(), p); k = hashmap_put(top, d, p); if (k >= 0) { p = strdup(p); @@ -253,7 +262,7 @@ static int enumerate_dir_d(Hashmap *top, Hashmap *bottom, Hashmap *drops, const return k; } - log_debug("Adding at bottom: %s → %s", d, p); + log_debug("Adding at bottom: %s %s %s", d, arrow(), p); free(hashmap_remove(bottom, d)); k = hashmap_put(bottom, d, p); if (k < 0) { @@ -276,7 +285,8 @@ static int enumerate_dir_d(Hashmap *top, Hashmap *bottom, Hashmap *drops, const if (!p) return -ENOMEM; - log_debug("Adding to drops: %s → %s → %s", unit, basename(p), p); + log_debug("Adding to drops: %s %s %s %s %s", + unit, arrow(), basename(p), arrow(), p); k = hashmap_put(h, basename(p), p); if (k < 0) { free(p); @@ -328,7 +338,7 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, Hashmap *drops, const ch if (!p) return -ENOMEM; - log_debug("Adding at top: %s → %s", basename(p), p); + log_debug("Adding at top: %s %s %s", basename(p), arrow(), p); k = hashmap_put(top, basename(p), p); if (k >= 0) { p = strdup(p); @@ -339,7 +349,7 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, Hashmap *drops, const ch return k; } - log_debug("Adding at bottom: %s → %s", basename(p), p); + log_debug("Adding at bottom: %s %s %s", basename(p), arrow(), p); free(hashmap_remove(bottom, basename(p))); k = hashmap_put(bottom, basename(p), p); if (k < 0) { -- 1.7.9.2 ++++++ 0004-implement-a-union-to-pad-out-file_handle.patch ++++++
From 370c860f748d149097710dc7952a64f627db9de7 Mon Sep 17 00:00:00 2001 From: Dave Reisner
Date: Sat, 19 Apr 2014 13:22:35 -0400 Subject: [PATCH] implement a union to pad out file_handle
Cases where name_to_handle_at is used allocated the full struct to be
MAX_HANDLE_SZ, and assigned this size to handle_bytes. This is wrong
since handle_bytes should describe the length of the flexible array
member and not the whole struct.
Define a union type which includes sufficient padding to allow
assignment of MAX_HANDLE_SZ to be correct.
---
src/libudev/libudev-monitor.c | 6 ++----
src/readahead/readahead-common.c | 6 ++----
src/shared/util.h | 6 ++++++
src/tmpfiles/tmpfiles.c | 11 ++++-------
4 files changed, 14 insertions(+), 15 deletions(-)
diff --git src/libudev/libudev-monitor.c src/libudev/libudev-monitor.c
index 3f7436b..0a2ab82 100644
--- src/libudev/libudev-monitor.c
+++ src/libudev/libudev-monitor.c
@@ -108,15 +108,13 @@ static struct udev_monitor *udev_monitor_new(struct udev *udev)
/* we consider udev running when /dev is on devtmpfs */
static bool udev_has_devtmpfs(struct udev *udev) {
- struct file_handle *h;
+ union file_handle_union h = { .handle.handle_bytes = MAX_HANDLE_SZ, };
int mount_id;
_cleanup_fclose_ FILE *f = NULL;
char line[LINE_MAX], *e;
int r;
- h = alloca(MAX_HANDLE_SZ);
- h->handle_bytes = MAX_HANDLE_SZ;
- r = name_to_handle_at(AT_FDCWD, "/dev", h, &mount_id, 0);
+ r = name_to_handle_at(AT_FDCWD, "/dev", &h.handle, &mount_id, 0);
if (r < 0)
return false;
diff --git src/readahead/readahead-common.c src/readahead/readahead-common.c
index 5ffa88b..49679fc 100644
--- src/readahead/readahead-common.c
+++ src/readahead/readahead-common.c
@@ -75,7 +75,7 @@ int fs_on_ssd(const char *p) {
if (major(st.st_dev) == 0) {
_cleanup_fclose_ FILE *f = NULL;
int mount_id;
- struct file_handle *h;
+ union file_handle_union h = { .handle.handle_bytes = MAX_HANDLE_SZ, };
/* Might be btrfs, which exposes "ssd" as mount flag if it is on ssd.
*
@@ -83,9 +83,7 @@ int fs_on_ssd(const char *p) {
* and then lookup the mount ID in mountinfo to find
* the mount options. */
- h = alloca(MAX_HANDLE_SZ);
- h->handle_bytes = MAX_HANDLE_SZ;
- r = name_to_handle_at(AT_FDCWD, p, h, &mount_id, AT_SYMLINK_FOLLOW);
+ r = name_to_handle_at(AT_FDCWD, p, &h.handle, &mount_id, AT_SYMLINK_FOLLOW);
if (r < 0)
return false;
diff --git src/shared/util.h src/shared/util.h
index 900f1cf..891848a 100644
--- src/shared/util.h
+++ src/shared/util.h
@@ -22,6 +22,7 @@
***/
#include
participants (1)
-
root@hilbert.suse.de