[comp.unix.ultrix] ksh/hesiod

schemers@vela.acs.oakland.edu (Roland Schemers III) (01/25/91)

Hello! More and more hesiod fun for everyone!

I just noticed that the ksh ~ expansion does not seem to work with
hesiod. I logged into a system being served by hesiod, and tried
a 'echo ~someuser', where someuser is a valid user, and the ksh
just printed '~someuser'. If you just type 'echo ~' it works, but
anything else doesn't. It appears that either the ksh is directly
reading the password file, or is using the getpw routines without 
hesiod support. This is happening in 4.0/4.1 mips/vax.

Roland



-- 
Roland J. Schemers III                              Systems/Network Manager
schemers@vela.acs.oakland.edu (Ultrix)              Oakland University 
schemers@argo.acs.oakland.edu (VMS)                 Rochester, MI 48309-4401
~Disclaimer::Disclaimer() { reboot(RB_HALT); }      (313)-370-4323

chet@odin.INS.CWRU.Edu (Chet Ramey) (01/26/91)

In article <4825@vela.acs.oakland.edu> schemers@vela.acs.oakland.edu (Roland Schemers III) writes:

>I just noticed that the ksh ~ expansion does not seem to work with
>hesiod. I logged into a system being served by hesiod, and tried
>a 'echo ~someuser', where someuser is a valid user, and the ksh
>just printed '~someuser'. If you just type 'echo ~' it works, but
>anything else doesn't. It appears that either the ksh is directly
>reading the password file, or is using the getpw routines without 
>hesiod support. This is happening in 4.0/4.1 mips/vax.

With a bare ~ or ~/xxxx, ksh just substitutes the value of $HOME, so
that will always work, whether you are using hesion, YP/NIS, ndbm,
or some other mechanism to manage the `password file'.

For the ~user expansions, old versions of ksh just perform the `regexp
search on /etc/passwd'.  I have been told that ksh88 includes code to
directly call YP, if the machine it is running on is using it.

I guess ksh just avoids the getpw* routines under any circumstances.  The
reason used to be that these routines used stdio, which used malloc, which
conflicted with the private ksh memory management scheme (which it
inherited from the Bourne shell).  I don't know whether or not this is
still the case.

Chet
-- 
Chet Ramey				``There's just no surf in
Network Services Group			  Cleveland, U.S.A. ...''
Case Western Reserve University
chet@ins.CWRU.Edu		My opinions are just those, and mine alone.