mit kerberos running on Gentoo Linux
zhangweiwu@realss.com
zhangweiwu at realss.com
Mon Feb 9 19:52:06 EST 2009
Ken Raeburn schrieb:
> On Feb 7, 2009, at 23:34, zhangweiwu at realss.com wrote:
>> Dear all. I've installed mit version of kerberos V on my Gentoo Linux
>> through the package repository (called portage in Gentoo). krlogin works
>> but krsh strangely quit with a message I don't understand:
>>
>> zhangweiwu at esmeralda:~$ krlogin emerson.realss.com
>> Last login: Fri Feb 6 14:09:47 from 123.116.113.65
>> Linux Pyrrhus 2.6.18.1-fl2f-v1.02 #41 Thu Jul 3 10:13:18 CST 2008 mips64
>>
>> The programs included with the RAYS GNU/Linux system are free software;
>> the exact distribution terms for each program are described in the
>> individual files in /usr/share/doc/*/copyright.
>>
>> RAYS GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
>> permitted by applicable law.
>> zhangweiwu at Pyrrhus:~$ exit
>> logout
>> Connection closed.
>> zhangweiwu at esmeralda:~$ krsh emerson.realss.com
>> usage: rlogin [ -8EL] [-e char] [ -l username ] host
>>
>> Should I complain to Gentoo packager or MIT or have problem of my own?
>
> Kerberos rsh, like traditional BSD rsh, will run rlogin if you give it
> only a host name and no command to run. So it needs to know the right
> rlogin program to run. The one it's getting is clearly not the Kerberos
> rlogin program, so the Gentoo packager should be patching the rlogin
> source at the same time as renaming the installed commands.
Hi, You are right about it! See:
{0}zhangweiwu at esmeralda:~$ which rlogin
/usr/bin/rlogin
{0}zhangweiwu at esmeralda:~$ sudo ln -s /usr/bin/krlogin /usr/local/bin/rlogin
{0}zhangweiwu at esmeralda:~$ which rlogin
/usr/local/bin/rlogin
{0}zhangweiwu at esmeralda:~$ kinit
Password for zhangweiwu at REALSS.COM:
{0}zhangweiwu at esmeralda:~$ krsh emerson.realss.com
usage: rlogin [ -8EL] [-e char] [ -l username ] host
{1}zhangweiwu at esmeralda:~$ What the hell??
-bash: What: command not found
{127}zhangweiwu at esmeralda:~$ sudo mv /usr/bin/rlogin /usr/bin/rlogin.dist
{0}zhangweiwu at esmeralda:~$ sudo mv /usr/local/bin/rlogin /usr/bin/
{0}zhangweiwu at esmeralda:~$ krsh emerson.realss.com
Last login: Mon Feb 9 17:28:22 from 192.168.1.106
Linux Pyrrhus 2.6.18.1-fl2f-v1.02 #41 Thu Jul 3 10:13:18 CST 2008 mips64
The programs included with the RAYS GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
RAYS GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
zhangweiwu at Pyrrhus:~$ Thank god now it works.
-sh: Thank: command not found
zhangweiwu at Pyrrhus:~$ logout
Connection closed.
> It's probably complaining because krsh runs rlogin with the original
> argv[] argument list, with argv[0] still set to "krsh". Traditional BSD
> rlogin and rsh -- but not MIT's Kerberos versions, because of the
> tendency of some sites to rename these Kerberos versions -- has the
> "feature" that you can invoke the rlogin program under another name, and
> it'll assume that that's the hostname, so you could run "emerson w"
> instead of "rsh emerson w" as a shorthand. The programs figure this out
> by looking at argv[0] to see if it's "rsh" or "rlogin". I expect the
> Gentoo "rlogin" program is doing the same, and since "krsh" isn't what
> it thinks is the program name, it thinks you've supplied two hostnames,
> "krsh" and "emerson.realss.com", so you get an error.
Isn't it looking strange? I mean from the poor grade-one-level C
programming language course I managed, arguments are taken by constantly
calling optargs and go through each parameter with a "switch-case"
statement, which means later argument would automatically overwrite
previously ones unless programmer specifically wrote otherwise. Isn't it
more sane to, in that case, take the first parameter instead of argv[0]
for hostname?
> Since you
> *should* be running the Kerberos rlogin program which doesn't do this,
> we shouldn't really need to patch up the argv[] array to change the
> program name, but you're getting the wrong rlogin, so it matters.
Emm. If gentoo people do not want to overwrite non-kerberos
/usr/bin/rlogin (for package management reasons, because that means they
need to write a meta-selection package to let user choose from one of
netkit-rsh and kerberos-rsh, making it look more complicated), they
should patch /usr/bin/rsh to make it calls /usr/bin/krlogin instead of
/usr/bin/rlogin.
Thanks for your "guess"! I'll submit a bug report to gentoo if there
isn't already one.
More information about the Kerberos
mailing list