public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-nfs@vger.kernel.org, nmorey@kalray.eu, rh-bugzilla@ensc.de,
	m.a.young@durham.ac.uk
Subject: Re: [PATCH] gssd: set $HOME to prevent recursion when home dirs are on kerberized NFS mount
Date: Wed, 22 Jan 2014 11:25:38 -0500	[thread overview]
Message-ID: <52DFF102.40406@RedHat.com> (raw)
In-Reply-To: <1390402755-10845-1-git-send-email-jlayton@redhat.com>



On 22/01/14 09:59, Jeff Layton wrote:
> Some krb5 routines will attempt to access files in the user's home
> directory. This is problematic for gssd when the user's homedir is
> on a kerberized NFS mount as it will end up deadlocked.
> 
> Fix this by setting $HOME unconditionally to "/".
> 
> Fixes this Fedora bug:
> 
>     https://bugzilla.redhat.com/show_bug.cgi?id=1052902
> 
> Reported-by: Enrico Scholz <rh-bugzilla@ensc.de>
> Reported-by: nmorey <nmorey@kalray.eu>
> Tested-by: Michael Young <m.a.young@durham.ac.uk>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
Committed... 

steved.

> ---
>  utils/gssd/gssd.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
> index fdad153..611ef1a 100644
> --- a/utils/gssd/gssd.c
> +++ b/utils/gssd/gssd.c
> @@ -46,6 +46,7 @@
>  
>  #include <unistd.h>
>  #include <err.h>
> +#include <errno.h>
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
> @@ -161,6 +162,18 @@ main(int argc, char *argv[])
>  		}
>  	}
>  
> +	/*
> +	 * Some krb5 routines try to scrape info out of files in the user's
> +	 * home directory. This can easily deadlock when that homedir is on a
> +	 * kerberized NFS mount. By setting $HOME unconditionally to "/", we
> +	 * prevent this behavior in routines that use $HOME in preference to
> +	 * the results of getpw*.
> +	 */
> +	if (setenv("HOME", "/", 1)) {
> +		printerr(1, "Unable to set $HOME: %s\n", strerror(errno));
> +		exit(1);
> +	}
> +
>  	i = 0;
>  	ccachesearch[i++] = strtok(ccachedir, ":");
>  	do {
> 

      reply	other threads:[~2014-01-22 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-22 14:59 [PATCH] gssd: set $HOME to prevent recursion when home dirs are on kerberized NFS mount Jeff Layton
2014-01-22 16:25 ` Steve Dickson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52DFF102.40406@RedHat.com \
    --to=steved@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=m.a.young@durham.ac.uk \
    --cc=nmorey@kalray.eu \
    --cc=rh-bugzilla@ensc.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox