System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

11.23 PA logins command - return code 236

Mick_chair
Advisor

11.23 PA logins command - return code 236

I have noticed that on version 11.23 I get exit status 236 from the following command:

logins -oxl root ; echo $?
> 236

However on 11.31 I get the expected code 0

logins -oxl root ; echo $?
> 0

The output is correct for both versions and contains no error data.Can anyone explain this ? Its causing problems with some automation
we are using which calls the logins command and check the exit status.
9 REPLIES
Dennis Handly
Acclaimed Contributor

Re: 11.23 PA logins command - return code 236

Unfortunately logins(1m) doesn't mention anything about RETURN VALUE.

I suppose you could run tusc on it to see what it returns and where.
Mick_chair
Advisor

Re: 11.23 PA logins command - return code 236

Hi I got this response from another forum

"the wait() system call returns the lowest 8 bits of the actual return code.
It is treated as if it were an "unsigned char" in effect. It is not. So, negative small numbers returned become return values > 127, for example. Think ~(return value), we saw this on migrating from 11.0 to HPUX 11.23 PA_RISC-2 boxes, running 32 bit mode code. The 11.0 code is binary compatible, so we did not recompile.

Create a hashed alias in /etc/profile: a shell script wrapper for logins. It masks the return value to zero or 1. We ran into other commands that do this as well."

Running Tusc ..
write(1, "r o o t : 0 : s y s : 3 : : / : ".., 44) ..... = 44
getpid() ..................................... = 10519 (10518)
unlink("/var/spool/sockets/pwgr/client10519") ............ = 0
exit(236) ...................................... WIFEXITED(236)
236

I guess I will have to raise a problem for this


Dennis Handly
Acclaimed Contributor

Re: 11.23 PA logins command - return code 236

The source code for 11.31 only indicate the exit values of 0 and 1. I don't see 236 nor -20.
When I try your example on 11.23, I get 0.

>exit(236) ........ WIFEXITED(236) 236

You may have to get out your debugger to see where it occurs.
Ratzie
Super Advisor

Re: 11.23 PA logins command - return code 236

I am experiencing the exact same thing on 11.23
Never happened under 11.11.

I wrote a security script that checks this, and it kept failing until I realized it was returning 236

Could use some help as well.
Patrick Wallek
Honored Contributor

Re: 11.23 PA logins command - return code 236

Ditto for the failure on HP-UX 11.23 on a PA-RISC box here. Just running 'logins' as root results in a return code of 236.

This system has been patched in the last month with all patches recommended by an SWA analysis.
Dennis Handly
Acclaimed Contributor

Re: 11.23 PA logins command - return code 236

>Ratzie: I am experiencing the exact same thing on 11.23

I was using an Integrity box and am not sure why it should be different unless it is falling off the end of main with no return?
(Ah, the IPF C/aC++ compiler supports the C99 and C++ Standards that require this to return 0.)

I'll see if I can find a PA executable.
Dennis Handly
Acclaimed Contributor

Re: 11.23 PA logins command - return code 236

>ME: Ah, the IPF C/aC++ compiler supports the C99 and C++ Standards that require this to return 0.

Yes, this is exactly the problem, it fell off the end. It was fixed for 11.31.
Mick_chair
Advisor

Re: 11.23 PA logins command - return code 236

We have been trying to find ways around this.
Is it something that HP might consider getting a patch released for ?
Dennis Handly
Acclaimed Contributor

Re: 11.23 PA logins command - return code 236

>Is it something that HP might consider getting a patch released for?

Possibly, have you contacted the Response Center?