* "unset USERNAME" fix
@ 1996-06-04 15:41 Zefram
1996-06-07 11:27 ` Hrvoje Niksic
0 siblings, 1 reply; 2+ messages in thread
From: Zefram @ 1996-06-04 15:41 UTC (permalink / raw)
To: Z Shell workers mailing list
-----BEGIN PGP SIGNED MESSAGE-----
If one does "unset USERNAME", zsh dumps core. This fixes it, at least
to the point where it no longer crashes. (zsh's handling of special
parameters needs a serious overhaul.) It is now possible to clear the
environment by doing "unset -m \*".
-zefram
Index: Src/params.c
*** params.c 1996/05/30 14:18:48 1.5
--- params.c 1996/06/04 13:17:18
***************
*** 689,696 ****
return s;
}
! static char *nular[] =
! {"", NULL};
/**/
char **
--- 689,695 ----
return s;
}
! static char *nular[] = {"", NULL};
/**/
char **
***************
*** 1068,1076 ****
case PM_SCALAR:
(pm->sets.cfn) (pm, NULL);
break;
- case PM_INTEGER:
- (pm->sets.ifn) (pm, 0);
- break;
case PM_ARRAY:
(pm->sets.afn) (pm, NULL);
break;
--- 1067,1072 ----
***************
*** 1433,1439 ****
#ifdef HAVE_SETUID
struct passwd *pswd;
! if ((pswd = getpwnam(x)) && (pswd->pw_uid != cached_uid)) {
if(!setgid(pswd->pw_gid) && !setuid(pswd->pw_uid)) {
zsfree(cached_username);
cached_username = ztrdup(pswd->pw_name);
--- 1429,1435 ----
#ifdef HAVE_SETUID
struct passwd *pswd;
! if (x && (pswd = getpwnam(x)) && (pswd->pw_uid != cached_uid)) {
if(!setgid(pswd->pw_gid) && !setuid(pswd->pw_uid)) {
zsfree(cached_username);
cached_username = ztrdup(pswd->pw_name);
***************
*** 1640,1647 ****
hatchar = (bangchar) ? x[1] : '\0';
hashchar = (hatchar) ? x[2] : '\0';
zsfree(x);
! }
! else {
bangchar = '!';
hashchar = '#';
hatchar = '^';
--- 1636,1642 ----
hatchar = (bangchar) ? x[1] : '\0';
hashchar = (hatchar) ? x[2] : '\0';
zsfree(x);
! } else {
bangchar = '!';
hashchar = '#';
hatchar = '^';
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQCVAwUBMbQ5aXD/+HJTpU/hAQHiugP9EmroqUq/gxc4O0WY09PgqnZEIJ3qySAu
vM4KB3bbpNt6oPsrZSv6/NlichmETjKkETQ3ekW3J8La/YSuBBtAZnBvvgLD/rB9
7u9FDyTXpKi2N59PJsM8RkjuX4tuGYCykiGNUOM0ywCRWge4vK2Z3t2HfQJU4W11
7VM/U060Xtw=
=iN6w
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: "unset USERNAME" fix
1996-06-04 15:41 "unset USERNAME" fix Zefram
@ 1996-06-07 11:27 ` Hrvoje Niksic
0 siblings, 0 replies; 2+ messages in thread
From: Hrvoje Niksic @ 1996-06-07 11:27 UTC (permalink / raw)
To: Zefram; +Cc: Z Shell workers mailing list
Zefram (A.Main@dcs.warwick.ac.uk) wrote:
> If one does "unset USERNAME", zsh dumps core. This fixes it, at least
On what system? I haven't noticed this behaviour on Solaris 2.5
(beta19).
--
hniksic@srce.hr | Student of electrical engineering
hniksic@fly.cc.fer.hr | University of Zagreb, Croatia
------------------------------------------------------------------
`VI' - An editor used by those heretics that don't subscribe to
the Emacs religion.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1996-06-07 11:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-04 15:41 "unset USERNAME" fix Zefram
1996-06-07 11:27 ` Hrvoje Niksic
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).