Updated to latest upstream release: nfs-utils-2-4-3 (bz 1787831)

Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
Steve Dickson 2020-02-10 09:32:14 -05:00
parent a8546a4738
commit 46bad1b8a4
5 changed files with 8 additions and 521 deletions

4
.gitignore vendored
View File

@ -1,4 +1,4 @@
x86_64 x86_64
Makefile Makefile
/nfs-utils-2.4.2.tar.xz /nfs-utils-2.4.3.tar.xz
nfs-utils-2.4.2/ nfs-utils-2.4.3/

View File

@ -1,27 +0,0 @@
commit 0095435db8228d5a88ec35a63cb64271e2e648a8
Author: Steve Dickson <steved@redhat.com>
Date: Thu Dec 19 12:48:31 2019 -0500
libnfsidmap: Turn off default verbosity
Commit f080188e changed the library's verbosity
to be on by default. The patch turns it off by
default
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1774787
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/support/nfsidmap/libnfsidmap.c b/support/nfsidmap/libnfsidmap.c
index 9299e65..d11710f 100644
--- a/support/nfsidmap/libnfsidmap.c
+++ b/support/nfsidmap/libnfsidmap.c
@@ -101,7 +101,7 @@ static void default_logger(const char *fmt, ...)
#pragma GCC visibility pop
nfs4_idmap_log_function_t idmap_log_func = default_logger;
-int idmap_verbosity = 2;
+int idmap_verbosity = 0;
#pragma GCC visibility push(hidden)
static int id_as_chars(char *name, uid_t *id)

View File

@ -1,486 +0,0 @@
diff --git a/aclocal/kerberos5.m4 b/aclocal/kerberos5.m4
index faa5804..bf0e88b 100644
--- a/aclocal/kerberos5.m4
+++ b/aclocal/kerberos5.m4
@@ -42,7 +42,9 @@ AC_DEFUN([AC_KERBEROS_V5],[
-f $dir/lib32/libgssapi_krb5.a -o \
-f $dir/lib32/libgssapi_krb5.so -o \
-f $dir/lib64/libgssapi_krb5.a -o \
- -f $dir/lib64/libgssapi_krb5.so \) ; then
+ -f $dir/lib64/libgssapi_krb5.so -o \
+ -f $dir/lib/$(uname -m)-linux-gnu/libgssapi_krb5.a -o \
+ -f $dir/lib/$(uname -m)-linux-gnu/libgssapi_krb5.so \) ; then
AC_DEFINE(HAVE_KRB5, 1, [Define this if you have MIT Kerberos libraries])
KRBDIR="$dir"
gssapi_lib=gssapi_krb5
diff --git a/configure.ac b/configure.ac
index 9ba9d4b..e969975 100644
--- a/configure.ac
+++ b/configure.ac
@@ -510,6 +510,7 @@ AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
+AC_CHECK_TYPES([struct file_handle])
dnl *************************************************************
dnl Check for functions
@@ -533,11 +534,23 @@ AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \
gethostbyaddr gethostbyname gethostname getmntent \
- getnameinfo getrpcbyname getrpcbynumber getrpcbynumber_r getifaddrs \
+ getnameinfo getrpcbyname getifaddrs \
gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \
ppoll realpath rmdir select socket strcasecmp strchr strdup \
strerror strrchr strtol strtoul sigprocmask name_to_handle_at])
+save_CFLAGS=$CFLAGS
+save_LIBS=$LIBS
+CFLAGS="$CFLAGS $AM_CPPFLAGS"
+LIBS="$LIBS $LIBTIRPC"
+AC_CHECK_FUNCS([getrpcbynumber getrpcbynumber_r])
+CFLAGS=$save_CFLAGS
+LIBS=$save_LIBS
+
+if test "$ac_cv_func_getrpcbynumber_r" != "yes" -a "$ac_cv_func_getrpcbynumber" != "yes"; then
+ AC_MSG_ERROR([Neither getrpcbynumber_r nor getrpcbynumber are available])
+fi
+
dnl *************************************************************
dnl Check for data sizes
dnl *************************************************************
diff --git a/support/junction/junction.c b/support/junction/junction.c
index ab6caa6..41cce26 100644
--- a/support/junction/junction.c
+++ b/support/junction/junction.c
@@ -23,6 +23,10 @@
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/support/junction/xml.c b/support/junction/xml.c
index 7005e95..813110b 100644
--- a/support/junction/xml.c
+++ b/support/junction/xml.c
@@ -327,7 +327,7 @@ junction_parse_xml_read(const char *pathname, int fd, const char *name,
if (retval != FEDFS_OK)
return retval;
- xlog(D_CALL, "%s: XML document contained in junction:\n%ld.%s",
+ xlog(D_CALL, "%s: XML document contained in junction:\n%zu.%s",
__func__, len, (char *)buf);
retval = junction_parse_xml_buf(pathname, name, buf, len, doc);
diff --git a/support/misc/file.c b/support/misc/file.c
index e7c3819..06f6bb2 100644
--- a/support/misc/file.c
+++ b/support/misc/file.c
@@ -18,6 +18,10 @@
* along with nfs-utils. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <sys/stat.h>
#include <string.h>
diff --git a/support/misc/mountpoint.c b/support/misc/mountpoint.c
index c6217f2..14d6731 100644
--- a/support/misc/mountpoint.c
+++ b/support/misc/mountpoint.c
@@ -3,6 +3,10 @@
* check if a given path is a mountpoint
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <string.h>
#include "xcommon.h"
#include <sys/stat.h>
diff --git a/support/misc/xstat.c b/support/misc/xstat.c
index 661e29e..a438fbc 100644
--- a/support/misc/xstat.c
+++ b/support/misc/xstat.c
@@ -51,6 +51,9 @@ statx_do_stat(int fd, const char *pathname, struct stat *statbuf, int flags)
statx_copy(statbuf, &stxbuf);
return 0;
}
+ /* glibc emulation doesn't support AT_STATX_DONT_SYNC */
+ if (errno == EINVAL)
+ errno = ENOSYS;
if (errno == ENOSYS)
statx_supported = 0;
} else
diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c
index 9dc4cf1..7c4cf37 100644
--- a/support/nfs/cacheio.c
+++ b/support/nfs/cacheio.c
@@ -15,6 +15,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <nfslib.h>
#include <stdio.h>
#include <stdio_ext.h>
diff --git a/support/nfs/nfs_mntent.c b/support/nfs/nfs_mntent.c
index 05a4c68..25e5944 100644
--- a/support/nfs/nfs_mntent.c
+++ b/support/nfs/nfs_mntent.c
@@ -9,7 +9,7 @@
*/
#include <stdio.h>
-#include <string.h> /* for index */
+#include <string.h> /* for strchr */
#include <ctype.h> /* for isdigit */
#include <sys/stat.h> /* for umask */
#include <unistd.h> /* for ftruncate */
@@ -176,7 +176,7 @@ nfs_getmntent (mntFILE *mfp) {
return NULL;
mfp->mntent_lineno++;
- s = index (buf, '\n');
+ s = strchr (buf, '\n');
if (s == NULL) {
/* Missing final newline? Otherwise extremely */
/* long line - assume file was corrupted */
@@ -184,7 +184,7 @@ nfs_getmntent (mntFILE *mfp) {
fprintf(stderr, _("[mntent]: warning: no final "
"newline at the end of %s\n"),
mfp->mntent_file);
- s = index (buf, 0);
+ s = strchr (buf, 0);
} else {
mfp->mntent_errs = 1;
goto err;
diff --git a/systemd/Makefile.am b/systemd/Makefile.am
index 590258a..75cdd9f 100644
--- a/systemd/Makefile.am
+++ b/systemd/Makefile.am
@@ -36,6 +36,11 @@ unit_files += \
endif
endif
+if CONFIG_NFSDCLD
+unit_files += \
+ nfsdcld.service
+endif
+
man5_MANS = nfs.conf.man
man7_MANS = nfs.systemd.man
EXTRA_DIST = $(unit_files) $(man5_MANS) $(man7_MANS)
diff --git a/tools/locktest/testlk.c b/tools/locktest/testlk.c
index b392f71..ea51f78 100644
--- a/tools/locktest/testlk.c
+++ b/tools/locktest/testlk.c
@@ -81,7 +81,7 @@ main(int argc, char **argv)
if (fl.l_type == F_UNLCK) {
printf("%s: no conflicting lock\n", fname);
} else {
- printf("%s: conflicting lock by %d on (%ld;%ld)\n",
+ printf("%s: conflicting lock by %d on (%zd;%zd)\n",
fname, fl.l_pid, fl.l_start, fl.l_len);
}
return 0;
diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
index 0474783..bff759f 100644
--- a/utils/gssd/krb5_util.c
+++ b/utils/gssd/krb5_util.c
@@ -121,6 +121,9 @@
#include <krb5.h>
#include <rpc/auth_gss.h>
+#include <sys/types.h>
+#include <fcntl.h>
+
#include "nfslib.h"
#include "gssd.h"
#include "err_util.h"
@@ -314,6 +317,25 @@ gssd_find_existing_krb5_ccache(uid_t uid, char *dirname,
return err;
}
+/* check if the ticket cache exists, if not set nocache=1 so that new
+ * tgt is gotten
+ */
+static int
+gssd_check_if_cc_exists(struct gssd_k5_kt_princ *ple)
+{
+ int fd;
+ char cc_name[BUFSIZ];
+
+ snprintf(cc_name, sizeof(cc_name), "%s/%s%s_%s",
+ ccachesearch[0], GSSD_DEFAULT_CRED_PREFIX,
+ GSSD_DEFAULT_MACHINE_CRED_SUFFIX, ple->realm);
+ fd = open(cc_name, O_RDONLY);
+ if (fd < 0)
+ return 1;
+ close(fd);
+ return 0;
+}
+
/*
* Obtain credentials via a key in the keytab given
* a keytab handle and a gssd_k5_kt_princ structure.
@@ -348,6 +370,8 @@ gssd_get_single_krb5_cred(krb5_context context,
memset(&my_creds, 0, sizeof(my_creds));
+ if (!nocache && !use_memcache)
+ nocache = gssd_check_if_cc_exists(ple);
/*
* Workaround for clock skew among NFS server, NFS client and KDC
* 300 because clock skew must be within 300sec for kerberos
diff --git a/utils/mount/error.c b/utils/mount/error.c
index 562f312..986f066 100644
--- a/utils/mount/error.c
+++ b/utils/mount/error.c
@@ -62,7 +62,7 @@ static int rpc_strerror(int spos)
char *tmp;
if (estr) {
- if ((ptr = index(estr, ':')))
+ if ((ptr = strchr(estr, ':')))
estr = ++ptr;
tmp = &errbuf[spos];
diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c
index eedbdda..146d8f4 100644
--- a/utils/mount/fstab.c
+++ b/utils/mount/fstab.c
@@ -7,6 +7,10 @@
* - Moved code to nfs-utils/support/nfs from util-linux/mount.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
@@ -57,7 +61,7 @@ mtab_does_not_exist(void) {
return var_mtab_does_not_exist;
}
-static int
+int
mtab_is_a_symlink(void) {
get_mtab_info();
return var_mtab_is_a_symlink;
diff --git a/utils/mount/fstab.h b/utils/mount/fstab.h
index 313bf9b..8676c8c 100644
--- a/utils/mount/fstab.h
+++ b/utils/mount/fstab.h
@@ -7,6 +7,7 @@
#define _PATH_FSTAB "/etc/fstab"
#endif
+int mtab_is_a_symlink(void);
int mtab_is_writable(void);
int mtab_does_not_exist(void);
void reset_mtab_info(void);
diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index 91f1087..2be3dc2 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -204,6 +204,13 @@ create_mtab (void) {
int flags;
mntFILE *mfp;
+ /* Avoid writing if the mtab is a symlink to /proc/mounts, since
+ that would create a file /proc/mounts in case the proc filesystem
+ is not mounted, and the fchmod below would also fail. */
+ if (mtab_is_a_symlink()) {
+ return;
+ }
+
lock_mtab();
mfp = nfs_setmntent (MOUNTED, "a+");
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index 3861f84..e5186c7 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -221,7 +221,7 @@ static void auth_unix_gid(int f)
xlog(L_ERROR, "auth_unix_gid: error writing reply");
}
-#if USE_BLKID
+#ifdef USE_BLKID
static const char *get_uuid_blkdev(char *path)
{
/* We set *safe if we know that we need the
@@ -446,7 +446,7 @@ static int same_path(char *child, char *parent, int len)
if (count_slashes(p) != count_slashes(parent))
return 0;
-#if HAVE_NAME_TO_HANDLE_AT
+#if defined(HAVE_NAME_TO_HANDLE_AT) && defined(HAVE_STRUCT_FILE_HANDLE)
struct {
struct file_handle fh;
unsigned char handle[128];
diff --git a/utils/mountd/fsloc.c b/utils/mountd/fsloc.c
index cf42944..1b869b6 100644
--- a/utils/mountd/fsloc.c
+++ b/utils/mountd/fsloc.c
@@ -128,7 +128,7 @@ static struct servers *method_list(char *data)
bool v6esc = false;
xlog(L_NOTICE, "method_list(%s)", data);
- for (ptr--, listsize=1; ptr; ptr=index(ptr, ':'), listsize++)
+ for (ptr--, listsize=1; ptr; ptr=strchr(ptr, ':'), listsize++)
ptr++;
list = malloc(listsize * sizeof(char *));
copy = strdup(data);
diff --git a/utils/nfsdcld/Makefile.am b/utils/nfsdcld/Makefile.am
index 2c4e5a1..273d64f 100644
--- a/utils/nfsdcld/Makefile.am
+++ b/utils/nfsdcld/Makefile.am
@@ -1,9 +1,5 @@
## Process this file with automake to produce Makefile.in
-# These binaries go in /sbin (not /usr/sbin), and that cannot be
-# overridden at config time. The kernel "knows" the /sbin name.
-sbindir = /sbin
-
man8_MANS = nfsdcld.man
EXTRA_DIST = $(man8_MANS)
diff --git a/utils/nfsdcld/legacy.c b/utils/nfsdcld/legacy.c
index 07f477a..3c6bea6 100644
--- a/utils/nfsdcld/legacy.c
+++ b/utils/nfsdcld/legacy.c
@@ -15,6 +15,10 @@
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <dirent.h>
#include <string.h>
diff --git a/utils/nfsdcld/nfsdcld.c b/utils/nfsdcld/nfsdcld.c
index b064336..2ad1001 100644
--- a/utils/nfsdcld/nfsdcld.c
+++ b/utils/nfsdcld/nfsdcld.c
@@ -378,7 +378,7 @@ cld_not_implemented(struct cld_client *clnt)
bsize = cld_message_size(cmsg);
wsize = atomicio((void *)write, clnt->cl_fd, cmsg, bsize);
if (wsize != bsize)
- xlog(L_ERROR, "%s: problem writing to cld pipe (%ld): %m",
+ xlog(L_ERROR, "%s: problem writing to cld pipe (%zd): %m",
__func__, wsize);
/* reopen pipe, just to be sure */
@@ -409,7 +409,7 @@ cld_get_version(struct cld_client *clnt)
xlog(D_GENERAL, "Doing downcall with status %d", cmsg->cm_status);
wsize = atomicio((void *)write, clnt->cl_fd, cmsg, bsize);
if (wsize != bsize) {
- xlog(L_ERROR, "%s: problem writing to cld pipe (%ld): %m",
+ xlog(L_ERROR, "%s: problem writing to cld pipe (%zd): %m",
__func__, wsize);
ret = cld_pipe_open(clnt);
if (ret) {
@@ -459,7 +459,7 @@ reply:
xlog(D_GENERAL, "Doing downcall with status %d", cmsg->cm_status);
wsize = atomicio((void *)write, clnt->cl_fd, cmsg, bsize);
if (wsize != bsize) {
- xlog(L_ERROR, "%s: problem writing to cld pipe (%ld): %m",
+ xlog(L_ERROR, "%s: problem writing to cld pipe (%zd): %m",
__func__, wsize);
ret = cld_pipe_open(clnt);
if (ret) {
@@ -498,7 +498,7 @@ reply:
cmsg->cm_status);
wsize = atomicio((void *)write, clnt->cl_fd, cmsg, bsize);
if (wsize != bsize) {
- xlog(L_ERROR, "%s: problem writing to cld pipe (%ld): %m",
+ xlog(L_ERROR, "%s: problem writing to cld pipe (%zd): %m",
__func__, wsize);
ret = cld_pipe_open(clnt);
if (ret) {
@@ -548,7 +548,7 @@ reply:
cmsg->cm_status);
wsize = atomicio((void *)write, clnt->cl_fd, cmsg, bsize);
if (wsize != bsize) {
- xlog(L_ERROR, "%s: problem writing to cld pipe (%ld): %m",
+ xlog(L_ERROR, "%s: problem writing to cld pipe (%zd): %m",
__func__, wsize);
ret = cld_pipe_open(clnt);
if (ret) {
@@ -607,7 +607,7 @@ reply:
xlog(D_GENERAL, "Doing downcall with status %d", cmsg->cm_status);
wsize = atomicio((void *)write, clnt->cl_fd, cmsg, bsize);
if (wsize != bsize) {
- xlog(L_ERROR, "%s: problem writing to cld pipe (%ld): %m",
+ xlog(L_ERROR, "%s: problem writing to cld pipe (%zd): %m",
__func__, wsize);
ret = cld_pipe_open(clnt);
if (ret) {
@@ -667,7 +667,7 @@ reply:
xlog(D_GENERAL, "Doing downcall with status %d", cmsg->cm_status);
wsize = atomicio((void *)write, clnt->cl_fd, cmsg, bsize);
if (wsize != bsize) {
- xlog(L_ERROR, "%s: problem writing to cld pipe (%ld): %m",
+ xlog(L_ERROR, "%s: problem writing to cld pipe (%zd): %m",
__func__, wsize);
ret = cld_pipe_open(clnt);
if (ret) {
@@ -737,7 +737,7 @@ out:
int
main(int argc, char **argv)
{
- char arg;
+ int arg;
int rc = 0;
bool foreground = false;
char *progname;
diff --git a/utils/nfsdcld/sqlite.c b/utils/nfsdcld/sqlite.c
index 23be797..09518e2 100644
--- a/utils/nfsdcld/sqlite.c
+++ b/utils/nfsdcld/sqlite.c
@@ -512,7 +512,7 @@ sqlite_startup_query_grace(void)
current_epoch = tcur;
recovery_epoch = trec;
ret = 0;
- xlog(D_GENERAL, "%s: current_epoch=%lu recovery_epoch=%lu",
+ xlog(D_GENERAL, "%s: current_epoch=%"PRIu64" recovery_epoch=%"PRIu64,
__func__, current_epoch, recovery_epoch);
out:
sqlite3_finalize(stmt);
@@ -1223,7 +1223,7 @@ sqlite_grace_start(void)
current_epoch = tcur;
recovery_epoch = trec;
- xlog(D_GENERAL, "%s: current_epoch=%lu recovery_epoch=%lu",
+ xlog(D_GENERAL, "%s: current_epoch=%"PRIu64" recovery_epoch=%"PRIu64,
__func__, current_epoch, recovery_epoch);
out:
@@ -1282,7 +1282,7 @@ sqlite_grace_done(void)
}
recovery_epoch = 0;
- xlog(D_GENERAL, "%s: current_epoch=%lu recovery_epoch=%lu",
+ xlog(D_GENERAL, "%s: current_epoch=%"PRIu64" recovery_epoch=%"PRIu64,
__func__, current_epoch, recovery_epoch);
out:

View File

@ -1,8 +1,8 @@
Summary: NFS utilities and supporting clients and daemons for the kernel NFS server Summary: NFS utilities and supporting clients and daemons for the kernel NFS server
Name: nfs-utils Name: nfs-utils
URL: http://linux-nfs.org/ URL: http://linux-nfs.org/
Version: 2.4.2 Version: 2.4.3
Release: 3.rc3%{?dist}.1 Release: 0%{?dist}
Epoch: 1 Epoch: 1
# group all 32bit related archs # group all 32bit related archs
@ -16,9 +16,6 @@ Source4: nfsconvert.py
Source5: nfsconvert.sh Source5: nfsconvert.sh
Source6: nfs-convert.service Source6: nfs-convert.service
Patch001: nfs-utils.2.4.3-rc3.patch
Patch002: nfs-utils-2.4.2-libnfsidmap-verbose.patch
Patch100: nfs-utils-1.2.1-statdpath-man.patch Patch100: nfs-utils-1.2.1-statdpath-man.patch
Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch
Patch102: nfs-utils-1.2.5-idmap-errmsg.patch Patch102: nfs-utils-1.2.5-idmap-errmsg.patch
@ -368,6 +365,9 @@ fi
%{_pkgdir}/*/var-lib-nfs-rpc_pipefs.mount %{_pkgdir}/*/var-lib-nfs-rpc_pipefs.mount
%changelog %changelog
* Sat Feb 08 2020 Steve Dickson <steved@redhat.com> 2.4.3-0
- Updated to latest upstream release: nfs-utils-2-4-3 (bz 1787831)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.4.2-3.rc3.1 * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.4.2-3.rc3.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (nfs-utils-2.4.2.tar.xz) = c23b40202787b2bbf00640c55f92189d4d56bae3863b6d4729ed2a7469d56197fbe2f8d5eafb9dec5946cc5d5e0afb0485e94495e0a531b25a1bd0382067a1b0 SHA512 (nfs-utils-2.4.3.tar.xz) = 260359f06c1114915a96ee2a593137b02e24db03a414d8d52dadbccb272f7272cb2907e3877c824c80a5c9efeba09f5493c2c9144ef17e43e24c22b9e97cd605