mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-04 12:01:41 +02:00
main/nfs-utils: upgrade to 2.3.4
This commit is contained in:
parent
e61e0b162d
commit
165dd08066
@ -1,36 +0,0 @@
|
||||
From 0b4df13026eb371b68abc4b8cec4ca8d90c3b0a3 Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Mon, 2 Jun 2014 14:42:10 +0200
|
||||
Subject: [PATCH] exportfs: only do glibc specific hackery on glibc
|
||||
|
||||
We should not depend on the libc do free(3) on ai_canonname as that is
|
||||
completely up to implementation and known o break things on uclibc and
|
||||
musl libc.
|
||||
|
||||
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
|
||||
---
|
||||
support/export/hostname.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/support/export/hostname.c b/support/export/hostname.c
|
||||
index d9153e1..30584b4 100644
|
||||
--- a/support/export/hostname.c
|
||||
+++ b/support/export/hostname.c
|
||||
@@ -384,6 +384,7 @@
|
||||
|
||||
ai = host_pton(buf);
|
||||
|
||||
+#if !definded(__UCLIBC__) && defined(__GLIBC__)
|
||||
/*
|
||||
* getaddrinfo(AI_NUMERICHOST) never fills in ai_canonname
|
||||
*/
|
||||
@@ -394,7 +395,9 @@
|
||||
ai = NULL;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
return ai;
|
||||
}
|
||||
+
|
||||
#endif /* !HAVE_GETNAMEINFO */
|
||||
@ -1,8 +1,8 @@
|
||||
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
|
||||
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
||||
pkgname=nfs-utils
|
||||
pkgver=2.3.2
|
||||
pkgrel=1
|
||||
pkgver=2.3.4
|
||||
pkgrel=0
|
||||
pkgdesc="kernel-mode NFS"
|
||||
url="http://linux-nfs.org"
|
||||
arch="all"
|
||||
@ -15,13 +15,12 @@ makedepends="util-linux-dev libtirpc-dev libcap-dev libevent-dev
|
||||
subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg $pkgname-openrc rpcgen
|
||||
libnfsidmap libnfsidmap-ldap"
|
||||
source="https://www.kernel.org/pub/linux/utils/nfs-utils/$pkgver/nfs-utils-$pkgver.tar.gz
|
||||
0011-exportfs-only-do-glibc-specific-hackery-on-glibc.patch
|
||||
|
||||
nfs-utils-mtab-sym.patch
|
||||
musl-getservbyport.patch
|
||||
musl-configure_ac.patch
|
||||
musl-getservbyport.patch
|
||||
musl-svcgssd-sysconf.patch
|
||||
idmapd-dnotify-to-inotify.patch
|
||||
sqlite-printf.patch
|
||||
limits.patch
|
||||
|
||||
nfs.initd
|
||||
@ -55,6 +54,7 @@ build() {
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--without-tcp-wrappers \
|
||||
--with-rpcgen=internal \
|
||||
--enable-ipv6 \
|
||||
--enable-nfsv4 \
|
||||
--enable-uuid \
|
||||
@ -119,14 +119,13 @@ ldap() {
|
||||
mv "$pkgdir"/usr/lib/libnfsidmap/*ldap* "$subpkgdir"/usr/lib/libnfsidmap/
|
||||
}
|
||||
|
||||
sha512sums="0a6f81a838ab8252521468b18f5578a4302b722c0ad99c67437f32248d698bea4e664d3b2d176cad7ae5a8487b2443b554c65262d3719aa9622d237df5e6de54 nfs-utils-2.3.2.tar.gz
|
||||
e55dbcc6df1626f992b660ae4ca80eac07ad539f3660448a27b34b6cc63764d59074a10c34e97c1b05f356cf60f68ec724f3dbdc1986be024773a2fe957b55fa 0011-exportfs-only-do-glibc-specific-hackery-on-glibc.patch
|
||||
sha512sums="64a3a9ab4142d556e411351618e409d7402a9e8d1ebe6c124d1f75f59da271f3a0c44f49a89ac4ea509b8050f7aa6fd48ecbdbcce4e1404a50cab0edf0e35802 nfs-utils-2.3.4.tar.gz
|
||||
674ecf2c4bc8e9364ddd0f34cc03c96674753494cbc5a5d157bd70ed4342ff90356c3e85c544510648dbe90cb43b7fd83ba50653bddffc4b3b5550367b6d0b8e nfs-utils-mtab-sym.patch
|
||||
99609058351733dc9d02bd90156ded96bb04924b7c00c07be485e06f60d5fb77d1dbc4deca7d9fb88c5bb8fe96c483c5ec5a8fac26ca61fd351304def79b057d musl-configure_ac.patch
|
||||
94d7ba23164660f1da9298494dff75c57f5a300cb32b2922bc2226fcdaded7eaaa0c50a59a145ac7c75639d177558b5f5594fb1f03a50f60f4c577c93b135748 musl-getservbyport.patch
|
||||
36daf5c6f3e7fedf0b87f001e7aaeef1f038c0cc58d960588d5ab4cab7c1f4821df9a15304f8c531f77602ce0782752388b1b4c0e658419729c479da3288c3af musl-configure_ac.patch
|
||||
16b34801019186cebae77d92b3df0f679aeb51eabf5c91714d2d2907cecacb6a151cd582c900dd629a413424b545823e97ee00b8de0c90248d3fed9bf603a270 musl-svcgssd-sysconf.patch
|
||||
33410c469348adf5e6b5ec91d8cda6b246f1a38a0b234a52f54a49ab8395ede43dfedd58914a59c342923ba45722f6fd4e4aebeffbe4a730f31c9d1ad19de9a9 idmapd-dnotify-to-inotify.patch
|
||||
b75c87917d86ce6e0e8b9bc2651e7f77851170b47b2a9c7628475e8aed73e89c858e7030885e2904e42c2133906705bb1243d19308ccb876d563cbc0655c66ce limits.patch
|
||||
b28b0dcd23ad76f78921eebf7373c4480b3cc3d8f64e990f43534ecd010f6f936704b0fbc0d907e3f78b73a56f451101d2920727f1373ce7aa261080fbfccd55 sqlite-printf.patch
|
||||
9647d8f4a64a95a7abf5e26f040cf5567670e2194ce307a971a36eaae7fe490af5a494e7b380a48c88e309f4c25777d73d6c140b224aeed829fbc46b1d0baa64 limits.patch
|
||||
f7feb79cfcab0478affb640d1e5ad059757c88d51cc790fd54cde2fd7ed2e3cfd8f7f4c2de993d99da03e8ce3bdfb2750a4cb997b850fe33d0ef76d9b91c9018 nfs.initd
|
||||
89259b9f0878658d48792b5b2f42b43c966ed098dba1fecf9e07fb0de4aab37ad67655ea8dbcc2361ddab2b5013b2de35a03048a513aaeedf790e4b416a35a54 nfsmount.initd
|
||||
6e23897885cc33c49d9c7353b456585a1e0c7300822edba81bc48ba4ccc18297adce137260cc0aa9487aa5ef0aab3eecf931532cfa5bd40fd03bc9e0ddacfb28 nfsmount.confd
|
||||
|
||||
@ -1,105 +0,0 @@
|
||||
From patchwork Wed Jun 21 21:23:38 2017
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Subject: [V2] idmapd: Use inotify instead of dnotify
|
||||
From: Alan Swanson <reiver@improbability.net>
|
||||
X-Patchwork-Id: 9802949
|
||||
Message-Id: <20170621212338.32460-1-reiver@improbability.net>
|
||||
To: linux-nfs@vger.kernel.org
|
||||
Cc: Alan Swanson <reiver@improbability.net>
|
||||
Date: Wed, 21 Jun 2017 22:23:38 +0100
|
||||
|
||||
Remove last use of dnotify in nfs-utils by bringing idmapd upto
|
||||
date with (required) inotify use by gssd and blkmapd.
|
||||
---
|
||||
utils/idmapd/idmapd.c | 32 +++++++++++++++++---------------
|
||||
1 file changed, 17 insertions(+), 15 deletions(-)
|
||||
|
||||
Got annoyed by the dnotify kernel requirement. Read the last
|
||||
discussion "DNOTIFY to INOTIFY migration" posted in 2014 and while
|
||||
still not officially depreciated, dnotify was officially "replaced"
|
||||
by inotify in Linux 2.6.13 in 2005. Would be nice to sync this
|
||||
requirement across the codebase.
|
||||
|
||||
V2: Init wd to -1 not 0
|
||||
|
||||
diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
|
||||
index c12e878..c29dba6 100644
|
||||
--- a/utils/idmapd/idmapd.c
|
||||
+++ b/utils/idmapd/idmapd.c
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
-#include <sys/poll.h>
|
||||
+#include <sys/inotify.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
@@ -205,15 +205,16 @@ void usage(char *progname)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
- int fd = 0, opt, fg = 0, nfsdret = -1;
|
||||
+ int wd = -1, opt, fg = 0, nfsdret = -1;
|
||||
struct idmap_clientq icq;
|
||||
- struct event rootdirev, clntdirev, svrdirev;
|
||||
+ struct event rootdirev, clntdirev, svrdirev, inotifyev;
|
||||
struct event initialize;
|
||||
struct passwd *pw;
|
||||
struct group *gr;
|
||||
struct stat sb;
|
||||
char *xpipefsdir = NULL;
|
||||
int serverstart = 1, clientstart = 1;
|
||||
+ int inotify_fd;
|
||||
int ret;
|
||||
char *progname;
|
||||
char *conf_path = NULL;
|
||||
@@ -373,18 +374,15 @@ main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
- if ((fd = open(pipefsdir, O_RDONLY)) == -1)
|
||||
- xlog_err("main: open(%s): %s", pipefsdir, strerror(errno));
|
||||
-
|
||||
- if (fcntl(fd, F_SETSIG, SIGUSR1) == -1)
|
||||
- xlog_err("main: fcntl(%s): %s", pipefsdir, strerror(errno));
|
||||
-
|
||||
- if (fcntl(fd, F_NOTIFY,
|
||||
- DN_CREATE | DN_DELETE | DN_MODIFY | DN_MULTISHOT) == -1) {
|
||||
- xlog_err("main: fcntl(%s): %s", pipefsdir, strerror(errno));
|
||||
- if (errno == EINVAL)
|
||||
- xlog_err("main: Possibly no Dnotify support in kernel.");
|
||||
+ inotify_fd = inotify_init1(IN_NONBLOCK);
|
||||
+ if (inotify_fd == -1) {
|
||||
+ xlog_err("Unable to initialise inotify_init1: %s\n", strerror(errno));
|
||||
+ } else {
|
||||
+ wd = inotify_add_watch(inotify_fd, pipefsdir, IN_CREATE | IN_DELETE | IN_MODIFY);
|
||||
+ if (wd < 0)
|
||||
+ xlog_err("Unable to inotify_add_watch(%s): %s\n", pipefsdir, strerror(errno));
|
||||
}
|
||||
+
|
||||
TAILQ_INIT(&icq);
|
||||
|
||||
/* These events are persistent */
|
||||
@@ -394,6 +392,10 @@ main(int argc, char **argv)
|
||||
signal_add(&clntdirev, NULL);
|
||||
signal_set(&svrdirev, SIGHUP, svrreopen, NULL);
|
||||
signal_add(&svrdirev, NULL);
|
||||
+ if ( wd >= 0) {
|
||||
+ event_set(&inotifyev, inotify_fd, EV_READ | EV_PERSIST, dirscancb, &icq);
|
||||
+ event_add(&inotifyev, NULL);
|
||||
+ }
|
||||
|
||||
/* Fetch current state */
|
||||
/* (Delay till start of event_dispatch to avoid possibly losing
|
||||
@@ -402,7 +404,7 @@ main(int argc, char **argv)
|
||||
evtimer_add(&initialize, &now);
|
||||
}
|
||||
|
||||
- if (nfsdret != 0 && fd == 0)
|
||||
+ if (nfsdret != 0 && wd < 0)
|
||||
xlog_err("main: Neither NFS client nor NFSd found");
|
||||
|
||||
daemon_ready();
|
||||
@ -18,16 +18,6 @@
|
||||
|
||||
#include "nfslib.h"
|
||||
#include "exportfs.h"
|
||||
--- nfs-utils-2.3.1.orig/support/misc/file.c
|
||||
+++ nfs-utils-2.3.1/support/misc/file.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <dirent.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
+#include <limits.h>
|
||||
|
||||
#include "xlog.h"
|
||||
#include "misc.h"
|
||||
--- nfs-utils-2.3.1.orig/support/nfs/xcommon.c
|
||||
+++ nfs-utils-2.3.1/support/nfs/xcommon.c
|
||||
@@ -16,6 +16,7 @@
|
||||
@ -98,3 +88,13 @@
|
||||
|
||||
#include "misc.h"
|
||||
#include "exportfs.h"
|
||||
--- nfs-utils-2.3.4.orig/utils/nfsdcld/legacy.c
|
||||
+++ nfs-utils-2.3.4/utils/nfsdcld/legacy.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <limits.h>
|
||||
#include "cld.h"
|
||||
#include "sqlite.h"
|
||||
#include "xlog.h"
|
||||
|
||||
@ -1,22 +1,11 @@
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -408,7 +408,7 @@
|
||||
fi
|
||||
|
||||
dnl libdnsidmap specific checks
|
||||
-AC_CHECK_LIB([resolv], [__res_querydomain], , AC_MSG_ERROR(res_querydomain needed))
|
||||
+AC_CHECK_LIB([resolv], [res_querydomain], , AC_MSG_ERROR(res_querydomain needed))
|
||||
|
||||
AC_ARG_ENABLE([ldap],
|
||||
[AS_HELP_STRING([--disable-ldap],[Disable support for LDAP @<:default=detect@:>@])])
|
||||
@@ -547,11 +547,11 @@
|
||||
-pipe \
|
||||
@@ -578,10 +578,10 @@
|
||||
-Wall \
|
||||
-Wextra \
|
||||
- -Werror=strict-prototypes \
|
||||
$rpcgen_cflags \
|
||||
- -Werror=missing-prototypes \
|
||||
- -Werror=missing-declarations \
|
||||
+ -Wstrict-prototypes \
|
||||
+ -Wmissing-prototypes \
|
||||
+ -Wmissing-declarations \
|
||||
-Werror=format=2 \
|
||||
@ -25,7 +14,7 @@
|
||||
-Werror=missing-include-dirs \
|
||||
-Werror=strict-aliasing=2 \
|
||||
-Werror=init-self \
|
||||
@@ -579,10 +579,10 @@
|
||||
@@ -610,10 +610,10 @@
|
||||
|
||||
CHECK_CCSUPPORT([-Werror=format-overflow=2], [flg1])
|
||||
CHECK_CCSUPPORT([-Werror=int-conversion], [flg2])
|
||||
|
||||
123
main/nfs-utils/sqlite-printf.patch
Normal file
123
main/nfs-utils/sqlite-printf.patch
Normal file
@ -0,0 +1,123 @@
|
||||
From a8133e1fd174267536cd459e19cfe0a1cbbe037c Mon Sep 17 00:00:00 2001
|
||||
From: Steve Dickson <steved@redhat.com>
|
||||
Date: Wed, 22 May 2019 13:55:37 -0400
|
||||
Subject: [PATCH 1/1] sqlite.c: Use PRIx64 macro to print 64-bit integers
|
||||
|
||||
On 32 bit machines, using "%016lx" format throws out
|
||||
an format error due to the -Werror=format=2
|
||||
compiler option. On 64 bit machines using that
|
||||
format is correct.
|
||||
|
||||
So use the PRIx64 macro to have the correct
|
||||
format defined on the different machines.
|
||||
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
utils/nfsdcld/sqlite.c | 21 +++++++++++----------
|
||||
1 file changed, 11 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/utils/nfsdcld/sqlite.c b/utils/nfsdcld/sqlite.c
|
||||
index faa62f9..cd658ef 100644
|
||||
--- a/utils/nfsdcld/sqlite.c
|
||||
+++ b/utils/nfsdcld/sqlite.c
|
||||
@@ -59,6 +59,7 @@
|
||||
#include <limits.h>
|
||||
#include <sqlite3.h>
|
||||
#include <linux/limits.h>
|
||||
+#include <inttypes.h>
|
||||
|
||||
#include "xlog.h"
|
||||
#include "sqlite.h"
|
||||
@@ -535,7 +536,7 @@ sqlite_copy_cltrack_records(int *num_rec)
|
||||
xlog(L_ERROR, "Unable to begin transaction: %s", err);
|
||||
goto rollback;
|
||||
}
|
||||
- ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016lx\";",
|
||||
+ ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%" PRIx64 "\";",
|
||||
current_epoch);
|
||||
if (ret < 0) {
|
||||
xlog(L_ERROR, "sprintf failed!");
|
||||
@@ -550,7 +551,7 @@ sqlite_copy_cltrack_records(int *num_rec)
|
||||
xlog(L_ERROR, "Unable to clear records from current epoch: %s", err);
|
||||
goto rollback;
|
||||
}
|
||||
- ret = snprintf(buf, sizeof(buf), "INSERT INTO \"rec-%016lx\" "
|
||||
+ ret = snprintf(buf, sizeof(buf), "INSERT INTO \"rec-%" PRIx64 "\" "
|
||||
"SELECT id FROM attached.clients;",
|
||||
current_epoch);
|
||||
if (ret < 0) {
|
||||
@@ -703,7 +704,7 @@ sqlite_insert_client(const unsigned char *clname, const size_t namelen)
|
||||
int ret;
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
|
||||
- ret = snprintf(buf, sizeof(buf), "INSERT OR REPLACE INTO \"rec-%016lx\" "
|
||||
+ ret = snprintf(buf, sizeof(buf), "INSERT OR REPLACE INTO \"rec-%" PRIx64 "\" "
|
||||
"VALUES (?);", current_epoch);
|
||||
if (ret < 0) {
|
||||
xlog(L_ERROR, "sprintf failed!");
|
||||
@@ -748,7 +749,7 @@ sqlite_remove_client(const unsigned char *clname, const size_t namelen)
|
||||
int ret;
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
|
||||
- ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016lx\" "
|
||||
+ ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%" PRIx64 "\" "
|
||||
"WHERE id==?;", current_epoch);
|
||||
if (ret < 0) {
|
||||
xlog(L_ERROR, "sprintf failed!");
|
||||
@@ -798,7 +799,7 @@ sqlite_check_client(const unsigned char *clname, const size_t namelen)
|
||||
int ret;
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
|
||||
- ret = snprintf(buf, sizeof(buf), "SELECT count(*) FROM \"rec-%016lx\" "
|
||||
+ ret = snprintf(buf, sizeof(buf), "SELECT count(*) FROM \"rec-%" PRIx64 "\" "
|
||||
"WHERE id==?;", recovery_epoch);
|
||||
if (ret < 0) {
|
||||
xlog(L_ERROR, "sprintf failed!");
|
||||
@@ -873,7 +874,7 @@ sqlite_grace_start(void)
|
||||
tcur++;
|
||||
|
||||
ret = snprintf(buf, sizeof(buf), "UPDATE grace "
|
||||
- "SET current = %ld, recovery = %ld;",
|
||||
+ "SET current = %" PRId64 ", recovery = %" PRId64 ";",
|
||||
(int64_t)tcur, (int64_t)trec);
|
||||
if (ret < 0) {
|
||||
xlog(L_ERROR, "sprintf failed!");
|
||||
@@ -891,7 +892,7 @@ sqlite_grace_start(void)
|
||||
goto rollback;
|
||||
}
|
||||
|
||||
- ret = snprintf(buf, sizeof(buf), "CREATE TABLE \"rec-%016lx\" "
|
||||
+ ret = snprintf(buf, sizeof(buf), "CREATE TABLE \"rec-%" PRIx64 "\" "
|
||||
"(id BLOB PRIMARY KEY);",
|
||||
tcur);
|
||||
if (ret < 0) {
|
||||
@@ -915,7 +916,7 @@ sqlite_grace_start(void)
|
||||
* values in the grace table, just clear out the records for
|
||||
* the current reboot epoch.
|
||||
*/
|
||||
- ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%016lx\";",
|
||||
+ ret = snprintf(buf, sizeof(buf), "DELETE FROM \"rec-%" PRIx64 "\";",
|
||||
tcur);
|
||||
if (ret < 0) {
|
||||
xlog(L_ERROR, "sprintf failed!");
|
||||
@@ -976,7 +977,7 @@ sqlite_grace_done(void)
|
||||
goto rollback;
|
||||
}
|
||||
|
||||
- ret = snprintf(buf, sizeof(buf), "DROP TABLE \"rec-%016lx\";",
|
||||
+ ret = snprintf(buf, sizeof(buf), "DROP TABLE \"rec-%" PRIx64 "\";",
|
||||
recovery_epoch);
|
||||
if (ret < 0) {
|
||||
xlog(L_ERROR, "sprintf failed!");
|
||||
@@ -1027,7 +1028,7 @@ sqlite_iterate_recovery(int (*cb)(struct cld_client *clnt), struct cld_client *c
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- ret = snprintf(buf, sizeof(buf), "SELECT * FROM \"rec-%016lx\";",
|
||||
+ ret = snprintf(buf, sizeof(buf), "SELECT * FROM \"rec-%" PRIx64 "\";",
|
||||
recovery_epoch);
|
||||
if (ret < 0) {
|
||||
xlog(L_ERROR, "sprintf failed!");
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user