how does /usr/bin/login get the login name?

how does /usr/bin/login get the login name?

Post by Adam Ste » Fri, 19 Nov 1999 04:00:00



I've been thinking of writing a dialback program for Solaris (v2.6).
I was thinking I could have ttymon call my program which would then
call /usr/bin/login.  I can't figure out how /usr/bin/login gets
its information.  I have ttymon calling a program that prints the
arguments it gets and environment variables.  Before my program is
called, the "login: " prompt is shown.  I type in a user name and
then my program is called.  The user name is not given as an option
or in an environment variable.  How does the login program get the
user name?  The man page for login says it will prompt for the login
name if not given, but when I dial up, I don't get the "login: "
prompt twice, so it must be getting it somehow.

Thanks for any info.

--

Disclaimer: Any/All views expressed
here have been proved to be my own.   [http://www.csh.rit.edu/~adam/]

 
 
 

how does /usr/bin/login get the login name?

Post by Greg Andre » Fri, 19 Nov 1999 04:00:00



>I've been thinking of writing a dialback program for Solaris (v2.6).
>I was thinking I could have ttymon call my program which would then
>call /usr/bin/login.  I can't figure out how /usr/bin/login gets
>its information.  I have ttymon calling a program that prints the
>arguments it gets and environment variables.  Before my program is
>called, the "login: " prompt is shown.  I type in a user name and
>then my program is called.  The user name is not given as an option
>or in an environment variable.  How does the login program get the
>user name?  The man page for login says it will prompt for the login
>name if not given, but when I dial up, I don't get the "login: "
>prompt twice, so it must be getting it somehow.

This is described in the "SERVICE INVOCATION" section of the ttymon
man page.  The description of ttymon's "connect-on-carrier" flag
tells how ttymon will run the service program immediately, without
prompting for a login name.

  -Greg
--

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

 
 
 

how does /usr/bin/login get the login name?

Post by Casper H.S. Dik - Network Security Engine » Sat, 20 Nov 1999 04:00:00


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>I've been thinking of writing a dialback program for Solaris (v2.6).
>I was thinking I could have ttymon call my program which would then
>call /usr/bin/login.  I can't figure out how /usr/bin/login gets
>its information.  I have ttymon calling a program that prints the
>arguments it gets and environment variables.  Before my program is
>called, the "login: " prompt is shown.  I type in a user name and
>then my program is called.  The user name is not given as an option
>or in an environment variable.  How does the login program get the
>user name?  The man page for login says it will prompt for the login
>name if not given, but when I dial up, I don't get the "login: "
>prompt twice, so it must be getting it somehow.

Login reads the data from stdin; login will not print "login:" because
ttymon sets "TTYPROMPT" in the environment.

ttymon does not read from stdin; it looks at the data non-destructively.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

how does /usr/bin/login get the login name?

Post by Charles Comb » Sat, 20 Nov 1999 04:00:00



> I've been thinking of writing a dialback program for Solaris (v2.6).
> I was thinking I could have ttymon call my program which would then
> call /usr/bin/login.  I can't figure out how /usr/bin/login gets
> its information.  I have ttymon calling a program that prints the
> arguments it gets and environment variables.  Before my program is
> called, the "login: " prompt is shown.  I type in a user name and
> then my program is called.  The user name is not given as an option
> or in an environment variable.  How does the login program get the
> user name?  The man page for login says it will prompt for the login
> name if not given, but when I dial up, I don't get the "login: "
> prompt twice, so it must be getting it somehow.

stdin

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Senior Systems Engineer            |  Tel - (978)262-6251
Cadence Design Corp.               |  Fax - (978)262-6201
270 Billerica Rd.                  |
Chelmsford, MA 01824               |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Ignorance of one's ignorance is the malady of the ignorant."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 
 
 

how does /usr/bin/login get the login name?

Post by Charles Comb » Sat, 20 Nov 1999 04:00:00




> > I've been thinking of writing a dialback program for Solaris (v2.6).
> > I was thinking I could have ttymon call my program which would then
> > call /usr/bin/login.  I can't figure out how /usr/bin/login gets
> > its information.  I have ttymon calling a program that prints the
> > arguments it gets and environment variables.  Before my program is
> > called, the "login: " prompt is shown.  I type in a user name and
> > then my program is called.  The user name is not given as an option
> > or in an environment variable.  How does the login program get the
> > user name?  The man page for login says it will prompt for the login
> > name if not given, but when I dial up, I don't get the "login: "
> > prompt twice, so it must be getting it somehow.

> stdin

Sorry, didn't read the whole post. I thought the poster wanted to know where
login gets the username, not ttymon.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Senior Systems Engineer            |  Tel - (978)262-6251
Cadence Design Corp.               |  Fax - (978)262-6201
270 Billerica Rd.                  |
Chelmsford, MA 01824               |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Ignorance of one's ignorance is the malady of the ignorant."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 
 
 

1. getting users login name after login from server

Hi,

I have got authuser working as in people are asked to supply a valid
userID and password (direved hourly from the main passwd file by a perl
script run from cron as root.

But the perl program called by the browser needs to get the users ID
(The one who just logged on) and for some reason our ENV is never set
with the users ID, although the browser knows it is still a valid user.

Next is there a common cgi program that can be called when the user
clicks a logoff link in an html page to clear out the usersID and
password, so if they went back into the secure area they would be asked
to Authenticate themselves once more? Apart from closing the browser
down.

I would guess it would be SetEnv instruction, where does this go
srm.conf or access.conf?

M
--
Mark Worsdall - Oh no, I've run out of underpants :(



Web site Monitoring:-             http://www.shadow.org.uk/SiteSight/

2. HELP! RH 5.2 Fails Initial Install Boot

3. Why does /bin/login and /usr/bin/newgrp not have setuid bit set?

4. Is Daewoo monitor suitable for Linux

5. Login without login getting recorded into last login file

6. Strange behaviour with JavaScript (Netscape+Apache)

7. /usr/bin, /usr/local/bin, /sbin or /opt/bin, /var/opt/bin - I'm confused.

8. New Internet Protection Services

9. /usr/bin/ls /usr/ucb/ls /usr/local/bin/ls

10. /bin /usr/bin /usr/local/bin etc

11. /usr/bin/login

12. (Re: Thanks) SECURITY (Solaris 8) /usr/bin/login echoing username

13. Could someone post or mail me the MD5 sum of /usr/bin/login of OBSD 3.0?