OBS User unknown 2007-01-08 17:25:13 +00:00 committed by Git OBS Bridge
parent 9f6f807a9c
commit f57c76911a
4 changed files with 68 additions and 4 deletions

View File

@ -0,0 +1,23 @@
support/export/export.c | 2
support/include/misc.h | 3
support/include/nfslib.h | 1
support/misc/mountpoint.c | 158 +++++++++++++++++++++++++++++++++++++++++++++-
support/nfs/exports.c | 7 ++
utils/mountd/cache.c | 11 +--
utils/mountd/mountd.c | 7 +-
utils/mountd/mountd.h | 9 ++
8 files changed, 187 insertions(+), 11 deletions(-)
Index: nfs-utils-1.0.7/support/nfs/exports.c
===================================================================
--- nfs-utils-1.0.7.orig/support/nfs/exports.c
+++ nfs-utils-1.0.7/support/nfs/exports.c
@@ -435,6 +435,8 @@ bad_option:
ep->e_mountpoint = strdup(mp+1);
else
ep->e_mountpoint = strdup("");
+ } else if (strncmp(opt, "bind=/", 6) == 0) {
+ /* ignore this for now */
} else {
xlog(L_ERROR, "%s:%d: unknown keyword \"%s\"\n",
flname, flline, opt);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jan 8 18:23:44 CET 2007 - ro@suse.de
- move srvinfo.d to svcinfo.d (typo in fate entry)
- Added handling for NFSv4 bind mounts in init script (#229583)
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Dec 18 18:40:03 CET 2006 - ro@suse.de Mon Dec 18 18:40:03 CET 2006 - ro@suse.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package nfs-utils (Version 1.0.10) # spec file for package nfs-utils (Version 1.0.10)
# #
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine # This file and all modifications and additions to the pristine
# package are under the same license as the package itself. # package are under the same license as the package itself.
# #
@ -15,7 +15,7 @@ BuildRequires: gcc-c++ krb5-devel libevent librpcsecgss nfsidmap openldap2-deve
URL: http://nfs.sourceforge.net URL: http://nfs.sourceforge.net
Summary: Support Utilities for Kernel nfsd Summary: Support Utilities for Kernel nfsd
Version: 1.0.10 Version: 1.0.10
Release: 25 Release: 29
Group: Productivity/Networking/NFS Group: Productivity/Networking/NFS
Obsoletes: knfsd linuxnfs nfsutils Obsoletes: knfsd linuxnfs nfsutils
Provides: knfsd linuxnfs nfsutils Provides: knfsd linuxnfs nfsutils
@ -40,6 +40,7 @@ Patch3: nfs-utils-anon-uid32.patch
Patch4: nfs-utils-noroot.patch Patch4: nfs-utils-noroot.patch
Patch5: nfs-utils-gssd-select-ccache.patch Patch5: nfs-utils-gssd-select-ccache.patch
Patch6: nfs-utils-krb5.patch Patch6: nfs-utils-krb5.patch
Patch7: nfs-utils-1.0.7-bind-syntax.patch
%description %description
This package contains the NFS utilities. You can tune the number of This package contains the NFS utilities. You can tune the number of
@ -61,6 +62,7 @@ Authors:
%patch4 %patch4
%patch5 -p1 %patch5 -p1
%patch6 %patch6
%patch7 -p1
%build %build
%{?suse_update_config:%{suse_update_config -f }} %{?suse_update_config:%{suse_update_config -f }}
@ -191,6 +193,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man8/rpcdebug.8.gz %{_mandir}/man8/rpcdebug.8.gz
%changelog -n nfs-utils %changelog -n nfs-utils
* Mon Jan 08 2007 - ro@suse.de
- move srvinfo.d to svcinfo.d (typo in fate entry)
- Added handling for NFSv4 bind mounts in init script (#229583)
* Mon Dec 18 2006 - ro@suse.de * Mon Dec 18 2006 - ro@suse.de
- added nfsserver.xml to /etc/omc/srvinfo.d (fate#301835) - added nfsserver.xml to /etc/omc/srvinfo.d (fate#301835)
* Tue Aug 08 2006 - ro@suse.de * Tue Aug 08 2006 - ro@suse.de

View File

@ -63,6 +63,32 @@ check_for_nfsdfs() {
done < /proc/filesystems done < /proc/filesystems
} }
nfs4_bind_mounts() {
# In case of doubt, try "man sed" :-)
cat /etc/exports |
sed ':-0;s/\\$//;T;N;s/\n[[:space:]]*/ /;b-0' |
sed 's/^\([^[:space:]]*\).*bind=\([^,)]*\).*/\1 \2/;t;d' |
sort |
while read export dir; do
test -d $export || mkdir -p $export
# Fortunately, mount ignores unknown
# options, so we have an easy way to
# tag our "magic" bind mounts
mount -o bind,nfsexp $dir $export
done
}
nfs4_unbind_mounts() {
cat /etc/mtab |
grep '\<nfsexp\>' |
sort -r -k2 |
while read src mountpoint crap; do
umount $mountpoint
done
}
case "$1" in case "$1" in
start) start)
PARAMS=3 PARAMS=3
@ -76,10 +102,11 @@ case "$1" in
rc_status rc_status
fi fi
if [ "$NFS4_SUPPORT" = "yes" ]; then if [ "$NFS4_SUPPORT" = "yes" ]; then
echo "+2 +3 +4" > /proc/fs/nfsd/versions echo "+2 +3 +4" > /proc/fs/nfsd/versions
else else
echo "+2 +3 -4" > /proc/fs/nfsd/versions echo "+2 +3 -4" > /proc/fs/nfsd/versions
fi fi
nfs4_bind_mounts
/usr/sbin/exportfs -r /usr/sbin/exportfs -r
rc_status rc_status
/usr/sbin/rpc.nfsd $PARAMS /usr/sbin/rpc.nfsd $PARAMS
@ -109,6 +136,7 @@ case "$1" in
umount /proc/fs/nfsd umount /proc/fs/nfsd
rc_status rc_status
fi fi
nfs4_unbind_mounts
rc_status -v rc_status -v
;; ;;
try-restart) try-restart)
@ -130,6 +158,8 @@ case "$1" in
;; ;;
reload|force-reload) reload|force-reload)
echo -n "Reload kernel based NFS server" echo -n "Reload kernel based NFS server"
# Unfortunately, there's no sane way of doing this:
nfs4_unbind_mounts; nfs4_bind_mounts
/usr/sbin/exportfs -r /usr/sbin/exportfs -r
rc_status -v rc_status -v
;; ;;