Menu

#13 sudo -u oracle sudosh not working in HP-UX 11.31

v1.0_(example)
closed-fixed
nobody
None
5
2014-01-23
2010-06-09
No

I had to remove the -Werror compiler flag to get sudosh2 to compile on HP-UX 11.31 with HP AnsiC 6.20. This causes the compiler warning in rand.c line 25 (see below). In general everything work okay. Except when I try to execute sudo -u oracle sudosh. When I do, it drops the session. I've done this in other versions of HP-UX and it has worked perfectly. Here's the only thing that comes out of syslog and no sudosh-replay session is created.

Jun 9 14:01:11 server1 sudo: jro : TTY=pts/1 ; PWD=/home/jro ; USER=oracle ; COMMAND=/usr/local/bin/sudosh
Jun 9 14:01:11 server1 sudosh: stopping session for jro as oracle, tty , shell /bin/ksh

I appreciate to assistance.

Configuration summary:

Host type................: ia64-hp-hpux11.31
Perl.....................: /usr/bin/perl
CC.......................: cc
CFLAGS...................: -g

Package..................: sudosh2
Version..................: 1.0.3

Installation prefix......: /usr/local
Man directory............: /usr/local/share/man
sysconfdir...............: /etc

make
No suffix list.
make all-recursive
No suffix list.
Making all in src
source='sudosh.c' object='sudosh.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
cc -DHAVE_CONFIG_H -I. -I.. -g -c sudosh.c
source='rand.c' object='rand.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
cc -DHAVE_CONFIG_H -I. -I.. -g -c rand.c
"rand.c", line 25: warning #2186-D: pointless comparison of unsigned integer
with zero
if (len < 0)
^

source='parse.c' object='parse.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
cc -DHAVE_CONFIG_H -I. -I.. -g -c parse.c
source='string.c' object='string.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
cc -DHAVE_CONFIG_H -I. -I.. -g -c string.c
source='util.c' object='util.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
cc -DHAVE_CONFIG_H -I. -I.. -g -c util.c
cc -g -o sudosh sudosh.o rand.o parse.o string.o util.o
source='replay.c' object='replay.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
cc -DHAVE_CONFIG_H -I. -I.. -g -c replay.c
source='getopt.c' object='getopt.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
cc -DHAVE_CONFIG_H -I. -I.. -g -c getopt.c
cc -g -o sudosh-replay replay.o getopt.o string.o parse.o util.o
No suffix list.

Discussion

  • Josh Grebe

    Josh Grebe - 2010-07-09

    Compile issue is fixed in 1.0.4, which is going out now. As far as the session not functioning, can you try these tests:
    . run sudosh without sudo, and see if that works
    . run sudosh to start a user with a different shell
    if neither of those work, can you use strace to get an execution trace from just running sudosh directly?

     
  • Josh Grebe

    Josh Grebe - 2010-07-09
    • status: open --> pending
     
  • John Orndorff

    John Orndorff - 2010-07-09

    I can run sudosh with sudo from root, but not from a normal user.
    I think you meant to sudo a user with a different shell, and that works as well.

    In order to get the execution trace, I had to get tusc for hpux. But when I did the issue popped right out. It was attempting to record the session in /var/adm/sudosh. But it was trying to create the files as a normal user, and only superuser has write permissions on the /var/adm/sudosh directory. When I opened the directory up to be writable by everyone, it started working.

    Note: I went back to the system where I had this working before. It was running an old sudosh 1.6.3 and there the permissions on the /var/adm/sudosh directory were 733

     
  • John Orndorff

    John Orndorff - 2010-07-09

    I downloaded 1.0.4 and I still had to remove the -Werror compiler flag to get it to compile with my HP C compiler. But on the positive side, the warning in rand.c has been fixed.

    cc --version
    cc: HP C/aC++ B3910B A.06.20 [May 13 2008]

     
  • John Orndorff

    John Orndorff - 2010-07-09
    • status: pending --> open
     
  • Josh Grebe

    Josh Grebe - 2014-01-23

    Any compiler warning or errors should be fixes in 1.0.5.

    As far as your log location goes, this is a config file option, and can be directed to anywhere you like.
    from man sudosh.conf:
    logdir = /path/to/logging/directory Use this to set the default logging directory. Both sudosh and sudosh-replay will use this to deteremine the logging directory.

     
  • Josh Grebe

    Josh Grebe - 2014-01-23
    • status: open --> closed-fixed
    • Group: --> v1.0_(example)
     

Log in to post a comment.

Auth0 Logo