1 |
commit: 7d0e5c540ad8167d761289cbde9dfaf2df0ccb56 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 26 12:29:37 2018 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 26 12:29:51 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d0e5c54 |
7 |
|
8 |
sys-fs/dd-rescue: Fixed compilation with latest sys-apps/attr version. |
9 |
|
10 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
11 |
|
12 |
sys-fs/dd-rescue/dd-rescue-1.99.8.ebuild | 3 +- |
13 |
.../dd-rescue/files/dd-rescue-1.99.8-xattr.patch | 300 +++++++++++++++++++++ |
14 |
2 files changed, 302 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/sys-fs/dd-rescue/dd-rescue-1.99.8.ebuild b/sys-fs/dd-rescue/dd-rescue-1.99.8.ebuild |
17 |
index 135b53fec88..8f5734a435d 100644 |
18 |
--- a/sys-fs/dd-rescue/dd-rescue-1.99.8.ebuild |
19 |
+++ b/sys-fs/dd-rescue/dd-rescue-1.99.8.ebuild |
20 |
@@ -1,4 +1,4 @@ |
21 |
-# Copyright 1999-2017 Gentoo Foundation |
22 |
+# Copyright 1999-2018 Gentoo Foundation |
23 |
# Distributed under the terms of the GNU General Public License v2 |
24 |
|
25 |
EAPI="6" |
26 |
@@ -25,6 +25,7 @@ S="${WORKDIR}/${MY_P}" |
27 |
|
28 |
PATCHES=( |
29 |
"${FILESDIR}"/${MY_PN}-1.99-musl-r2.patch |
30 |
+ "${FILESDIR}"/${PN}-1.99.8-xattr.patch |
31 |
) |
32 |
|
33 |
src_prepare() { |
34 |
|
35 |
diff --git a/sys-fs/dd-rescue/files/dd-rescue-1.99.8-xattr.patch b/sys-fs/dd-rescue/files/dd-rescue-1.99.8-xattr.patch |
36 |
new file mode 100644 |
37 |
index 00000000000..39e719c3386 |
38 |
--- /dev/null |
39 |
+++ b/sys-fs/dd-rescue/files/dd-rescue-1.99.8-xattr.patch |
40 |
@@ -0,0 +1,300 @@ |
41 |
+--- dd_rescue-1.99.8/configure.in |
42 |
++++ dd_rescue-1.99.8/configure.in |
43 |
+@@ -6,7 +6,7 @@ |
44 |
+ AC_HEADER_STDC |
45 |
+ #AC_PROG_INSTALL |
46 |
+ #CFLAGS="$CFLAGS -DHAVE_CONFIG_H" |
47 |
+-AC_CHECK_HEADERS([fallocate.h dlfcn.h unistd.h attr/xattr.h sys/acl.h sys/ioctl.h sys/reg.h endian.h linux/fs.h linux/fiemap.h stdint.h lzo/lzo1x.h openssl/evp.h linux/random.h malloc.h sched.h sys/statvfs.h]) |
48 |
++AC_CHECK_HEADERS([fallocate.h dlfcn.h unistd.h sys/xattr.h sys/acl.h sys/ioctl.h sys/reg.h endian.h linux/fs.h linux/fiemap.h stdint.h lzo/lzo1x.h openssl/evp.h linux/random.h malloc.h sched.h sys/statvfs.h]) |
49 |
+ AC_CHECK_FUNCS([ffs ffsl basename fallocate64 splice getopt_long open64 pread pread64 lseek64 stat64 posix_fadvise posix_fadvise64 __builtin_prefetch htobe64 feof_unlocked getline getentropy getrandom posix_memalign valloc sched_yield fstatvfs __builtin_cpu_supports]) |
50 |
+ AC_CHECK_LIB(dl,dlsym) |
51 |
+ AC_CHECK_LIB(fallocate,linux_fallocate64) |
52 |
+--- dd_rescue-1.99.8/dd_rescue.c |
53 |
++++ dd_rescue-1.99.8/dd_rescue.c |
54 |
+@@ -161,8 +161,8 @@ |
55 |
+ #endif |
56 |
+ |
57 |
+ /* xattrs */ |
58 |
+-#ifdef HAVE_ATTR_XATTR_H |
59 |
+-# include <attr/xattr.h> |
60 |
++#ifdef HAVE_SYS_XATTR_H |
61 |
++# include <sys/xattr.h> |
62 |
+ #else |
63 |
+ /* TODO: Could provide the prototypes for the syscalls ourselves ... */ |
64 |
+ # warning No support for copying extended attributes / ACLs |
65 |
+@@ -1276,7 +1276,7 @@ |
66 |
+ |
67 |
+ /** Copy xattrs */ |
68 |
+ int copyxattr(const char* inm, const char* onm) |
69 |
+-#ifdef HAVE_ATTR_XATTR_H |
70 |
++#ifdef HAVE_SYS_XATTR_H |
71 |
+ { |
72 |
+ char *attrs = NULL; |
73 |
+ ssize_t aln = listxattr(inm, NULL, 0); |
74 |
+@@ -2486,7 +2486,7 @@ |
75 |
+ #ifdef FITRIM |
76 |
+ fprintf(stderr, "fitrim "); |
77 |
+ #endif |
78 |
+-#ifdef HAVE_ATTR_XATTR_H |
79 |
++#ifdef HAVE_SYS_XATTR_H |
80 |
+ fprintf(stderr, "xattr "); |
81 |
+ #endif |
82 |
+ #if (defined(__x86_64__) || defined(__i386__)) && !defined(NO_RDRND) |
83 |
+--- dd_rescue-1.99.8/libddr_crypt.c |
84 |
++++ dd_rescue-1.99.8/libddr_crypt.c |
85 |
+@@ -47,8 +47,8 @@ |
86 |
+ #include <endian.h> |
87 |
+ #include <signal.h> |
88 |
+ |
89 |
+-#ifdef HAVE_ATTR_XATTR_H |
90 |
+-#include <attr/xattr.h> |
91 |
++#ifdef HAVE_SYS_XATTR_H |
92 |
++#include <sys/xattr.h> |
93 |
+ #endif |
94 |
+ |
95 |
+ #if __WORDSIZE == 64 |
96 |
+@@ -90,7 +90,7 @@ |
97 |
+ size_t saltlen; |
98 |
+ loff_t lastpos; |
99 |
+ loff_t processed; |
100 |
+-#if 1 //def HAVE_ATTR_XATTR_H |
101 |
++#if 1 //def HAVE_SYS_XATTR_H |
102 |
+ char* salt_xattr_name; |
103 |
+ char sxattr, sxfallback; |
104 |
+ char* key_xattr_name; |
105 |
+@@ -113,13 +113,13 @@ |
106 |
+ " Parameters: [alg[o[rithm]]=]ALG:enc[rypt]:dec[rypt]:engine=STR:pad=STR\n" |
107 |
+ "\t:keyhex=HEX:keyfd=[x]INT[@INT@INT]:keyfile=NAME[@INT@INT]:keygen:keysfile\n" |
108 |
+ "\t:ivhex=HEX:ivfd=[x]INT[@INT@INT]:ivfile=NAME[@INT@INT]:ivgen:ivsfile\n" |
109 |
+-#ifdef HAVE_ATTR_XATTR_H |
110 |
++#ifdef HAVE_SYS_XATTR_H |
111 |
+ "\t:keyxattr[=xattr_name]:kxfallback:ivxattr[=xattr_name]:ixfallback\n" |
112 |
+ #endif |
113 |
+ "\t:pass=STR:passfd=[x]INT[@INT@INT]:passfile=NAME[@INT@INT]\n" |
114 |
+ "\t:salt=STR:salthex=HEX:saltfd=[x]INT[@INT@INT]:saltfile=NAME[@INT@INT]\n" |
115 |
+ "\t:saltlen=INT:saltgen:saltsfile" |
116 |
+-#ifdef HAVE_ATTR_XATTR_H |
117 |
++#ifdef HAVE_SYS_XATTR_H |
118 |
+ ":saltxattr[=xattr_name]:sxfallback" |
119 |
+ #endif |
120 |
+ "\n\t:pbkdf2[=INT]:opbkdf[11]:debug:bench[mark]:skiphole:weakrnd:outkeyiv:ctrbug198\n" |
121 |
+@@ -346,7 +346,7 @@ |
122 |
+ state->saltlen = ATOL(param+8); |
123 |
+ else if (!strcmp(param, "saltgen")) |
124 |
+ state->sgen = 1; |
125 |
+-#ifdef HAVE_ATTR_XATTR_H |
126 |
++#ifdef HAVE_SYS_XATTR_H |
127 |
+ else if (!strcmp(param, "saltxattr")) |
128 |
+ err += set_flag(&state->sxattr, "saltxattr"); |
129 |
+ else if (!memcmp(param, "saltxattr=", 10)) { |
130 |
+@@ -709,7 +709,7 @@ |
131 |
+ return err; |
132 |
+ } |
133 |
+ |
134 |
+-#ifdef HAVE_ATTR_XATTR_H |
135 |
++#ifdef HAVE_SYS_XATTR_H |
136 |
+ int get_xattr(crypt_state *state, const char* atrnm, |
137 |
+ unsigned char* data, int dlen, |
138 |
+ char fb, char* fbf, char* flag) |
139 |
+@@ -883,7 +883,7 @@ |
140 |
+ sprintf(ivsnm, "IVS.%s", state->alg->name); |
141 |
+ sprintf(keynm, "KEYS.%s", state->alg->name); |
142 |
+ sprintf(saltnm, "SALT.%s", state->alg->name); |
143 |
+-#ifdef HAVE_ATTR_XATTR_H |
144 |
++#ifdef HAVE_SYS_XATTR_H |
145 |
+ if (state->sxattr && !state->salt_xattr_name) { |
146 |
+ state->salt_xattr_name = malloc(32); |
147 |
+ snprintf(state->salt_xattr_name, 32, "user.salt.%s", state->alg->name); |
148 |
+@@ -958,7 +958,7 @@ |
149 |
+ } |
150 |
+ |
151 |
+ /* 5c */ |
152 |
+-#ifdef HAVE_ATTR_XATTR_H |
153 |
++#ifdef HAVE_SYS_XATTR_H |
154 |
+ /* Try getting salt from xattr */ |
155 |
+ if (!state->sset && state->sxattr && !get_salt_xattr(state) && !state->enc) |
156 |
+ state->sxattr = 0; |
157 |
+@@ -999,7 +999,7 @@ |
158 |
+ if (write_file(state->sec->salt, state->sfnm, 8, 0640)) |
159 |
+ return -1; |
160 |
+ } |
161 |
+-#ifdef HAVE_ATTR_XATTR_H |
162 |
++#ifdef HAVE_SYS_XATTR_H |
163 |
+ /* Write salt to xattr */ |
164 |
+ if (state->sxattr && state->enc && set_salt_xattr(state)) { |
165 |
+ if (!state->sxfallback) |
166 |
+@@ -1028,7 +1028,7 @@ |
167 |
+ if (!state->keyf && !state->kxattr) |
168 |
+ FPLOG(WARN, "Generated key not written anywhere?\n", NULL); |
169 |
+ else { |
170 |
+-#ifdef HAVE_ATTR_XATTR_H |
171 |
++#ifdef HAVE_SYS_XATTR_H |
172 |
+ /* Write key to xattr, failure is fatal */ |
173 |
+ if (state->kxattr && state->enc && set_key_xattr(state) && !state->kxfallback) |
174 |
+ return -1; |
175 |
+@@ -1066,7 +1066,7 @@ |
176 |
+ FPLOG(FATAL, "Key generation with pass+salt failed!\n", NULL); |
177 |
+ return -1; |
178 |
+ } |
179 |
+-#ifdef HAVE_ATTR_XATTR_H |
180 |
++#ifdef HAVE_SYS_XATTR_H |
181 |
+ /* Write key to xattr, failure is fatal */ |
182 |
+ if (state->kxattr && state->enc && set_key_xattr(state) && !state->kxfallback) |
183 |
+ return -1; |
184 |
+@@ -1077,7 +1077,7 @@ |
185 |
+ return -1; |
186 |
+ |
187 |
+ } else { |
188 |
+-#ifdef HAVE_ATTR_XATTR_H |
189 |
++#ifdef HAVE_SYS_XATTR_H |
190 |
+ if (state->kxattr) |
191 |
+ get_key_xattr(state); |
192 |
+ #endif |
193 |
+@@ -1100,7 +1100,7 @@ |
194 |
+ } |
195 |
+ } |
196 |
+ } else { |
197 |
+-#ifdef HAVE_ATTR_XATTR_H |
198 |
++#ifdef HAVE_SYS_XATTR_H |
199 |
+ if (state->kxattr && set_key_xattr(state) && !state->kxfallback) { |
200 |
+ FPLOG(FATAL, "Can't save key in xattr"); |
201 |
+ return -1; |
202 |
+@@ -1123,7 +1123,7 @@ |
203 |
+ if (!state->ivf && !state->ixattr) |
204 |
+ FPLOG(WARN, "Generated IV not saved?\n", NULL); |
205 |
+ else { |
206 |
+-#ifdef HAVE_ATTR_XATTR_H |
207 |
++#ifdef HAVE_SYS_XATTR_H |
208 |
+ /* Write IV to xattr, failure w/o fb is fatal */ |
209 |
+ if (state->ixattr && state->enc && set_iv_xattr(state) && !state->ixfallback) |
210 |
+ return -1; |
211 |
+@@ -1149,7 +1149,7 @@ |
212 |
+ return -1; |
213 |
+ } |
214 |
+ } |
215 |
+-#ifdef HAVE_ATTR_XATTR_H |
216 |
++#ifdef HAVE_SYS_XATTR_H |
217 |
+ /* Write IV to xattr, failure w/o fb is fatal */ |
218 |
+ if (state->ixattr && state->enc && set_iv_xattr(state) && !state->ixfallback) |
219 |
+ return -1; |
220 |
+@@ -1159,7 +1159,7 @@ |
221 |
+ if (write_keyfile(state, ivsnm, encnm, state->sec->nonce1, BLKSZ, 0640, 1, 0)) |
222 |
+ return -1; |
223 |
+ } else { |
224 |
+-#ifdef HAVE_ATTR_XATTR_H |
225 |
++#ifdef HAVE_SYS_XATTR_H |
226 |
+ if (state->ixattr) |
227 |
+ get_iv_xattr(state); |
228 |
+ #endif |
229 |
+@@ -1180,7 +1180,7 @@ |
230 |
+ } |
231 |
+ } |
232 |
+ } else if (state->alg->stream->needs_iv) { |
233 |
+-#ifdef HAVE_ATTR_XATTR_H |
234 |
++#ifdef HAVE_SYS_XATTR_H |
235 |
+ if (state->ixattr && set_iv_xattr(state) && !state->ixfallback) { |
236 |
+ FPLOG(FATAL, "Can't save IV in xattr"); |
237 |
+ return -1; |
238 |
+@@ -1454,7 +1454,7 @@ |
239 |
+ FPLOG(INFO, "%.2fs CPU time, %.1fMiB/s\n", |
240 |
+ (double)state->cpu/CLOCKS_PER_SEC, |
241 |
+ state->processed/1024 / (state->cpu/(CLOCKS_PER_SEC/1024.0))); |
242 |
+-#ifdef HAVE_ATTR_XATTR_H |
243 |
++#ifdef HAVE_SYS_XATTR_H |
244 |
+ if (state->salt_xattr_name) |
245 |
+ free(state->salt_xattr_name); |
246 |
+ if (state->key_xattr_name) |
247 |
+--- dd_rescue-1.99.8/libddr_hash.c |
248 |
++++ dd_rescue-1.99.8/libddr_hash.c |
249 |
+@@ -36,8 +36,8 @@ |
250 |
+ #include <netinet/in.h> /* For ntohl/htonl */ |
251 |
+ #include <endian.h> |
252 |
+ |
253 |
+-#ifdef HAVE_ATTR_XATTR_H |
254 |
+-#include <attr/xattr.h> |
255 |
++#ifdef HAVE_SYS_XATTR_H |
256 |
++#include <sys/xattr.h> |
257 |
+ #endif |
258 |
+ // TODO: pass at runtime rather than compile time |
259 |
+ #define HASH_DEBUG(x) if (state->debug) x |
260 |
+@@ -75,7 +75,7 @@ |
261 |
+ #endif |
262 |
+ int hmacpln; |
263 |
+ char xfallback; |
264 |
+-#if 1 //def HAVE_ATTR_XATTR_H |
265 |
++#if 1 //def HAVE_SYS_XATTR_H |
266 |
+ char chk_xattr, set_xattr, xnmalloc; |
267 |
+ char* xattr_name; |
268 |
+ #endif |
269 |
+@@ -90,7 +90,7 @@ |
270 |
+ ":multipart=size" |
271 |
+ #endif |
272 |
+ "\n" |
273 |
+-#ifdef HAVE_ATTR_XATTR_H |
274 |
++#ifdef HAVE_SYS_XATTR_H |
275 |
+ "\t:chk_xattr[=xattr_name]:set_xattr[=xattr_name]:fallb[ack][=FILE]\n" |
276 |
+ #endif |
277 |
+ " Use algorithm=help to get a list of supported hash algorithms\n"; |
278 |
+@@ -167,7 +167,7 @@ |
279 |
+ state->append = param+7; |
280 |
+ else if (!memcmp(param, "prepend=", 8)) |
281 |
+ state->prepend = param+8; |
282 |
+-#if 1 //def HAVE_ATTR_XATTR_H |
283 |
++#if 1 //def HAVE_SYS_XATTR_H |
284 |
+ else if (!memcmp(param, "chk_xattr=", 10)) { |
285 |
+ state->chk_xattr = 1; state->xattr_name = param+10; } |
286 |
+ else if (!strcmp(param, "chk_xattr")) |
287 |
+@@ -258,7 +258,7 @@ |
288 |
+ FPLOG(FATAL, "No hash algorithm specified\n"); |
289 |
+ return --err; |
290 |
+ } |
291 |
+-#ifdef HAVE_ATTR_XATTR_H |
292 |
++#ifdef HAVE_SYS_XATTR_H |
293 |
+ if ((state->chk_xattr || state->set_xattr) && !state->xattr_name) { |
294 |
+ state->xattr_name = (char*)malloc(32); |
295 |
+ state->xnmalloc = 1; |
296 |
+@@ -269,7 +269,7 @@ |
297 |
+ } |
298 |
+ #endif |
299 |
+ if ((!state->chkfnm || !*state->chkfnm) && (state->chkf || state->outf |
300 |
+-#ifdef HAVE_ATTR_XATTR_H |
301 |
++#ifdef HAVE_SYS_XATTR_H |
302 |
+ || state->xfallback |
303 |
+ #endif |
304 |
+ )) { |
305 |
+@@ -301,7 +301,7 @@ |
306 |
+ if (!stat || !(*stat)) |
307 |
+ return -1; |
308 |
+ hash_state *state = (hash_state*)*stat; |
309 |
+-#ifdef HAVE_ATTR_XATTR_H |
310 |
++#ifdef HAVE_SYS_XATTR_H |
311 |
+ if (state->xnmalloc) |
312 |
+ free((void*)state->xattr_name); |
313 |
+ #endif |
314 |
+@@ -351,7 +351,7 @@ |
315 |
+ strcat(nnm, "->"); |
316 |
+ strcat(nnm, opt->oname); |
317 |
+ state->fname = nnm; |
318 |
+-#ifdef HAVE_ATTR_XATTR_H |
319 |
++#ifdef HAVE_SYS_XATTR_H |
320 |
+ if (state->chk_xattr || state->set_xattr) { |
321 |
+ --err; |
322 |
+ FPLOG(WARN, "Can't access xattr in the middle of a plugin chain!"); |
323 |
+@@ -607,7 +607,7 @@ |
324 |
+ return err; |
325 |
+ } |
326 |
+ |
327 |
+-#ifdef HAVE_ATTR_XATTR_H |
328 |
++#ifdef HAVE_SYS_XATTR_H |
329 |
+ int check_xattr(hash_state* state, const char* res) |
330 |
+ { |
331 |
+ char xatstr[144]; |
332 |
+@@ -734,7 +734,7 @@ |
333 |
+ err += check_chkf(state, res); |
334 |
+ if (state->outf) |
335 |
+ err += write_chkf(state, res); |
336 |
+-#ifdef HAVE_ATTR_XATTR_H |
337 |
++#ifdef HAVE_SYS_XATTR_H |
338 |
+ if (state->chk_xattr) |
339 |
+ err += check_xattr(state, res); |
340 |
+ if (state->set_xattr) |