summaryrefslogtreecommitdiffstats
path: root/utils/gssd/gssd_main_loop.c
Commit message (Collapse)AuthorAgeFilesLines
* rpc.gssd: don't call poll(2) twice a secondChuck Lever2012-08-061-16/+40
| | | | | | | | | | | | | | | | 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-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Kill SPKM3: Remove spkm3 support from gssdSimo Sorce2012-03-121-11/+0
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from gssd_main_loop.cSteve Dickson2010-08-091-0/+2
| | | | | | | | | gssd_main_loop.c: In function 'dir_notify_handler': gssd_main_loop.c:64: warning: unused parameter 'sig' gssd_main_loop.c:64: warning: unused parameter 'si' gssd_main_loop.c:64: warning: unused parameter 'data' Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: handle new client upcallOlga Kornievskaia2009-11-161-0/+11
| | | | | | | | | | | | | | | | | | | | 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-9/+79
| | | | | | | | | | | | | | 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-2/+1
| | | | | | | | | 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: Use same style for including config.h that rest of nfs-utils usesChuck Lever2009-03-051-0/+5
| | | | | | | Clean up. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: unblock DNOTIFY_SIGNAL in case it was blocked.Neil Brown2008-11-261-0/+6
| | | | | | | | | | | | | | | | | | | | I have a situation where rpc.gssd appears to not be working. Mount attempts which need to communicate with it block. I've narrowed down the problem to that fact that all realtime signals have been blocked. This means that DNOTIFY_SIGNAL (which is a realtime signal) is never delivered, so gssd never rescans the rpc_pipe/nfs directory. It seems start_kde (or whatever it is called) and all descendants have these signals blocked. xfce seems to do the same thing. gnome doesn't. So if you start rpc.gssd from a terminal window while logged in via KDE, it doesn't behave as expected. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add a debug message indicating that gssd is ready to process requestsKevin Coffman2007-03-311-0/+1
| | | | | | | Add a debug message indicating that gssd is ready to process requests 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-2/+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 gss support from citi @ umichneilbrown2004-10-191-0/+144