xref: /OK3568_Linux_fs/buildroot/package/ecryptfs-utils/0001-musl.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunfix musl build
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunPatch inspired by
4*4882a593Smuzhiyunhttps://github.com/kraj/meta-musl/blob/master/recipes-core/util-linux/util-linux-2.25/0001-switch_root-use-typeof-instead-of-__SWORD_TYPE-for-s.patch
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunSigned-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
7*4882a593Smuzhiyun
8*4882a593Smuzhiyundiff -uNr ecryptfs-utils-109.org/src/utils/mount.ecryptfs_private.c ecryptfs-utils-109/src/utils/mount.ecryptfs_private.c
9*4882a593Smuzhiyun--- ecryptfs-utils-109.org/src/utils/mount.ecryptfs_private.c	2016-01-22 17:04:52.000000000 +0100
10*4882a593Smuzhiyun+++ ecryptfs-utils-109/src/utils/mount.ecryptfs_private.c	2016-01-24 16:52:37.000000000 +0100
11*4882a593Smuzhiyun@@ -224,6 +224,7 @@
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun static int check_cwd_f_type()
14*4882a593Smuzhiyun {
15*4882a593Smuzhiyun+	struct statfs buf;
16*4882a593Smuzhiyun 	/**
17*4882a593Smuzhiyun 	 * This is *not* a list of compatible lower filesystems list for
18*4882a593Smuzhiyun 	 * eCryptfs. This is a list of filesystems that we reasonably expect to
19*4882a593Smuzhiyun@@ -235,7 +236,7 @@
20*4882a593Smuzhiyun 	 * deceive other programs with a crafted /proc/self/*. See
21*4882a593Smuzhiyun 	 * https://launchpad.net/bugs/1530566 for more details.
22*4882a593Smuzhiyun 	 */
23*4882a593Smuzhiyun-	__SWORD_TYPE f_type_whitelist[] = {
24*4882a593Smuzhiyun+	typeof(buf.f_type) f_type_whitelist[] = {
25*4882a593Smuzhiyun 		0x61756673 /* AUFS_SUPER_MAGIC */,
26*4882a593Smuzhiyun 		0x9123683E /* BTRFS_SUPER_MAGIC */,
27*4882a593Smuzhiyun 		0x00C36400 /* CEPH_SUPER_MAGIC */,
28*4882a593Smuzhiyun@@ -259,7 +260,6 @@
29*4882a593Smuzhiyun 		0x58465342 /* XFS_SB_MAGIC */,
30*4882a593Smuzhiyun 		0x2FC12FC1 /* ZFS_SUPER_MAGIC */,
31*4882a593Smuzhiyun 	};
32*4882a593Smuzhiyun-	struct statfs buf;
33*4882a593Smuzhiyun 	size_t i, whitelist_len;
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun 	if (statfs(".", &buf) != 0) {
36