Added more (commented out) options to nfsmount.conf

Signed-off-by: Steve Dickson <steved@redhat.com>
nfs-iostat: Fix columnarization of RPC statistics

Note: format() is new with Python 2.6

Signed-off-by: Steve Dickson <steved@redhat.com>
nfs-iostat: Fix attribute cache statistics

"nfs-iostat.py --attr" was displaying nonsense (like negative
counts and percentages).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
gssd: handle malloc failure appropriately in do_downcall

...and get rid of some pointless NULL ptr checks.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
gssd: make do_downcall a void return

...since its return code is ignored anyway.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
gssd: move hostbased name routines into separate file

In a later patch, we'll need gssd to call into this code as well as
svcgssd. Move it into a common file that both can link in.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
gssd: add new routine for generating a hostbased principal in a gss_buffer_t

We'll need a gss_buffer_t to pass to the downcall marshalling code.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
gssd: explicitly set lifetime_rec to 0 when gss_inquire_context fails

Contrary to the comment here, the lifetime_rec is not necessarily set
to zero on failure. That's only guaranteed to be the case if the context
has expired.

Cc: Andy Adamson <androsadamson@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
gssd: scrape the acceptor name out of the context

...and pass it to the kernel in the downcall. Legacy kernels will just
ignore the extra data, but with a proposed kernel patch the kernel will
grab this info and use it to verify requests on the v4.0 callback
channel.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
nfsd: Remove some warnings nfsd.c

nfsd.c:347:15: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
nfsd.c:385:13: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]

Signed-off-by: Steve Dickson <steved@redhat.com>
nfsdctltrack: ensure binary is installed in /sbin

The kernel "knows" this lives in /sbin, so just like
mount.nfs and osd_login, it must unconditionally be installed
there.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
start-statd: rpc.statd's systemd unit changed names.

Signed-off-by: Steve Dickson <steved@redhat.com>
mountd: fix segfault in add_name with newer gcc compilers

I hit a segfault in add_name with a mountd built with gcc-4.9.0. Some
NULL pointer checks got reordered such that a pointer was dereferenced
before checking to see whether it was NULL. The problem was due to
nfs-utils relying on undefined behavior, which tricked gcc into assuming
that the pointer would never be NULL.

At first I assumed that this was a compiler bug, but Jakub Jelinek and
Jeff Law pointed out:

"If old is NULL, then:

	strncpy(new, old, cp-old);

is undefined behavior (even when cp == old == NULL in that case),
therefore gcc assumes that old is never NULL, as otherwise it would be
invalid.

Just guard
	strncpy(new, old, cp-old);
	new[cp-old] = 0;
with if (old) { ... }."

This patch does that. If old is NULL though, then we still need to
ensure that new is NULL terminated, lest the subsequent strcats walk off
the end of it.

Cc: Jeff Law <law@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Signed-off-by: Jeff Layton <jlayton@poochiereds.net>
Signed-off-by: Steve Dickson <steved@redhat.com>