summaryrefslogtreecommitdiffstats
path: root/utils/gssd/gssd_proc.c
Commit message (Collapse)AuthorAgeFilesLines
* 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: 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-281-7/+2
| | | | | | | | | | | | | | | | | | | 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>
* 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>
* 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>
* gssd: Use /run/user/${UID} instead of /run/user/${USER}Nalin Dahyabhai2012-08-221-34/+2
| | | | | | | | | | 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>
* rpc.gssd: don't call poll(2) twice a secondChuck Lever2012-08-061-1/+1
| | | | | | | | | | | | | | | | 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: close upcall pipe on POLLHUPChuck Lever2012-07-191-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* gssd: Look for user creds in user defined directorySteve Dickson2012-03-221-2/+34
| | | | | | | | | 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 spkm3 support from gssdSimo Sorce2012-03-121-103/+3
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> 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>
* Removed warnings from gssd_proc.cSteve Dickson2010-08-091-3/+3
| | | | | | | | | | | | gssd_proc.c: In function 'create_auth_rpc_client': gssd_proc.c:939: warning: comparison between signed and unsigned integer expressions gssd_proc.c:939: warning: comparison between signed and unsigned integer expressions gssd_proc.c: In function 'handle_krb5_upcall': gssd_proc.c:1164: warning: comparison between signed and unsigned integer expressions gssd_proc.c: In function 'handle_spkm3_upcall': gssd_proc.c:1178: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from krb5_util.cSteve Dickson2010-08-091-1/+1
| | | | | | | | | krb5_util.c: In function 'realm_and_service_match': krb5_util.c:617: warning: unused parameter 'context' krb5_util.c: In function 'limit_krb5_enctypes': krb5_util.c:1275: warning: unused parameter 'uid' Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed some miscellaneous warnings in the new gssd code.Steve Dickson2010-04-161-3/+3
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Try to use kernel function to determine supported Kerberos enctypes.Kevin Coffman2010-04-161-1/+81
| | | | | | | | | This patch replaces a hard-coded list with a function to obtain the Kerberos encryption types that the kernel's rpcsec_gss code can support. Defaults to old behavior if kernel does not supply information. Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: on krb5 upcall, have gssd send a more granular error codeJeff Layton2010-01-121-2/+6
| | | | | | | | | | | | | | | | | | | | | Currently if a krb5 context expires, GSSAPI authenticated RPC calls start returning error (-EACCES in particular). This is bad when someone has a long running job that's doing filesystem ops on a krb5 authenticated NFS mount and just happens to forget to redo a 'kinit' in time. The existing gssd always does a downcall with a '-1' error code if there are problems, and the kernel always ignores this error code. Begin to fix this by having gssd distinguish between someone that has no credcache at all, and someone who has an expired one. In the case where there is an existing credcache, have gssd downcall with an error code of -EKEYEXPIRED. If there's not a credcache, then downcall with an error of -EACCES. We can then have the kernel use this error code to handle these situations differently. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: have gssd deal with scopeid field in upcallJeff Layton2009-12-111-25/+35
| | | | | | | | | | | | | | | | Recent kernels (2.6.32) have started displaying the scopeid for some addresses in the upcall. gssd doesn't know how to deal with them. Change gssd to use getaddrinfo instead of inet_pton since that can deal with scopeid's in addresses. That also allows us to elminate the port conversion in read_service_info. If getaddrinfo returns an address with a non-zero sin6_scope_id however, reject it. getnameinfo ignores that field and just uses the sin6_addr part when resolving. But, two addresses that differ only in sin6_scope_id could refer to completely different hosts. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: process service= attribute in new upcallOlga Kornievskaia2009-11-161-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add processing of the "service=" attribute in the new gssd upcall. If "service" is specified, then the kernel is indicating that we must use machine credentials for this request. (Regardless of the uid value or the setting of root_uses_machine_creds.) If the service value is "*", then any service name can be used. Otherwise, it specifies the service name that should be used. (For now, the values of service will only be "*" or "nfs".) Restricting gssd to use "nfs" service name is needed for when the NFS server is doing a callback to the NFS client. In this case, the NFS server has to authenticate itself as "nfs" -- even if there are other service keys such as "host" or "root" in the keytab. Another case when the kernel may specify the service attribute is when gssd is being asked to create the context for a SETCLIENT_ID operation. In this case, machine credentials must be used for the authentication. However, the service name used for this case is not important. Signed-off-by: Olga Kornievskaia <aglo@citi.umich.edu> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: process target= attribute in new upcallOlga Kornievskaia2009-11-161-3/+23
| | | | | | | | | | | | | | | | | | | | | | Add processing of the "target=" attribute in the new gssd upcall. Information in this field is used to construct the gss service name of the server for which gssd will create a context . This, along with the next patch handling "service=", is needed for callback security. For Kerberos, the NFS client will use a service principal present in its keytab during authentication of the SETCLIENT_ID operation. When establishing the context for the callback, the gssd on the NFS server will attempt to authenticate the callback against the principal name used by the client. Note: An NFS client machine must have a keytab for the callback authentication to succeed. Signed-off-by: Olga Kornievskaia <aglo@citi.umich.edu> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: handle new client upcallOlga Kornievskaia2009-11-161-31/+154
| | | | | | | | | | | | | | | | | | | | Add support for handling the new client-side upcall. The kernel, beginning with 2.6.29, will attempt to use a new pipe, "gssd", which can be used for upcalls for all gss mechanisms. The new upcall is text-based with an <attribute>=<value> format. Attribute/value pairs are separated by a space, and terminated with a new-line character. The intial version has two required attributes, mech=<gss_mechanism_name> and uid=<user's_UID_number>, and two optional attributes, target=<gss_target_name> and service=<value>. Future kernels may add new attribute/value pairs. Signed-off-by: Olga Kornievskaia <aglo@citi.umich.edu> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: print full client directory being handledOlga Kornievskaia2009-11-161-2/+2
| | | | | | | | | For convenience, add the full name of the upcall pipe being processed. (Distinquishes between "normal" upcall, and a callback upcall.) Signed-off-by: Olga Kornievskaia <aglo@citi.umich.edu> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: add upcall support for callback authenticationOlga Kornievskaia2009-11-161-33/+56
| | | | | | | | | | | | | | Change the processing so that all subdirectories within the rpc_pipefs directory are treated equally. Any "clnt" directories that show up within any of them are processed. (As suggested by Bruce Fields.) Note that the callback authentication will create a new "nfs4d_cb" subdirectory. Only new kernels (2.6.29) will create this new directory. (The need for this directory will go away with NFSv4.1 where the callback can be done on the same connection as the fore-channel.) Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: refactor update_client_list()Olga Kornievskaia2009-11-161-7/+21
| | | | | | | | | Split out the processing for a pipe to a separate routine. The next patch adds a new pipe to be processed. Signed-off-by: Olga Kornievskaia <aglo@citi.umich.edu> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Gssd blindly caches machine credentialsLukas Hejtmanek2009-08-271-34/+40
| | | | | | | | | | | | | | We have a problem with rpc.gssd which blindly caches machine credentials. E.g., if someone deletes /tmp/krb5cc_machine_REALM, rpc.gss does not create new one until the old one expires. Also, it has problems with clock skew, if time goes back and gssd thinks that machine credentials are not expired yet. The following patch tries to use cache but in case of failure, it tries it again without cache. Any comments? Signed-off-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Acked-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: add IPv6 code to gssdJeff Layton2009-04-151-0/+44
| | | | | | | | | | All of the pieces to handle IPv6 are now in place. Add IPv6-specific code wrapped in the proper #ifdef's so that IPv6 support works when it's enabled at build-time. Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: switch gssd to use standard function for getting an RPC clientJeff Layton2009-04-151-29/+12
| | | | | | | | | | We already have a common function for setting up an RPC client. That function uses the tirpc API when tirpc is enabled and is also already IPv6 enabled. Switch gssd to use it. Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: query for remote port using rpcbind instead of getaddrinfoJeff Layton2009-04-151-52/+86
| | | | | | | | | | | | | | | We already have the server's address from the upcall, so we don't really need to look it up again, and querying the local services DB for the port that the remote server is listening on is just plain wrong. Use rpcbind to set the port for the program and version that we were given in the upcall. The exception here is NFSv4. Since NFSv4 mounts are supposed to use a well-defined port then skip the rpcbind query for that and just set the port to the standard one (2049). Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: store the address given in the upcall for later useJeff Layton2009-04-151-16/+79
| | | | | | | | | | | | | | | | | The current upcall could be more efficient. We first convert the address to a hostname, and then later when we set up the RPC client, we do a hostname lookup to convert it back to an address. Begin to change this by keeping the address in the clnt_info that we get out of the upcall. Since a sockaddr has a port field, we can also eliminate the port from the clnt_info. Finally, switch to getnameinfo() instead of gethostbyaddr(). We'll need to use that call anyway when we add support for IPv6. Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Regardless though, it's dangerous to keep invalid pointers around likeJeff Layton2009-03-231-7/+8
| | | | | | | | | | this. Later code changes may make it more likely for this problem to occur. Also eliminate some unneeded NULL pointer checks before freeing memory. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: NULL-terminate buffer after read in read_service_info (try #2)Jeff Layton2009-03-231-1/+2
| | | | | | | | | | | | | Valgrind complains that we're passing an unintialized buffer to sscanf here. The main problem seems to be that we're not ensuring that the buffer is NULL terminated before we pass it off. This is the second version of this patch, the first one did not increase the buffer allocation by 1 which could have led to clobbering the next byte on the stack if nbytes == INFOBUFLEN. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Include legacy or TI-RPC headers, not bothChuck Lever2009-03-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Data type incompatibilities between the legacy RPC headers and the TI-RPC headers mean we can't use libtirpc with code that was compiled against the legacy RPC headers. The definition of rpcprog_t for example is "unsigned long" in the legacy library, but it's "uint32_t" for TI-RPC. On 32-bit systems, these types happen to have the same width, but on 64-bit systems they don't, making more complex data structures that use these types in fields ABI incompatible. Adopt a new strategy to deal with this issue. When --enable-tirpc is set, append "-I/usr/include/tirpc" to the compilation steps. This should cause the compiler to grab the tirpc/ headers instead of the legacy headers. Now, for TI-RPC builds, the TI-RPC legacy functions and the TI-RPC headers will be used. On legacy systems, the legacy headers and legacy glibc RPC implementation will be used. A new ./configure option is introduced to allow system integrators to use TI-RPC headers in some other location than /usr/include/tirpc. /usr/include/tirpc remains the default setting for this new option. The gssd implementation presents a few challenges, but it turns out the gssglue library is similar to the auth_gss pieces of TI-RPC. To avoid similar header incompatibility issues, gssd now uses libtirpc instead of libgssglue if --enable-tirpc is specified. There may be other issues to tackle with gssd, but for now, we just make sure it builds with --enable-tirpc. Note also: svc_getcaller() is a macro in both cases that points to a sockaddr field in the svc_req structure. The legacy version points to a sockaddr_in type field, but the TI-RPC version points to a sockaddr_in6 type field. rpc.mountd unconditionally casts the result of svc_getcaller() to a sockaddr_in *. This should be OK for TI-RPC as well, since rpc.mountd still uses legacy RPC calls (provided by glibc, or emulated by TI-RPC) to set up its listeners, and therefore rpc.mountd callers will always be from AF_INET addresses for now. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Use same style for including config.h that rest of nfs-utils usesChuck Lever2009-03-051-1/+5
| | | | | | | Clean up. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: By default, don't spam syslog when users' credentials expireKevin Coffman2009-01-051-4/+4
| | | | | | | | | | | | | | | | | | Change the priority of "common" log messages so that syslog doesn't get slammed/spammed when users' credentials expire, or there is another common problem which would cause error messages for all context creation requests. Note that this will now require that gssd or svcgssd option "-v" is used to debug these common cases. Original patch from Andrew Pollock <apollock@google.com>. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com> CC: Andrew Pollock <apollock@google.com>
* gssd/svcgssd: add support to retrieve actual context expirationKevin Coffman2008-12-111-2/+2
| | | | | | | | | Add some plumbing so that the context expiration can be returned while serializing the information. Later patch(es) will actually get the expiration and pass it down to the kernel. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* The default expiration of kernel gss contexts is the expirationLukas Hejtmanek2008-07-151-2/+1
| | | | | | | | | | | | | | | | | of the Kerberos ticket used in its creation. (For contexts created using the Kerberos mechanism.) Thus kdestroy has no effect in nullifying the kernel context. This patch adds -t <timeout> option to rpc.gssd so that the client's administrator may specify a timeout for expiration of contexts in kernel. After this timeout, rpc.gssd is consulted to create a new context. By default, timeout is 0 (i.e., no timeout at all) which follows the previous behavior. Signed-off-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd_setup_krb5_user_gss_ccache must return an error if no usable cache isLukas Hejtmanek2008-07-151-3/+2
| | | | | | | | found. Trying to use invalid default cache and continue is not good idea at all. Signed-off-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Kerberos credentials may be stored in multiple places. Make itVince Busam2008-05-071-3/+8
| | | | | | | | | | possible to search several directories for valid credentials when making NFS requests. Original patch from Vince Busam <vbusam@google.com> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>. Signed-off-by: Steve Dickson <steved@redhat.com>
* Check the info file nfs/rpc_pipefs/nfs/clnt?/info toOlga Kornievskaia2008-05-071-2/+12
| | | | | | | | | see if a port number was supplied. If so, use it rather than the default port number. Signed-off-by: Olga Kornievskaia <aglo@citi.umich.edu> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Turn down gssd's syslog verbosityTimo Aaltonen2008-03-131-1/+1
| | | | | Modified-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Use newly added keytab functionsKevin Coffman2007-03-311-3/+5
| | | | | | | | | | | | | | | | | | | | | | | Use the new functions added in the previous patch. Obtain machine credentials in a pre-determined order Look for appropriate machine credentials in the following order: root/<fqdn>@REALM nfs/<fqdn>@REALM host/<fqdn>@REALM root/<any-name>@REALM nfs/<any-name>@REALM host/<any-name>@REALM The first matching credential will be used. Also, the machine credentials to be used are now determined "on-demand" rather than at gssd startup. This allows keytab additions to be noticed and used without requiring a restart of gssd. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Add missing newlinesKevin Coffman2007-03-311-6/+6
| | | | | | | Add missing newlines to error messages. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Create two separate paths for pipefs_dir and pipefs_nfsdir.Kevin Coffman2007-03-191-11/+11
| | | | | | | | | Future work needs access to the base pipefs directory rather than the nfs subdirectory. Create two separate paths called pipefs_dir and pipefs_nfsdir with the name of each. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Add option to allow root to use credentials other than machine credentialsKevin Coffman2007-03-191-39/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a new option ("-n") to rpc.gssd to indicate that accesses as root (uid 0) should not use machine credentials, but should instead use "normal" Kerberos credentials obtained by root. This change was prompted by a suggestion and patch from Daniel Muntz <Dan.Muntz@netapp.com>. That patch suggested trying "normal" credentials first and falling back to using machine creds for uid 0 if normal creds failed. This opens up the case where root may have credentials as "foo@REALM" and begins accessing files. Then the context using those credentials expires and must be renewed. If the credentials are now expired, then root's new context would fall back and be created with the machine credentials. Instead, this patch insists that the administrator choose to use either machine credentials for accesses by uid 0 (the default behavior, as it was before) or "normal" credentials. In the latter case, arrangements must be made to obtain credentials before attempting a mount. There should be no doubts which credentials are used for uid 0. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Fix misc warning messagesKevin Coffman2006-10-171-0/+1
| | | | | | Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Clean up a few warning messages.