summaryrefslogtreecommitdiffstats
path: root/package/sudo/sudo-1.8.5p1-backport-commit-8209:0c4e3f68b2f5-from-upstream.patch
blob: 69512b037c21b290ffe0a2aa30f63bfe278ab76b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
The installation of the sudoers plugin fails when cross compiling, because it
tries to run the cross-compiled visudo, rather than that of the host.

The visudo invocation is only required in order to sanity check any existing
sudoers file in the target directory; this can safely be dispensed with.

This is a backport of commit 8209:0c4e3f68b2f5 from upstream.

N.B. The upstream fix will appear in sudo 1.8.6; when the Buildroot package
is bumped to version 1.8.6 (or higher), then this patch will no longer be
required.

Signed-off-by: Simon Dawson <spdawson@gmail.com>
diff -Nurp a/common/Makefile.in b/common/Makefile.in
--- a/common/Makefile.in	2012-05-15 17:22:01.000000000 +0100
+++ b/common/Makefile.in	2012-06-21 08:55:57.345169676 +0100
@@ -24,6 +24,7 @@ devdir = @devdir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 incdir = $(top_srcdir)/include
+cross_compiling = @CROSS_COMPILING@
 
 # Where to install things...
 prefix = @prefix@
diff -Nurp a/compat/Makefile.in b/compat/Makefile.in
--- a/compat/Makefile.in	2012-05-15 17:22:01.000000000 +0100
+++ b/compat/Makefile.in	2012-06-21 08:57:09.097166477 +0100
@@ -24,6 +24,7 @@ devdir = @devdir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 incdir = $(top_srcdir)/include
+cross_compiling = @CROSS_COMPILING@
 
 # Where to install things...
 prefix = @prefix@
@@ -111,19 +112,21 @@ install-plugin:
 uninstall:
 
 check: $(TEST_PROGS)
-	@if [ -f fnm_test ]; then \
-	    ./fnm_test $(srcdir)/regress/fnmatch/fnm_test.in; \
-	fi
-	@if [ -f globtest ]; then \
-	    mkdir -p `sed 's@/[^/]*$$@@' $(srcdir)/regress/glob/files | sort -u`; \
-	    touch `cat $(srcdir)/regress/glob/files`; \
-	    chmod 0755 `grep '/r[^/]*$$' $(srcdir)/regress/glob/files`; \
-	    chmod 0444 `grep '/s[^/]*$$' $(srcdir)/regress/glob/files`; \
-	    chmod 0711 `grep '/t[^/]*$$' $(srcdir)/regress/glob/files`; \
-	    ./globtest $(srcdir)/regress/glob/globtest.in; \
-	    rval=$$?; \
-	    rm -rf fake; \
-	    exit $$rval; \
+	@if test X"$(cross_compiling)" != X"yes"; then \
+	    if test -f fnm_test; then \
+		./fnm_test $(srcdir)/regress/fnmatch/fnm_test.in; \
+	    fi; \
+	    if test -f globtest; then \
+		mkdir -p `sed 's@/[^/]*$$@@' $(srcdir)/regress/glob/files | sort -u`; \
+		touch `cat $(srcdir)/regress/glob/files`; \
+		chmod 0755 `grep '/r[^/]*$$' $(srcdir)/regress/glob/files`; \
+		chmod 0444 `grep '/s[^/]*$$' $(srcdir)/regress/glob/files`; \
+		chmod 0711 `grep '/t[^/]*$$' $(srcdir)/regress/glob/files`; \
+		./globtest $(srcdir)/regress/glob/globtest.in; \
+		rval=$$?; \
+		rm -rf fake; \
+		exit $$rval; \
+	    fi; \
 	fi
 
 clean:
diff -Nurp a/configure b/configure
--- a/configure	2012-05-17 20:53:53.000000000 +0100
+++ b/configure	2012-06-21 08:58:08.769163817 +0100
@@ -691,6 +691,7 @@ password_timeout
 timeout
 timedir
 iolog_dir
+CROSS_COMPILING
 COMPAT_TEST_PROGS
 SUDO_NLS
 LIBINTL
@@ -2874,6 +2875,7 @@ $as_echo "$as_me: Configuring Sudo versi
 
 
 
+
 #
 # Begin initial values for man page substitution
 #
@@ -20094,6 +20096,8 @@ if test -n "$GCC"; then
     fi
 fi
 
+CROSS_COMPILING="$cross_compiling"
+
 test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
 
 if test X"$with_noexec" != X"no" -o X"$with_selinux" != X"no"; then
diff -Nurp a/configure.in b/configure.in
--- a/configure.in	2012-05-17 20:53:54.000000000 +0100
+++ b/configure.in	2012-06-21 08:58:51.017161934 +0100
@@ -67,6 +67,7 @@ AC_SUBST([LT_STATIC])
 AC_SUBST([LIBINTL])
 AC_SUBST([SUDO_NLS])
 AC_SUBST([COMPAT_TEST_PROGS])
+AC_SUBST([CROSS_COMPILING])
 dnl
 dnl Variables that get substituted in docs (not overridden by environment)
 dnl
@@ -3198,6 +3199,11 @@ if test -n "$GCC"; then
 fi
 
 dnl
+dnl Skip regress tests and sudoers sanity check if cross compiling.
+dnl
+CROSS_COMPILING="$cross_compiling"
+
+dnl
 dnl Set exec_prefix
 dnl
 test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
diff -Nurp a/doc/Makefile.in b/doc/Makefile.in
--- a/doc/Makefile.in	2012-03-12 18:02:07.000000000 +0000
+++ b/doc/Makefile.in	2012-06-21 08:59:06.537161242 +0100
@@ -23,6 +23,7 @@ srcdir = @srcdir@
 docdir = @docdir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+cross_compiling = @CROSS_COMPILING@
 
 # Tools to use
 NROFF = @NROFFPROG@
diff -Nurp a/plugins/sample/Makefile.in b/plugins/sample/Makefile.in
--- a/plugins/sample/Makefile.in	2012-03-12 18:02:09.000000000 +0000
+++ b/plugins/sample/Makefile.in	2012-06-21 08:59:24.397160445 +0100
@@ -24,6 +24,7 @@ devdir = @devdir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 incdir = $(top_srcdir)/include
+cross_compiling = @CROSS_COMPILING@
 
 # Compiler & tools to use
 CC = @CC@
diff -Nurp a/plugins/sample_group/Makefile.in b/plugins/sample_group/Makefile.in
--- a/plugins/sample_group/Makefile.in	2012-05-15 17:22:02.000000000 +0100
+++ b/plugins/sample_group/Makefile.in	2012-06-21 08:59:38.641159810 +0100
@@ -24,6 +24,7 @@ devdir = @devdir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 incdir = $(top_srcdir)/include
+cross_compiling = @CROSS_COMPILING@
 
 # Compiler & tools to use
 CC = @CC@
diff -Nurp a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in
--- a/plugins/sudoers/Makefile.in	2012-05-15 17:22:02.000000000 +0100
+++ b/plugins/sudoers/Makefile.in	2012-06-21 09:32:26.165072089 +0100
@@ -32,6 +32,7 @@ top_srcdir = @top_srcdir@
 incdir = $(top_srcdir)/include
 docdir = @docdir@
 timedir = @timedir@
+cross_compiling = @CROSS_COMPILING@
 
 # Compiler & tools to use
 CC = @CC@
@@ -237,7 +238,7 @@ sudoers: $(srcdir)/sudoers.in
 	(cd $(top_builddir) && $(SHELL) config.status --file=plugins/sudoers/$@)
 
 pre-install:
-	@if test -r $(DESTDIR)$(sudoersdir)/sudoers; then \
+	@if test X"$(cross_compiling)" != X"yes" -a -r $(DESTDIR)$(sudoersdir)/sudoers; then \
 	    echo "Checking existing sudoers file for syntax errors."; \
 	    ./visudo -c -f $(DESTDIR)$(sudoersdir)/sudoers; \
 	fi
@@ -280,17 +281,23 @@ uninstall:
 	    rm -f $(DESTDIR)$(sudoersdir)/sudoers
 
 check: $(TEST_PROGS) visudo testsudoers
-	@-rval=0; \
-	./check_addr $(srcdir)/regress/parser/check_addr.in; \
+	@-if test X"$(cross_compiling)" != X"yes"; then \
+	    rval=0; \
+	    PWD=`pwd`; \
+	    ./check_addr $(srcdir)/regress/parser/check_addr.in; \
 	rval=`expr $$rval + $$?`; \
-	./check_fill; \
-	rval=`expr $$rval + $$?`; \
-	./check_iolog_path $(srcdir)/regress/iolog_path/data; \
-	rval=`expr $$rval + $$?`; \
-	./check_wrap $(srcdir)/regress/logging/check_wrap.in > check_wrap.out; \
-	diff check_wrap.out $(srcdir)/regress/logging/check_wrap.out.ok; \
-	rval=`expr $$rval + $$?`; \
-	passed=0; failed=0; total=0; \
+	    ./check_fill; \
+	    rval=`expr $$rval + $$?`; \
+	    ./check_iolog_path $(srcdir)/regress/iolog_path/data; \
+	    rval=`expr $$rval + $$?`; \
+	    if [ X"$(soext)" != X"" ]; then \
+		./check_symbols .libs/sudoers$(soext) $(shlib_exp); \
+		rval=`expr $$rval + $$?`; \
+	    fi; \
+	    ./check_wrap $(srcdir)/regress/logging/check_wrap.in > check_wrap.out; \
+	    diff check_wrap.out $(srcdir)/regress/logging/check_wrap.out.ok; \
+	    rval=`expr $$rval + $$?`; \
+	    passed=0; failed=0; total=0; \
 	    for t in $(srcdir)/regress/sudoers/*.in; do \
 		dir=`dirname $$t`; \
 		dirbase=`basename $$dir`; \
@@ -318,8 +325,8 @@ check: $(TEST_PROGS) visudo testsudoers
 		total=`expr $$total + 1`; \
 	    done; \
 	    echo "$$dirbase: $$passed/$$total tests passed; $$failed/$$total tests failed"; \
-	rval=`expr $$rval + $$failed`; \
-	passed=0; failed=0; total=0; \
+	    rval=`expr $$rval + $$failed`; \
+	    passed=0; failed=0; total=0; \
 	    for t in $(srcdir)/regress/*/*.sh; do \
 		dir=`dirname $$t`; \
 		dirbase=`basename $$dir`; \
@@ -351,7 +358,9 @@ check: $(TEST_PROGS) visudo testsudoers
 		fi; \
 	    done; \
 	    echo "$$dirbase: $$passed/$$total tests passed; $$failed/$$total tests failed"; \
-	    rval=`expr $$rval + $$failed`; exit $$rval
+	    rval=`expr $$rval + $$failed`; \
+	    exit $$rval; \
+	fi
 
 clean:
 	-$(LIBTOOL) --mode=clean rm -f $(PROGS) $(TEST_PROGS) *.lo *.o *.la *.a stamp-* core *.core core.* *.out *.toke *.err
diff -Nurp a/plugins/system_group/Makefile.in b/plugins/system_group/Makefile.in
--- a/plugins/system_group/Makefile.in	2012-05-15 17:22:03.000000000 +0100
+++ b/plugins/system_group/Makefile.in	2012-06-21 09:32:38.361071545 +0100
@@ -24,6 +24,7 @@ devdir = @devdir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 incdir = $(top_srcdir)/include
+cross_compiling = @CROSS_COMPILING@
 
 # Compiler & tools to use
 CC = @CC@
diff -Nurp a/src/Makefile.in b/src/Makefile.in
--- a/src/Makefile.in	2012-05-08 21:56:43.000000000 +0100
+++ b/src/Makefile.in	2012-06-21 09:32:53.233070882 +0100
@@ -24,6 +24,7 @@ devdir = @devdir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 incdir = $(top_srcdir)/include
+cross_compiling = @CROSS_COMPILING@
 
 # Compiler & tools to use
 CC = @CC@
diff -Nurp a/zlib/Makefile.in b/zlib/Makefile.in
--- a/zlib/Makefile.in	2012-03-12 18:02:17.000000000 +0000
+++ b/zlib/Makefile.in	2012-06-21 09:33:03.417070428 +0100
@@ -22,6 +22,7 @@
 srcdir = @srcdir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+cross_compiling = @CROSS_COMPILING@
 
 # Compiler & tools to use
 CC = @CC@