summaryrefslogtreecommitdiffstats
path: root/utils/gssd/gssd.h
Commit message (Collapse)AuthorAgeFilesLines
* gssd: Use /run/user/${UID} instead of /run/user/${USER}Nalin Dahyabhai2012-08-221-1/+1
| | | | | | | | | | 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-221-1/+1
| | | | | | | | | 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: close upcall pipe on POLLHUPChuck Lever2012-07-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+1
| | | | | | | | | 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-4/+1
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* svcgssd: Adding a <-p principal> flagEberhard Kuemmerle2010-09-281-1/+0
| | | | | | | | | Allow the principal that is used to get the machines creds definable on the command like with the new '-p <principal>'. This is useful in cluster environments. Signed-off-by: Eberhard Kuemmerle <E.Kuemmerle@fz-juelich.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: handle new client upcallOlga Kornievskaia2009-11-161-0/+3
| | | | | | | | | | | | | | | | | | | | 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: add upcall support for callback authenticationOlga Kornievskaia2009-11-161-1/+8
| | | | | | | | | | | | | | 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>
* nfs-utils: store the address given in the upcall for later useJeff Layton2009-04-151-1/+1
| | | | | | | | | | | | | | | | | 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>
* The rpc.gssd scans for any suitable kerberos ticket. In cross-realmLukas Hejtmanek2008-07-151-0/+1
| | | | | | | | | | environment this may not be the desired behaviour. Therefore a new option, -R preferred realm, is presented so that the rpc.gssd prefers tickets from this realm. By default, the default realm is preferred. 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>
* The default expiration of kernel gss contexts is the expirationLukas Hejtmanek2008-07-151-0/+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>
* Kerberos credentials may be stored in multiple places. Make itVince Busam2008-05-071-1/+2
| | | | | | | | | | 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-0/+1
| | | | | | | | | 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>
* Increase the number of concurrent krb5 mounts by increasingDrew Middlesworth2008-03-041-1/+1
| | | | | | | the size of the poll array Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Create two separate paths for pipefs_dir and pipefs_nfsdir.Kevin Coffman2007-03-191-1/+2
| | | | | | | | | 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-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Allow gssd ccaches in MEMORY: rather than FILE:Kevin Coffman2006-10-171-0/+1
| | | | | | | | | Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Add option to store gssd ccaches in a MEMORY: cache rather than the default FILE: cache. In response to suggestion from Steve Dickson <steved@redhat.com> and Nalin Dahyabhai <nalin@redhat.com>.
* Add option to specify directory to search for credentials cache filesneilbrown2006-03-281-0/+1
| | | | | | | | | From: Vince Busam <vbusam@google.com> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Add command line option to specify which directory should be searched to find credentials caches. (really this time)
* Add gss support from citi @ umichneilbrown2004-10-191-0/+89