]> git.pld-linux.org Git - packages/util-linux.git/blob - util-linux-diet.patch
- updated to 2.29.2 (fixes CVE-2017-2616 in su)
[packages/util-linux.git] / util-linux-diet.patch
1 --- util-linux-ng-2.18/libmount/src/fs.c~       2010-06-08 10:44:20.000000000 +0200
2 +++ util-linux-ng-2.18/libmount/src/fs.c        2010-08-26 11:12:31.326572794 +0200
3 @@ -17,6 +17,9 @@
4  #include <errno.h>
5  #include <blkid.h>
6  #include <stddef.h>
7 +#ifdef __dietlibc__
8 +#include <sys/stat.h> /* for major and minor macros */
9 +#endif
10  
11  #include "nls.h"
12  #include "mountP.h"
13 --- util-linux-ng-2.18/libmount/src/tab_parse.c~        2010-06-07 12:35:06.000000000 +0200
14 +++ util-linux-ng-2.18/libmount/src/tab_parse.c 2010-08-26 11:16:35.762572782 +0200
15 @@ -9,6 +9,9 @@
16  #include <limits.h>
17  #include <dirent.h>
18  #include <fcntl.h>
19 +#ifdef __dietlibc__
20 +#include <sys/stat.h> /* for makedev macro */
21 +#endif
22  
23  #include "at.h"
24  #include "mangle.h"
25 --- util-linux-2.19/lib/strutils.c~     2011-01-31 16:43:47.000000000 +0100
26 +++ util-linux-2.19/lib/strutils.c      2011-02-10 12:49:12.221843465 +0100
27 @@ -12,6 +12,9 @@
28  #include <sys/stat.h>
29  #include <locale.h>
30  #include <string.h>
31 +#ifdef __dietlibc__
32 +#include <stdint.h>
33 +#endif
34  
35  static int do_scale_by_power (uintmax_t *x, int base, int power)
36  {
37 #--- util-linux-2.19/libmount/src/utils.c~      2011-01-24 23:46:29.000000000 +0100
38 #+++ util-linux-2.19/libmount/src/utils.c       2011-02-10 20:12:00.499611392 +0100
39 #@@ -398,7 +398,11 @@
40 #       int rc = -1;
41 #         struct passwd pwd;
42 #       struct passwd *pw;
43 #+#ifdef _SC_GETPW_R_SIZE_MAX
44 #       size_t sz = sysconf(_SC_GETPW_R_SIZE_MAX);
45 #+#else
46 #+      size_t sz = 0;
47 #+#endif
48 #       char *buf;
49
50 #       if (!username || !uid)
51 #@@ -427,7 +431,11 @@
52 #       int rc = -1;
53 #         struct group grp;
54 #       struct group *gr;
55 #+#ifdef _SC_GETGR_R_SIZE_MAX
56 #       size_t sz = sysconf(_SC_GETGR_R_SIZE_MAX);
57 #+#else
58 #+      size_t sz = 0;
59 #+#endif
60 #       char *buf;
61
62 #       if (!groupname || !gid)
63 --- util-linux-2.19/lib/at.c~   2011-01-31 16:43:47.000000000 +0100
64 +++ util-linux-2.19/lib/at.c    2011-02-10 20:30:37.336797058 +0100
65 @@ -7,6 +7,7 @@
66  #include <stdlib.h>
67  #include <fcntl.h>
68  #include <sys/stat.h>
69 +#include <limits.h>
70  
71  #include "at.h"
72  
73 --- util-linux-2.19/misc-utils/findmnt.c~       2011-01-31 16:43:47.000000000 +0100
74 +++ util-linux-2.19/misc-utils/findmnt.c        2011-02-10 20:54:23.100130391 +0100
75 @@ -36,6 +36,9 @@
76  # include <libudev.h>
77  #endif
78  #include <libmount.h>
79 +#ifdef __dietlibc__
80 +#include <sys/stat.h> /* for major and minor macros */
81 +#endif
82  
83  #include "pathnames.h"
84  #include "nls.h"
85 --- util-linux-2.19/disk-utils/fsck.c~  2011-02-07 16:19:29.000000000 +0100
86 +++ util-linux-2.19/disk-utils/fsck.c   2011-02-10 21:09:27.024658725 +0100
87 @@ -270,7 +270,13 @@
88         if (verbose)
89                 printf(_("Locking disk %s ... "), diskname);
90  
91 -       inst->lock = open(diskname, O_CLOEXEC | O_RDONLY);
92 +       inst->lock = open(diskname,
93 +#ifdef O_CLOEXEC
94 +                       O_CLOEXEC | O_RDONLY
95 +#else
96 +                       O_RDONLY
97 +#endif
98 +                       );
99         if (inst->lock >= 0) {
100                 int rc = -1;
101  
102 --- util-linux-2.21/configure.ac~       2012-02-24 12:53:35.000000000 +0200
103 +++ util-linux-2.21/configure.ac        2012-03-05 21:03:25.833675080 +0200
104 @@ -323,6 +323,7 @@ AC_CHECK_FUNCS([ \
105         llseek \
106         lseek64 \
107         mempcpy \
108 +       mkostemp \
109         nanosleep \
110         personality \
111         posix_fadvise \
112 @@ -330,6 +331,7 @@
113         usleep \
114         warn \
115         warnx \
116 +       versionsort \
117  ])
118  AC_FUNC_FSEEKO
119  
120 --- util-linux-2.19/misc-utils/findfs.c~        2011-01-31 16:43:47.000000000 +0100
121 +++ util-linux-2.19/misc-utils/findfs.c 2011-02-10 22:24:39.615735924 +0100
122 @@ -12,6 +12,7 @@
123  
124  #include <blkid.h>
125  
126 +#include "c.h"
127  #include "nls.h"
128  
129  static void __attribute__((__noreturn__)) usage(int rc)
130 --- util-linux-2.21/libmount/src/tab_parse.c~   2012-03-05 21:00:14.000000000 +0200
131 +++ util-linux-2.21/libmount/src/tab_parse.c    2012-03-05 21:05:27.562569076 +0200
132 @@ -524,7 +524,13 @@
133         DIR *dir = NULL;
134         struct dirent **namelist = NULL;
135  
136 -       n = scandir(dirname, &namelist, mnt_table_parse_dir_filter, versionsort);
137 +       n = scandir(dirname, &namelist, mnt_table_parse_dir_filter,
138 +#ifdef HAVE_VERSIONSORT
139 +               versionsort
140 +#else
141 +               alphasort
142 +#endif
143 +       );
144         if (n <= 0)
145                 return 0;
146  
147 --- util-linux-2.22.1/lib/tt.c.orig     2012-09-20 15:16:51.349635172 +0200
148 +++ util-linux-2.22.1/lib/tt.c  2012-10-13 16:58:37.331962836 +0200
149 @@ -59,11 +59,13 @@
150   */
151  static size_t mbs_safe_width(const char *s)
152  {
153 -       mbstate_t st;
154         const char *p = s;
155         size_t width = 0;
156 +#ifdef HAVE_WIDECHAR
157 +       mbstate_t st;
158  
159         memset(&st, 0, sizeof(st));
160 +#endif
161  
162         while (p && *p) {
163                 if (iscntrl((unsigned char) *p)) {
164 @@ -108,7 +110,9 @@
165   */
166  static char *mbs_safe_encode(const char *s, size_t *width)
167  {
168 +#ifdef HAVE_WIDECHAR
169         mbstate_t st;
170 +#endif
171         const char *p = s;
172         char *res, *r;
173         size_t sz = s ? strlen(s) : 0;
174 @@ -117,8 +121,9 @@
175         if (!sz)
176                 return NULL;
177  
178 +#ifdef HAVE_WIDECHAR
179         memset(&st, 0, sizeof(st));
180 -
181 +#endif
182         res = malloc((sz * 4) + 1);
183         if (!res)
184                 return NULL;
185 --- util-linux-2.22.1/include/ttyutils.h.orig   2012-09-20 15:16:51.343635134 +0200
186 +++ util-linux-2.22.1/include/ttyutils.h        2012-10-13 16:58:53.058628843 +0200
187 @@ -11,6 +11,7 @@
188  #define UL_TTY_KEEPCFLAGS      (1 << 1)
189  #define UL_TTY_UTF8            (1 << 2)
190  
191 +#ifndef __dietlibc__
192  static inline void reset_virtual_console(struct termios *tp, int flags)
193  {
194         /* Use defaults of <sys/ttydefaults.h> for base settings */
195 @@ -78,6 +79,7 @@
196         tp->c_cc[VLNEXT]   = CLNEXT;
197         tp->c_cc[VEOL2]    = _POSIX_VDISABLE;
198  }
199 +#endif
200  
201  static inline int get_terminal_width(void)
202  {
203 --- util-linux-2.22.1/configure.ac.orig 2012-10-13 17:14:16.488590090 +0200
204 +++ util-linux-2.22.1/configure.ac      2012-10-13 22:11:41.324507881 +0200
205 @@ -915,6 +915,9 @@
206  UL_REQUIRES_HAVE([cramfs], [z], [z library])
207  AM_CONDITIONAL(BUILD_CRAMFS, test "x$build_cramfs" = xyes)
208  
209 +AC_ARG_ENABLE([minix], AS_HELP_STRING([--disable-minix], [do not build fsck.minix]), [], enable_minix=yes)
210 +UL_BUILD_INIT([minix])
211 +AM_CONDITIONAL(BUILD_MINIX, test "x$build_minix" = xyes)
212  
213  if test "x$have_io" = xyes -o "x$linux_os" = xyes; then
214    build_hwclock=yes
215 @@ -1193,6 +1196,12 @@
216         [sched_getaffinity])
217  AM_CONDITIONAL(BUILD_TASKSET, test "x$build_taskset" = xyes)
218  
219 +AC_ARG_ENABLE([setarch], AS_HELP_STRING([--disable-setarch], [do not build setarch]), [], enable_setarch=yes)
220 +UL_BUILD_INIT([setarch])
221 +AM_CONDITIONAL(BUILD_SETARCH, test "x$build_setarch" = xyes)
222 +AC_ARG_ENABLE([ldattach], AS_HELP_STRING([--disable-ldattach], [do not build ldattach]), [], enable_ldattach=yes)
223 +UL_BUILD_INIT([ldattach])
224 +AM_CONDITIONAL(BUILD_LDATTACH, test "x$build_ldattach" = xyes)
225  
226  AC_ARG_ENABLE([wall],
227    AS_HELP_STRING([--disable-wall], [do not build wall]),
228 --- util-linux-2.22.1/disk-utils/Makemodule.am.orig     2012-09-20 15:16:51.321634997 +0200
229 +++ util-linux-2.22.1/disk-utils/Makemodule.am  2012-10-13 22:12:29.384505863 +0200
230 @@ -1,4 +1,4 @@
231 -
232 +if BUILD_MINIX
233  sbin_PROGRAMS += fsck.minix
234  dist_man_MANS += disk-utils/fsck.minix.8
235  fsck_minix_SOURCES = \
236 @@ -6,6 +6,7 @@
237         disk-utils/minix_programs.h \
238         lib/ismounted.c
239  fsck_minix_LDADD = $(LDADD) libcommon.la
240 +endif
241  
242  sbin_PROGRAMS += mkfs.minix
243  dist_man_MANS += disk-utils/mkfs.minix.8
244 --- util-linux-2.22.1/sys-utils/Makemodule.am.orig      2012-10-10 14:14:06.515276813 +0200
245 +++ util-linux-2.22.1/sys-utils/Makemodule.am   2012-10-13 22:18:31.467824001 +0200
246 @@ -59,10 +59,12 @@
247  cytune_SOURCES = sys-utils/cytune.c sys-utils/cyclades.h
248  cytune_LDADD = $(LDADD) libcommon.la
249  
250 +if BUILD_LDATTACH
251  usrsbin_exec_PROGRAMS += ldattach
252  dist_man_MANS += sys-utils/ldattach.8
253  ldattach_SOURCES = sys-utils/ldattach.c
254  ldattach_LDADD = $(LDADD) libcommon.la
255 +endif
256  
257  usrsbin_exec_PROGRAMS += tunelp
258  dist_man_MANS += sys-utils/tunelp.8
259 @@ -73,6 +75,7 @@
260  rtcwake_SOURCES = sys-utils/rtcwake.c
261  rtcwake_LDADD = $(LDADD) libcommon.la
262  
263 +if BUILD_SETARCH
264  usrbin_exec_PROGRAMS += setarch
265  dist_man_MANS += sys-utils/setarch.8
266  setarch_SOURCES = sys-utils/setarch.c
267 @@ -123,6 +124,7 @@
268  
269  INSTALL_EXEC_HOOKS += install-exec-hook-setarch
270  UNINSTALL_HOOKS += uninstall-hook-setarch
271 +endif
272  
273  endif # LINUX
274  
This page took 0.053444 seconds and 3 git commands to generate.