Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jun 1997 13:50:01 -0700 (PDT)
From:      Joe Traister <traister@gate.net>
To:        freebsd-bugs
Subject:   Re: bin/3903: Kerberized su -l fails with segfault
Message-ID:  <199706202050.NAA24227@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/3903; it has been noted by GNATS.

From: Joe Traister <traister@gate.net>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: bin/3903: Kerberized su -l fails with segfault
Date: Fri, 20 Jun 1997 16:48:59 -0400

 This is a multi-part message in MIME format.
 
 --------------ABD322CFF6D5DF3F54BC7E
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 The previous patch did not propogate the KRBTKFILE environment variable
 into the new environment when -l is given to su, making it impossible
 for kdestroy to find the ticket file.  This patch corrects that problem
 as well as the original segfault problem.
 
 --------------ABD322CFF6D5DF3F54BC7E
 Content-Type: text/plain; charset=us-ascii; name="su.patch"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline; filename="su.patch"
 
 --- su.c.dist	Sat May 10 18:07:58 1997
 +++ su.c	Fri Jun 20 13:58:53 1997
 @@ -101,7 +101,7 @@
  	char *targetpass;
  	int iswheelsu;
  #endif /* WHEELSU */
 -	char *p, **g, *user, *shell=NULL, *username, *cleanenv[20], **nargv, **np;
 +	char *p, **g, *user, *shell=NULL, *username, **cleanenv, **nargv, **np;
  	struct group *gr;
  	uid_t ruid;
  	int asme, ch, asthem, fastlogin, prio, i;
 @@ -113,6 +113,9 @@
  	char *style, *approvep, *auth_method = NULL;
  #endif
  #endif
 +#ifdef KERBEROS
 +	char *k;
 +#endif
  	char shellbuf[MAXPATHLEN];
  
  #ifdef WHEELSU
 @@ -371,6 +374,11 @@
  	if (!asme) {
  		if (asthem) {
  			p = getenv("TERM");
 +#ifdef KERBEROS
 +			k = getenv("KRBTKFILE");
 +#endif
 +			if ((cleanenv = calloc(20, sizeof(char*))) == NULL)
 +				errx(1, "calloc");
  			cleanenv[0] = NULL;
  			environ = cleanenv;
  #ifdef LOGIN_CAP
 @@ -381,6 +389,10 @@
  #endif
  			if (p)
  				(void)setenv("TERM", p, 1);
 +#ifdef KERBEROS
 +			if (k)
 +				(void)setenv("KRBTKFILE", k, 1);
 +#endif
  			if (chdir(pwd->pw_dir) < 0)
  				errx(1, "no directory");
  		}
 
 --------------ABD322CFF6D5DF3F54BC7E--
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706202050.NAA24227>