diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch | 110 |
1 files changed, 56 insertions, 54 deletions
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch index fb8443d6f5..0ea2da321c 100644 --- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch | |||
@@ -1,72 +1,74 @@ | |||
1 | Upstream-Status: Denied [no desire for uclibc support] | 1 | Upstream-Status: Denied [no desire for uclibc support] |
2 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 2 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
3 | 3 | ||
4 | Index: git/src/journal/journal-send.c | 4 | Index: systemd-204/src/journal/journal-send.c |
5 | =================================================================== | 5 | =================================================================== |
6 | --- git.orig/src/journal/journal-send.c 2012-09-02 00:10:08.748768268 -0700 | 6 | --- systemd-204.orig/src/journal/journal-send.c 2013-05-06 12:06:04.000000000 -0700 |
7 | +++ git/src/journal/journal-send.c 2012-09-02 00:10:10.508768335 -0700 | 7 | +++ systemd-204/src/journal/journal-send.c 2013-05-23 11:21:14.500338688 -0700 |
8 | @@ -34,6 +34,8 @@ | 8 | @@ -46,6 +46,8 @@ |
9 | 9 | memcpy(*_f + 10, _func, _fl); \ | |
10 | #define SNDBUF_SIZE (8*1024*1024) | 10 | } while(false) |
11 | 11 | ||
12 | +#include "config.h" | 12 | +#include "config.h" |
13 | + | 13 | + |
14 | /* We open a single fd, and we'll share it with the current process, | 14 | /* We open a single fd, and we'll share it with the current process, |
15 | * all its threads, and all its subprocesses. This means we need to | 15 | * all its threads, and all its subprocesses. This means we need to |
16 | * initialize it atomically, and need to operate on it atomically | 16 | * initialize it atomically, and need to operate on it atomically |
17 | @@ -293,7 +295,12 @@ | 17 | @@ -312,8 +314,13 @@ |
18 | /* Message doesn't fit... Let's dump the data in a temporary | ||
18 | * file and just pass a file descriptor of it to the other | 19 | * file and just pass a file descriptor of it to the other |
19 | * side */ | 20 | * side */ |
20 | 21 | - | |
21 | +#ifdef HAVE_MKOSTEMP | 22 | +#ifdef HAVE_MKOSTEMP |
22 | buffer_fd = mkostemp(path, O_CLOEXEC|O_RDWR); | 23 | buffer_fd = mkostemp(path, O_CLOEXEC|O_RDWR); |
23 | +#else | 24 | +#else |
24 | + buffer_fd = mkstemp(path); | 25 | + buffer_fd = mkstemp(path); |
25 | + if (buffer_fd >= 0) fcntl(buffer_fd, F_SETFD, FD_CLOEXEC); | 26 | + if (buffer_fd >= 0) fcntl(buffer_fd, F_SETFD, FD_CLOEXEC); |
26 | +#endif /* HAVE_MKOSTEMP */ | 27 | +#endif /* HAVE_MKOSTEMP */ |
27 | if (buffer_fd < 0) { | 28 | + |
28 | r = -errno; | 29 | if (buffer_fd < 0) |
29 | goto finish; | 30 | return -errno; |
30 | Index: git/src/core/manager.c | 31 | |
32 | Index: systemd-204/src/core/manager.c | ||
31 | =================================================================== | 33 | =================================================================== |
32 | --- git.orig/src/core/manager.c 2012-09-02 00:10:08.732768266 -0700 | 34 | --- systemd-204.orig/src/core/manager.c 2013-04-25 17:53:56.000000000 -0700 |
33 | +++ git/src/core/manager.c 2012-09-02 00:10:10.512768334 -0700 | 35 | +++ systemd-204/src/core/manager.c 2013-05-23 11:23:15.864340878 -0700 |
34 | @@ -67,6 +67,8 @@ | 36 | @@ -72,6 +72,8 @@ |
35 | #include "cgroup-util.h" | 37 | #include "audit-fd.h" |
36 | #include "path-util.h" | 38 | #include "env-util.h" |
37 | 39 | ||
38 | +#include "config.h" | 40 | +#include "config.h" |
39 | + | 41 | + |
40 | /* As soon as 16 units are in our GC queue, make sure to run a gc sweep */ | 42 | /* As soon as 16 units are in our GC queue, make sure to run a gc sweep */ |
41 | #define GC_QUEUE_ENTRIES_MAX 16 | 43 | #define GC_QUEUE_ENTRIES_MAX 16 |
42 | 44 | ||
43 | @@ -1701,7 +1703,12 @@ | 45 | @@ -1973,7 +1975,12 @@ |
44 | return -ENOMEM; | 46 | return -ENOMEM; |
45 | 47 | ||
46 | saved_umask = umask(0077); | 48 | RUN_WITH_UMASK(0077) { |
47 | +#ifdef HAVE_MKOSTEMP | 49 | +#ifdef HAVE_MKOSTEMP |
48 | fd = mkostemp(path, O_RDWR|O_CLOEXEC); | 50 | fd = mkostemp(path, O_RDWR|O_CLOEXEC); |
49 | +#else | 51 | +#else |
50 | + fd = mkstemp(path); | 52 | + fd = mkstemp(path); |
51 | + if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); | 53 | + if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); |
52 | +#endif /* HAVE_MKOSTEMP */ | 54 | +#endif /* HAVE_MKOSTEMP */ |
53 | umask(saved_umask); | 55 | } |
54 | 56 | ||
55 | if (fd < 0) { | 57 | if (fd < 0) { |
56 | Index: git/src/shared/util.c | 58 | Index: systemd-204/src/shared/util.c |
57 | =================================================================== | 59 | =================================================================== |
58 | --- git.orig/src/shared/util.c 2012-09-02 00:10:08.784768269 -0700 | 60 | --- systemd-204.orig/src/shared/util.c 2013-05-07 12:07:22.000000000 -0700 |
59 | +++ git/src/shared/util.c 2012-09-02 00:10:10.512768334 -0700 | 61 | +++ systemd-204/src/shared/util.c 2013-05-23 11:19:35.028336822 -0700 |
60 | @@ -68,6 +68,8 @@ | 62 | @@ -74,6 +74,8 @@ |
61 | #include "exit-status.h" | 63 | #include "env-util.h" |
62 | #include "hashmap.h" | 64 | #include "fileio.h" |
63 | 65 | ||
64 | +#include "config.h" | 66 | +#include "config.h" |
65 | + | 67 | + |
66 | int saved_argc = 0; | 68 | int saved_argc = 0; |
67 | char **saved_argv = NULL; | 69 | char **saved_argv = NULL; |
68 | 70 | ||
69 | @@ -4519,7 +4521,12 @@ | 71 | @@ -3921,7 +3923,12 @@ |
70 | t[k] = '.'; | 72 | t[k] = '.'; |
71 | stpcpy(stpcpy(t+k+1, fn), "XXXXXX"); | 73 | stpcpy(stpcpy(t+k+1, fn), "XXXXXX"); |
72 | 74 | ||
@@ -79,10 +81,10 @@ Index: git/src/shared/util.c | |||
79 | if (fd < 0) { | 81 | if (fd < 0) { |
80 | free(t); | 82 | free(t); |
81 | return -errno; | 83 | return -errno; |
82 | Index: git/src/shared/ask-password-api.c | 84 | Index: systemd-204/src/shared/ask-password-api.c |
83 | =================================================================== | 85 | =================================================================== |
84 | --- git.orig/src/shared/ask-password-api.c 2012-09-02 00:10:08.772768268 -0700 | 86 | --- systemd-204.orig/src/shared/ask-password-api.c 2013-04-08 08:26:34.000000000 -0700 |
85 | +++ git/src/shared/ask-password-api.c 2012-09-02 00:10:10.512768334 -0700 | 87 | +++ systemd-204/src/shared/ask-password-api.c 2013-05-23 11:24:43.456342451 -0700 |
86 | @@ -37,6 +37,8 @@ | 88 | @@ -37,6 +37,8 @@ |
87 | 89 | ||
88 | #include "ask-password-api.h" | 90 | #include "ask-password-api.h" |
@@ -92,24 +94,24 @@ Index: git/src/shared/ask-password-api.c | |||
92 | static void backspace_chars(int ttyfd, size_t p) { | 94 | static void backspace_chars(int ttyfd, size_t p) { |
93 | 95 | ||
94 | if (ttyfd < 0) | 96 | if (ttyfd < 0) |
95 | @@ -326,7 +328,12 @@ | 97 | @@ -325,7 +327,12 @@ |
96 | mkdir_p_label("/run/systemd/ask-password", 0755); | 98 | mkdir_p_label("/run/systemd/ask-password", 0755); |
97 | 99 | ||
98 | u = umask(0022); | 100 | RUN_WITH_UMASK(0022) { |
99 | +#ifdef HAVE_MKOSTEMP | 101 | +#ifdef HAVE_MKOSTEMP |
100 | fd = mkostemp(temp, O_CLOEXEC|O_CREAT|O_WRONLY); | 102 | fd = mkostemp(temp, O_CLOEXEC|O_CREAT|O_WRONLY); |
101 | +#else | 103 | +#else |
102 | + fd = mkstemp(temp); | 104 | + fd = mkstemp(temp); |
103 | + if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); | 105 | + if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); |
104 | +#endif /* HAVE_MKOSTEMP */ | 106 | +#endif /* HAVE_MKOSTEMP */ |
105 | umask(u); | 107 | } |
106 | 108 | ||
107 | if (fd < 0) { | 109 | if (fd < 0) { |
108 | Index: git/src/journal/journalctl.c | 110 | Index: systemd-204/src/journal/journalctl.c |
109 | =================================================================== | 111 | =================================================================== |
110 | --- git.orig/src/journal/journalctl.c 2012-09-02 00:10:08.752768267 -0700 | 112 | --- systemd-204.orig/src/journal/journalctl.c 2013-05-07 12:07:22.000000000 -0700 |
111 | +++ git/src/journal/journalctl.c 2012-09-02 00:18:41.928787779 -0700 | 113 | +++ systemd-204/src/journal/journalctl.c 2013-05-23 11:19:35.028336822 -0700 |
112 | @@ -540,7 +540,13 @@ | 114 | @@ -755,7 +755,13 @@ |
113 | n /= arg_interval; | 115 | n /= arg_interval; |
114 | 116 | ||
115 | close_nointr_nofail(fd); | 117 | close_nointr_nofail(fd); |
@@ -123,11 +125,11 @@ Index: git/src/journal/journalctl.c | |||
123 | if (fd < 0) { | 125 | if (fd < 0) { |
124 | log_error("Failed to open %s: %m", k); | 126 | log_error("Failed to open %s: %m", k); |
125 | r = -errno; | 127 | r = -errno; |
126 | Index: git/src/journal/journal-verify.c | 128 | Index: systemd-204/src/journal/journal-verify.c |
127 | =================================================================== | 129 | =================================================================== |
128 | --- git.orig/src/journal/journal-verify.c 2012-09-02 00:10:08.752768267 -0700 | 130 | --- systemd-204.orig/src/journal/journal-verify.c 2012-11-20 13:42:23.000000000 -0800 |
129 | +++ git/src/journal/journal-verify.c 2012-09-02 00:24:10.268800268 -0700 | 131 | +++ systemd-204/src/journal/journal-verify.c 2013-05-23 11:19:35.032336822 -0700 |
130 | @@ -693,8 +693,12 @@ | 132 | @@ -700,8 +700,12 @@ |
131 | #endif | 133 | #endif |
132 | } else if (f->seal) | 134 | } else if (f->seal) |
133 | return -ENOKEY; | 135 | return -ENOKEY; |
@@ -141,7 +143,7 @@ Index: git/src/journal/journal-verify.c | |||
141 | if (data_fd < 0) { | 143 | if (data_fd < 0) { |
142 | log_error("Failed to create data file: %m"); | 144 | log_error("Failed to create data file: %m"); |
143 | r = -errno; | 145 | r = -errno; |
144 | @@ -702,7 +706,12 @@ | 146 | @@ -709,7 +713,12 @@ |
145 | } | 147 | } |
146 | unlink(data_path); | 148 | unlink(data_path); |
147 | 149 | ||
@@ -154,7 +156,7 @@ Index: git/src/journal/journal-verify.c | |||
154 | if (entry_fd < 0) { | 156 | if (entry_fd < 0) { |
155 | log_error("Failed to create entry file: %m"); | 157 | log_error("Failed to create entry file: %m"); |
156 | r = -errno; | 158 | r = -errno; |
157 | @@ -710,7 +719,12 @@ | 159 | @@ -717,7 +726,12 @@ |
158 | } | 160 | } |
159 | unlink(entry_path); | 161 | unlink(entry_path); |
160 | 162 | ||