Bug 236 - No setproctitle() replacement for many unices
Summary: No setproctitle() replacement for many unices
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: -current
Hardware: Other All
: P2 enhancement
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2002-05-08 11:40 AEST by Damien Miller
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments
setproctitle() replacement for more OSs (13.35 KB, patch)
2002-05-08 11:41 AEST, Damien Miller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Damien Miller 2002-05-08 11:40:42 AEST
We don't have a setproctitle() replacement for most unices which lack it
Comment 1 Damien Miller 2002-05-08 11:41:38 AEST
Created attachment 93 [details]
setproctitle() replacement for more OSs
Comment 2 Damien Miller 2003-01-09 11:22:32 AEDT
This seems to work on Linux and I have had reports of it working on other
platforms too. Please test this patch and report here or on the list. I'd like
to get this in for the next version.
Comment 3 Darren Tucker 2003-01-09 16:19:53 AEDT
Patch id 93 works on AIX (tested 4.2.1, 4.3.3 & 5.1).

It does not work on Solaris (tested 7, 8).  sshd still works, but ps still shows 
the original arguments.
Comment 4 Mark Janssen 2003-01-09 22:03:00 AEDT
I'm using this patch for AIX 4.3.3 and it works perfectly.
I'm also using it on HPUX 10 and 11 (will try 11i soon) but I need to make
some modifications in config.h after running configure. (add a define for HAVE_SYS_PSTAT_H) and make sure HAVE_PSTAT is set in some way (my way is not really clean) otherwise support will still be disabled.
Comment 5 Damien Miller 2003-01-10 09:54:53 AEDT
I have committed this - it will switch on For Linux, AIX and HP/UX (If I got the
configure logic correct). 

Switching it on for other platforms is simply a matter of editing 
openbsd-compat/setproctitle.c and twiddling the #ifdef maze
Comment 6 Kevin Steves 2003-01-13 05:00:54 AEDT
how does one munge process string in solaris?

also, i think it would be better to set method per-platform
in configure.ac rather than growing the ifdef maze:

		AC_DEFINE(SPT_TYPE,PS_USE_CLOBBER_ARGV)
Comment 7 Damien Miller 2003-01-13 10:07:16 AEDT
The original source said to use argv clobbering for Solaris, but that didn't
seem to work (see  Comment #3) so I just disabled it.

I have moved all the platform selection to configure.ac - it is a better place
for it. If you don't define a SETPROCTITLE_STRATEGY (and optionally a
SETPROCTITLE_PS_PADDING), it will switch off setproctitle emulation.
Comment 8 Darren Tucker 2003-01-13 21:15:20 AEDT
Further info on Solaris: /usr/bin/ps apparently won't display the modified 
arguments while /usr/ucb/ps will.  I knew they were different but I didn't know 
about that particular difference.

I haven't been able to get it working on Solaris after adding "#define 
SETPROCTITLE_STRATEGY PS_USE_CLOBBER_ARGV" (it core dumps) but I suspect I'm 
doing something dumb.
Comment 9 Damien Miller 2003-01-13 22:00:21 AEDT
You might want to set SETPROCTITLE_PS_PADDING as well (see the linux section in
configure.ac). I suggest that you file a new bug for Solaris, so we can stop
flogging this one :)
Comment 10 Darren Tucker 2003-01-13 22:20:18 AEDT
I tried both ' ' and '\0' but didn't want to clutter this bug.  I'll file a new 
bug when I'm convinced I'm not doing something wrong (I've had *really* strange 
problems since upgrading to openssl-0.9.7 which I'm still trying to figure out).
Comment 11 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED