summaryrefslogtreecommitdiffstats
path: root/utils/gssd
Commit message (Collapse)AuthorAgeFilesLines
* Provide macros for non-standard gss symbolsHEADmasterSimo Sorce2013-03-261-0/+10
| | | | | | | | | libgsglue uses non standard name for mechanism specific extensions to gssapi which normally have gss_krb5_* names. Provide symbol substitution headers so that nfs-utils can be compiled both against libgssglue and the native GSSAPI implementation. Signed-off-by: Simo Sorce <simo@redhat.com>
* Switch to use standard GSSAPI by defaultSimo Sorce2013-03-261-6/+6
| | | | | | | | Make libgssglue configurable still but disabled by default. There is no reason to use libgssglue anymore, and modern gssapi supports all needed features for nfs-utils. Signed-off-by: Simo Sorce <simo@redhat.com>
* gssd: gethostname(3) returns zero or -1, not an errnoChuck Lever2013-03-251-2/+2
| | | | | | | | | | According to "man gethostname," gssd is handling the return value of gethostname(3) incorrectly. It looks like other gethostname(3) call sites in nfs-utils are already correct. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Fix whitespace nitsChuck Lever2013-03-251-6/+6
| | | | | | Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Clean up gssd_setup_krb5_user_gss_ccache()Chuck Lever2013-03-251-8/+8
| | | | | | | | | | | | | | | | | | | | | | | Remove a contradictory portion of the block comment documenting gssd_find_existing_krb5_ccache(). This should have been removed by commit 289ad31e, which reversed the meaning of the function's return values. Note that, in user space, typically errno's are positive. But here we follow the kernel convention of using negative values to return error codes. Make the documenting comments explicit about the sign of an error return -- it will never be positive in the case of an error. And a nit: At the last return statement in gssd_setup_krb5_user_gss_ccache(), "err" always contains zero, as far as I can tell. Make it explicit (to human readers) that when execution reaches this point, gssd_setup_krb5_user_gss_ccache() is going to return "success." Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Update description of "-l" optionChuck Lever2013-03-252-22/+27
| | | | | | | | | | | | | | | Move most of the text in the description of the "-l" option up to the DESCRIPTION section, to match what was done for "-n" and "-k". The discussion is then less restricted by formatting, and we can take the space to introduce a few concepts before describing the behavior of rpc.gssd. Fix a few misspellings and grammar issues while here. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Clarify use of the term "machine credentials" in rpc.gssd(8)Chuck Lever2013-03-251-37/+105
| | | | | | | | | | | | | | | | | | | | | Our NFSv4 implementation uses machine credentials for operations that manage state on behalf of the whole client (for example, SETCLIENTID or RENEW). The rpc.gssd man page is missing a description of this usage, especially in the discussion of the "-n" option. The issue is that rpc.gssd's "-n" option requires root to acquire a user credential. In the absense of a system keytab (for instance, if the system is diskless) root's credential is not to be used as the machine credential that manages NFSv4 state. Group the discussion of machine credentials and UID 0 in one place to help clarify the discussion and simplify the description of several of these options. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Provide an introduction in gssd(8)Chuck Lever2013-03-251-14/+59
| | | | | | | | | | | | | | | It's good practice in user documentation to define terms before they are used. Add an INTRODUCTION section that defines important terms that are used in the DESCRIPTION and OPTIONS sections. The key concepts are GSS context, user credential, machine credential, and keytab. The RFCs I looked at capitalize both "gss" and "rpcsec_gss". For consistency I changed this throughout the man page. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: gssd.man is missing a description of the "-M" optionChuck Lever2013-03-251-10/+16
| | | | | | Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Use italics for option values and pathnamesChuck Lever2013-03-251-9/+21
| | | | | | | | | | Clean up: The usual convention for the values of command line options and for pathnames is for them to appear italicized, rather than emboldened or in double quotes. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd - expired credentials problemLukas Hejtmanek2013-03-251-0/+5
| | | | | | | | | I noticed that there is a problem with expired credentials if NFS client's time is even few seconds behind KDC's or NFS server's time. Client's kernel requests new GSS context but rpc.gssd is happy with existing krb cache as it valid according to local time. Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: don't krb5_free_context if krb5_init_context failsNeilBrown2013-03-251-7/+8
| | | | | | | | | Most places that call krb5_init_context() abort cleanly on failure. However these two then try to free the non-existent context, which doesn't end well. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: use correct test for success of getrlimit()NeilBrown2013-03-251-1/+1
| | | | | | | | | | | | | | | commit 7c5cb5e732a4b8704f8c79ec819c5d271e040339 gssd: base the size of the fd array on the RLIMIT_NOFILE limit. didn't actually work as claimed. It only uses the returned value if getrlimit() returns -1 -- which of course it only does when there was an error. So change the test to "== 0". Reported-by: Leonardo Chiquitto< lchiquitto@suse.com> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Call authgss_free_private_data() if library provides it.NeilBrown2013-02-131-1/+1
| | | | | | | | | | | | | | | | | | | librpcsecgss provides authgss_free_private_data() as a pair to authgss_get_private_data(). libtirpc does not - until recently. This ommision results in authgss_destroy_context() sending an incorrect RPCSEC_GSS_DESTROY request when gssd calls AUTH_DESTROY(). The call has been added to libtirpc, so this patch updates nfs-utils to check for the presense of the function in libtirpc and to set HAVE_AUTHGSS_FREE_PRIVATE_DATA if it is present. This is also set unconditionally if librpcsecgss is used. gssd is changed to test this value rather than HAVE_LIBTIRPC when chosing whether to call authgss_free_private_data(). Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: base the size of the fd array on the RLIMIT_NOFILE limit.NeilBrown2012-11-281-0/+5
| | | | | | | | | | | We have previously raised the size of the 'pollarray' once (32 -> 256) and I have had another request to make it bigger. Rather than changing the hard-coded value, make it depend on RLIMIT_NOFILE. This is an upper limit on the size of the array that can be passed to poll() anyway. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd_proc: remove pointless test against FD_ALLOC_BLOCK in process_pipedirNeilBrown2012-11-281-3/+2
| | | | | | | | I can see no possible point for this test against FD_ALLOC_BLOCK, so just remove the test. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd_proc: use pollsize, not FD_ALLOC_BLOCK, in get_poll_index()NeilBrown2012-11-281-2/+2
| | | | | | | | | | | | get_poll_index wants to walk the entire "pollarray", but uses the constant FD_ALLOC_BLOCK, rather than the variable pollsize (which has the same value). If we want to make the size of the array variable, it is best not to use the constant. As pollsize is 'unsigned long', 'i' should be too. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Handle the target name correctlyTrond Myklebust2012-11-283-14/+18
| | | | | | | | | | | | | | | | | | | The target name contains a hostname in the realm that we are authenticating to. Since we may be authenticating to a different realm than the default realm for the server, we should not assume that the target name and host name point to the same string. In fact, the kernel NFS client will always use its own hostname as the target name, since it is always authenticating to its own default realm. On the other hand, the NFS server's callback channel will pass the hostname of the NFS client that it is authenticating too (Section 3.4, RFC3530). This patch fixes the handling of the target name in process_krb5_upcall, and ensures that it gets passed to find_keytab_entry(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Remove insane sanity checks of the service nameTrond Myklebust2012-11-281-12/+1
| | | | | | | | | | | | | | | Either we trust the info file, or we don't. The current 'checks' only work for the combination 'nfs', '100003' and a version number between 2 and 4. The problem is that the callback channel also wants to use 'nfs' in combination with a different program number and version number. This patch throws the bogus checks out altogether and lets the kernel use whatever combination it wants.... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* svcgssd: Encryption types not being parsed correctlySteve Dickson2012-11-191-0/+7
| | | | | | | | When svcgssd reads the supported encrytion types from the kernel, they are prefixed with a 'enctypes='. That prefix has to be ignored to correctly parse the rest of the types. Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.gssd: Squelch compiler errorChuck Lever2012-10-301-1/+1
| | | | | | | | | gssd_proc.c: In function handle_krb5_upcall: gssd_proc.c:1117:2: warning: ISO C forbids return with expression, in function returning void [-pedantic] Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.gssd: Squelch compiler warningChuck Lever2012-10-301-5/+6
| | | | | | | | gssd_proc.c: At top level: gssd_proc.c:782:5: warning: no previous prototype for create_auth_rpc_client [-Wmissing-prototypes] Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.gssd: Squelch compiler warningChuck Lever2012-10-301-1/+1
| | | | | | | | | gss_util.c: At top level: gss_util.c:98:36: warning: ISO C does not allow extra ; outside of a function [-pedantic] Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* GSSD: Pass GSS_context lifetime to the kernel.Andy Adamson2012-10-181-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | From: Andy Adamson <andros@netapp.com> The kernel gss_cl_ctx stores the context lifetime in gc_expiry, set by gssd in do_downcall() called by process_krb5_upcall(). The lifetime value is currently not related at all to the Kerberos TGS lifetime. It is either set to the value of gssd -t <timeout>, or to a kernel default of 3600 seconds. Most of the time the gssd -t command line is not set, and a timeout value of zero was sent to the kernel triggering the use of the 3600 second kernel default timeout. In order for the kernel to properly know when to renew a context, or to stop buffering writes for a context about to expire, the gc_expiry value needs to reflect the credential lifetime used to create the context. Note that gss_inquire_cred returns the number of seconds for which the context remains valid in the lifetime_rec parameter. Send the actual TGS remaining lifetime to the kernel. It can still be overwritten by the gssd -t command line option, or set to the kernel default if the gss_inquire_cred call fails (which sets the lifetime_rec to zero). Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* utils: Return status 0 on clean exitsMantas Mikulenas2012-10-152-2/+2
| | | | | | Some init systems actually expect daemons to return 0 on success. Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Use /run/user/${UID} instead of /run/user/${USER}Nalin Dahyabhai2012-08-224-42/+35
| | | | | | | | | | Newer versions of systemd create a /run/user/${UID} directory instead of the /run/user/${USER} directory, so switch to scanning for that. To make the per-user directory bit a little less magical, change the default to incorporate a "%U", which gets dynamically expanded to the user's UID when needed. Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: scan for DIR: ccaches, tooNalin Dahyabhai2012-08-222-19/+33
| | | | | | | | | In addition to matching "FILE:krb5cc_*" in the specified directory or directories, also match "DIR:krb5cc*", if we find subdirectories with names that match the search pattern. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.gssd: don't call poll(2) twice a secondChuck Lever2012-08-062-17/+41
| | | | | | | | | | | | | | | | Use ppoll() instead. [ cel Wed Aug 1 11:44:46 EDT 2012 - autoconfiscated Bruce's version ] Related clean-up: Since we're pulling the poll/ppoll call out into a separate function, note that the second argument of poll(2) and ppoll(2) is not an int, it's an unsigned long. The nfds_t typedef is a recent invention, so use the raw type for compatibility with older glibc headers. Acked-by: J. Bruce Fields" <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.gssd: handle error to open toplevel directoryJ. Bruce Fields2012-08-061-4/+6
| | | | | | | | | | | | | From: "J. Bruce Fields" <bfields@redhat.com> Reverse the sense of the test here, and also add debugging and cleanup in the error case. (Though the lack of cleanup isn't currently a problem in practice since we'll eventually exit in this case.) Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.gssd: don't call printerr from signal handlerJ. Bruce Fields2012-08-061-3/+1
| | | | | | | | | | | | | | From: "J. Bruce Fields" <bfields@redhat.com> printerr() isn't actually safe to call from a signal handler. It might be possible to make it so, but I think this is the only case in nfs-utils where we try to, and I'm not convince it's worth it. This fixes a bug that would eventually cause mounts to hang when gssd is run with -vv. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.gssd: simplify signal handlingJ. Bruce Fields2012-08-061-6/+5
| | | | | | | | | From: "J. Bruce Fields" <bfields@redhat.com> We're not actually using the extra sa_sigaction parameters. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.gssd: close upcall pipe on POLLHUPChuck Lever2012-07-193-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a POLLHUP event is received on a pipe file descriptor, that means the other side has closed its end of the pipe. If the receiver does not close its end of the pipe, the pipe is left in an open-but-unlinked state. For a "gssd" upcall pipe, the kernel may close its end, removing the directory entry for it, and then later create a fresh pipe named "gssd" in the same directory. In this case, rpc.gssd continues to listen on the open-but-unlinked previous "gssd" pipe. Thus upcalls on the new "gssd" pipe are left unanswered. In addition, poll(2) continues to return POLLHUP on the old pipe. Since there is no logic to close the pipe in rpc.gssd, poll(2) always returns immediately, and rpc.gssd goes into a tight loop. Typically, the kernel closes upcall pipes and destroys their parent directory at the same time. When an RPC client's directory vanishes, rpc.gssd sees the change via dnotify and eventually invokes destroy_client() which closes the user-space end of the pipes. However, if the kernel wants to switch authentication flavors (say from AUTH_KRB5 to AUTH_UNIX) on an RPC client without destroying it, the upcall pipes go away, but the RPC client's directory remains. rpc.gssd invokes update_client_list(), but that logic never closes upcall pipes if the client directory is still in place. After a POLLHUP on a pipe, close it when rpc.gssd reconstructs its list of upcall clients. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add -l option to gssd to force legacy behaviourMichael Weiser2012-04-164-4/+40
| | | | | | | | | | Implement a new option -l to force gssd to ignore its kernel's crypto capabilities and use just the Single DES legacy encryption types to be compatible with old servers. This is only relevant if those servers have strong keys in their keytab. Signed-off-by: Steve Dickson <steved@redhat.com> Tested-by: Michael Weiser <weiser@science-computing.de>
* gssd: Look for user creds in user defined directorySteve Dickson2012-03-223-3/+36
| | | | | | | | | The user credential cache currently is kept in /tmp. In upcoming Kerberos release that will be moved to /run/user/<username>/. This patch enables gssd to look in both the old and new caches Signed-off-by: Steve Dickson <steved@redhat.com>
* Kill SPKM3: Remove also the dependent lipkey mechanismSimo Sorce2012-03-121-1/+0
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Kill SPKM3: remove spkm3 from common gssd codeSimo Sorce2012-03-124-191/+0
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Kill SPKM3: Remove spkm3 support from gssdSimo Sorce2012-03-125-122/+4
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Kill SPKM3: Remove spkm3 references from svcgssdSimo Sorce2012-03-122-7/+2
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* autoconf: only link binaries that need it to libtirpcJeff Layton2012-01-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is essentially the same as the previous version, but has been respun to fix up some merge conflicts with some of Chuck's recent changes. When we first added tirpc support, we took a "big hammer" approach, and had it add libtirpc to $LIBS. That had the effect of making it so that that library was linked into every binary. That's unnecessary, and wasteful with memory. Don't let AC_CHECK_LIB add -ltirpc to $LIBS. Instead, have the autoconf tests set $(LIBTIRPC) in the makefiles, and have the programs that need it explicitly include that library. In the event that we're not using libtirpc, then set $LIBTIRPC to a blank string. This necessitates a change to the bindresvport_sa check too. Since that library is no longer included in $LIBS, we need to convert that check to use AC_CHECK_LIB instead of AC_CHECK_FUNCS. This patch also fixes a subtle bug. If the library was usable, but the includes were not, the test would set $enable_tirpc to "no", but HAVE_LIBTIRPC would still be true. That configuration would likely fail to build. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* autoconf: don't let libnfsidmap test add -lnfsidmap to $LIBSJeff Layton2012-01-051-1/+1
| | | | | | | | | | ...as that makes that library get linked into every binary. Also, replace "hardcoded" -lnfsidmap linker flag in Makefiles with a AC_SUBST variable. This fixes a regression introduced in commit d7c64dd. Signed-off-by: Jeff Layton <jlayton@redhat.com>
* gssd: avoid double-free upon write failureJim Meyering2012-01-051-5/+4
| | | | | | | | | Free just calloc'd enc_key.data from one place, unconditionally, after calling write_lucid_keyblock, rather than from three places. Coverity spotted the possible double free. Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Fix typo in debug stringBenjamin Coddington2011-07-211-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* svcgssd: use correct defaults in call to gss_set_allowable_enctypesKevin Coffman2011-07-211-7/+30
| | | | | | | | | | | | | | | | | | | For the window of kernels between 2.6.35 (when the support for newer encryption was added) and 2.6.39 (when the ability to read the supported enctypes from the kernel was added), use a default of all enctypes when the kernel supported enctypes file cannot be read. For kernels before 2.6.35, continue to use a default of only DES enctypes. Note that the version of Kerberos must also support the use of gss_set_allowable_enctypes for service-side negotiations. See also: http://bugzilla.redhat.com/show_bug.cgi?id=719776 Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Document "-n" for svcgssdNeil Brown2011-06-071-2/+9
| | | | | | | The svcgssd man page doesn't mention the "-n" flag. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.svcgssd: Segmentation fault on errorSteve Dickson2011-04-191-1/+2
| | | | | | | | Commit 544ed73d introduced a regression that caused rpc.svcgssd to seg fault on "Wrong principal in request" errors in gss_accept_sec_context() Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Increase the stdio file buffer size for procfs filesSean Finney2011-04-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when writing to /proc/net/rpc/*/channel, if a cache line were larger than the default buffer size (likely 1024 bytes), mountd and svcgssd would split writes into a number of buffer-sized writes. Each of these writes would get an EINVAL error back from the kernel procfs handle (it expects line-oriented input and does not account for multiple/split writes), and no cache update would occur. When such behavior occurs, NFS clients depending on mountd to finish the cache operation would block/hang, or receive EPERM, depending on the context of the operation. This is likely to happen if a user is a member of a large (~100-200) number of groups. Instead, every fopen() on the procfs files in question is followed by a call to setvbuf(), using a per-file dedicated buffer of RPC_CHAN_BUF_SIZE length. Really, mountd should not be using stdio-style buffered file operations on files in /proc to begin with. A better solution would be to use internally managed buffers and calls to write() instead of these stdio calls, but that would be a more extensive change; so this is proposed as a quick and not-so-dirty fix in the meantime. Signed-off-by: Sean Finney <sean.finney@sonyericsson.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Add support to svcgssd to limit the negotiated enctypesKevin Coffman2011-04-066-10/+265
| | | | | | | | | | | | | | | | | | | | Recent versions of Kerberos libraries negotiate and use an "acceptor subkey". This negotiation does not consider that a service may have limited the encryption keys in its keytab. A patch (http://src.mit.edu/fisheye/changelog/krb5/?cs=24603) has been added to the MIT Kerberos code to allow an application to indicate that it wants to limit the encryption types negotiated. (This functionality has been available on the client/initiator side for a while. The new patch adds this support to the server/acceptor side.) This patch adds support to read a recently added nfsd proc file to determine the encryption types supported by the kernel and calls the function to limit encryption types negotiated for the acceptor subkey. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Gssd: modify wrong err message at handle_gssd_upcallMi Jinlong2011-02-091-1/+1
| | | | | | | | Modify wrong err message at handle_gssd_upcall when sscanf encryption types fail. Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Support AD style kerberos automatically in rpc.gssJason Gunthorpe2011-02-092-18/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | An Active Directory KDC will only grant a TGT for UPNs, getting a TGT for SPNs is not possible: $ kinit -k host/ib5@ADS.ORCORP.CA kinit: Client not found in Kerberos database while getting initial credentials The correct thing to do for machine credentials is to get a TGT for the computer UPN <HOSTNAME>$@REALM: $ kinit -k IB5\$ $ klist 12/22/10 11:43:47 12/22/10 21:43:47 krbtgt/ADS.ORCORP.CA@ADS.ORCORP.CA Samba automatically creates /etc/krb5.keytab entry for the computer UPN, this patch makes gssd_refresh_krb5_machine_credential prefer it above the SPNs if it is present. The net result is that nfs client works automatically out of the box if samba has been used to setup kerberos via 'net ads join' 'net ads keytab create' Tested using Windows Server 2003 R2 as the AD server. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Improve debugging in svcgssdSteve Dickson2011-01-143-3/+81
| | | | | | | | | | | | | Added in gss_display_error() which translates the GSS error into the actual GSS macro name. Currently only the translation of these errors are logged. Since those translations are buried deep in the kerberos library code, having the actual GSS macro name makes it easier to follow the code. Moved the nfs4_init_name_mapping() call into main() so if debug is enabled the DNS name and realms will be logged during start up. Signed-off-by: Steve Dickson <steved@redhat.com>