Operating System - HP-UX
1829701 Members
2180 Online
109992 Solutions
New Discussion

Re: SAM restricted shell - strange behaviour...

 
SOLVED
Go to solution
André Sorge
Advisor

SAM restricted shell - strange behaviour...

Hi there,

got a strange problem using sam on an HP-box using 11.i...
I restricted sam gui for users using sam -r (logged in as root), then specifying the allowed actions. So far, so good.
Testing the restricted gui as root using sam -f works as it should. But when I log in as a user and try to run sam, sam does not start and returns with:"invalid option -o"... Where does it get the "-o" from? It was not specified anywhere... There is no soft-link or alias set for sam afair.
The other thing that is really weird is, that with some users it runs properly, with some others not.
The newest patches for 11.i have been installed.

Did anyone experience similar probs or does anyone have a clue what to check?

Best regards,
AndrÃ
9 REPLIES 9
KapilRaj
Honored Contributor

Re: SAM restricted shell - strange behaviour...

I have not but it is always better to see the following

As root : -

#which sam

su - user01
which sam

Regds,

Kaps
Nothing is impossible
André Sorge
Advisor

Re: SAM restricted shell - strange behaviour...

Well, sam resides in /usr/sbin... As it should, probably. Any other ideas?

Thanks in advance,
Andre
RAC_1
Honored Contributor

Re: SAM restricted shell - strange behaviour...

Anything in samlog?

Login as user. What it says--type sam.
which sam.

Anil
There is no substitute to HARDWORK
André Sorge
Advisor

Re: SAM restricted shell - strange behaviour...

There is nothing to see in samlog. Sam immediately cancels at once giving the errormessage "invalid option -o" (as if you would try to run "sam -o", which returns the same error). So it actually does not have the opportunity to log anything.
Camel_1
Valued Contributor

Re: SAM restricted shell - strange behaviour...

After login to the use, what is result of command "which sam"?

Simon
André Sorge
Advisor

Re: SAM restricted shell - strange behaviour...

Output is always "/usr/sbin/sam". Therefore, a valid path is set and points to sam correctly.

I will check profiles of the users today. Maybe I find a clue.

Thanks,
AndrÃ
André Sorge
Advisor

Re: SAM restricted shell - strange behaviour...

Hi there!

Checked .profile of each user for typos and stuff, but nothing unusual. Checked also for aliases again, but nothing special.
Even tested various combinations with the .cf-files in /etc/sam/custom but still the same. So that is not the problem.
Double-checked that filesets of SAM are all configured.

The problem with the illegal option only exists with one user, so maybe there is something hidden in his profile. But were to look?
Is there any way to trace the files which are read during the login process (which vars are set and so on)? I think this is the only way to get out of SAM-hell...

Best regards,
Andre
Mark Grant
Honored Contributor
Solution

Re: SAM restricted shell - strange behaviour...

/usr/sbin/sam is a shell script. You can put some stuff in there youself as tests. For example, put an "echo $*" to see your arguments though "$@" might be better. Put a "env" to see which environment variables are set. Or put a "set -x" option at the start. Run it like this and compare the results with a user that does work.
Never preceed any demonstration with anything more predictive than "watch this"
André Sorge
Advisor

Re: SAM restricted shell - strange behaviour...

Hi Mark,

thanks a lot. At startup of SAM I saw that there is a "set -o vi".
I found out that in .shrc of the user there is a line "set -o vi". I removed that line and SAM worked. Creating a .kshrc in the profile with this line worked as well. So my problem is solved at last!

Good job!