• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 132
  • Last Modified:

Mac telnet client seems to skip part of login script?

I have no idea how but it seems like a mac telnet client is skipping part of our login script.  We use tcsh and at the bottom of .login I have a section that executes and asks some questions and drops a person in some software instead of a command prompt.  But I see the person at the command prompt instead.

Any ideas?
0
Xetroximyn
Asked:
Xetroximyn
3 Solutions
 
Duncan RoeSoftware DeveloperCommented:
Sounds like something in the environment exported by the Mac. Would need to see your .login to say any more.
0
 
XetroximynAuthor Commented:
Here is the most relevant section that seems to be skipped

if ($USER == "client") then
    fixsuper
    fixsuper
    fixsuper
    cd /usr/cfmc/jobs
    clear
    tryagain:
    set jobfolder = ""
    echo    " "
    echo    " "
    echo    "   Please enter the JOB FOLDER from the instructions"
    echo    " "
    echo    "   or type 'abort' to logout"
    echo    " "
    echo -n " --> "
    set jobfolder = `head -1`
    if ( `echo ${jobfolder} | grep -c "abort"` ) then
        logout
    endif
    if ( ${jobfolder} == "" ) then
        clear
        goto tryagain
    endif

    set studycode = ""
    echo    " "
    echo    " "
    echo    "   Please enter the STUDY CODE from the instructions"
    echo    " "
    echo    "   or type 'abort' to logout"
    echo    " "
    echo -n " --> "
    set studycode = `head -1`
    if ( `echo ${studycode} | grep -c "abort"` ) then
        logout
    endif
    if ( ${studycode} == "" ) then
        clear
        goto tryagain
    endif

    if ( { ls /usr/cfmc/jobs/${jobfolder} } == "1" ) then
        clear
        cd ${jobfolder}
        if ( { ls /usr/cfmc/jobs/${jobfolder}/test } == "1" ) then
            clear
            cd test
            survent "init:${studycode};dbug;yes"
        else
            clear
            netsurv "init:${studycode};dbug;yes"
        endif
    else
        clear
        echo    " "
        echo    " It appears that job does not exist on the system"
        echo    " "
        echo    " Check the instructions and try again"
        echo    " "
        echo    " If you continue to have issues let us know"
        echo    " "
        echo    " "
        goto tryagain
    endif
    echo    " "
    echo    " "
    echo    " press enter to logout"
    echo    " "
    set logout = `head -1`
    logout
endif

Open in new window

0
 
ozoCommented:
shouldn't that be
if [ $USER == "client" ] ; then
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
XetroximynAuthor Commented:
This is actually csh/tcsh which has different IF syntax than bash.  Also this code works fine when people telnet from windows... but not mac.
0
 
Duncan RoeSoftware DeveloperCommented:
Get the output from the env command on the mac. Validate that no items in that output match shell variables that your script tests. (USER is probably all right but do verify it is what you expect in the logged-in session).
Failing that, please post the entire .login script. Also env output from the Mac.
0
 
TintinCommented:
The telnet client should have no influence on the login shell and any subsequent scripts run.

The only thing that I can think of that would affect the ability to run the script is if the assumptions about environment variables is incorrect.
0
 
Duncan RoeSoftware DeveloperCommented:
@Tintin: sorry I don't understand your last post. A telnet client can export environment variables to a server using IAC 36 in telnet protocol as per RFC 1408
I suspect the Mac is sending a variable with a name that .login assumes to be unset.
0
 
XetroximynAuthor Commented:
Thanks!  Iam trying to get the mac user to list their env so I can check
0
 
Duncan RoeSoftware DeveloperCommented:
You could put a line at the head of .login such as env>/tmp/$PPID.env - that will tell you all you need to know. (The process ID will be that of the in.telnetd invocation)
0
 
XetroximynAuthor Commented:
hmmm... seems it does not work.  If I login, no file is made.  If i do
source .login
in an existing window a file is made... any ideas?
0
 
Duncan RoeSoftware DeveloperCommented:
Not executing .login may be your problem. man tcsh tells me that it ought to be executed, at least if your login shell (in /etc/passwd) is /bin/tcsh or /bin/csh. Users may change their login shells using chsh - you might want to check that they haven't done that.

env>/tmp/$PPID.env is bash syntax - maybe you need to adjust for tcsh? But you did say it worked when you sourced it.
0
 
XetroximynAuthor Commented:
dur... So there are a number of users that share a login script... I forgot I recently separated my user from that, so I was not using the login script... it is in fact working.   Now I just need to get a mac user to login... (they are so rare.... most of our clients use windows)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now