Bug 132376

Summary: utmpx support missing in Solaris
Product: [Frameworks and Libraries] kdelibs Reporter: Torsten Kasch <tk>
Component: generalAssignee: Oswald Buddenhagen <ossi>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Solaris   
Latest Commit: Version Fixed In:
Attachments: kdelibs/kdecore/kpty.cpp

Description Torsten Kasch 2006-08-14 09:23:08 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Compiled From Sources
Compiler:          gcc version 4.1.1 
OS:                Solaris

Applications like "konsole" cannot create utmpx(4) entries on Solaris systems because kdelibs/kdecore/kpty.cpp seems to require the utempter which is usually not available on Solaris (maybe other SystemV based OSes as well?). This breaks for example Sun's mass storage device management scripts like utdiskadm(1M) (when called from konsole) which rely on logname(1).

Patch follows shortly.
Comment 1 Torsten Kasch 2006-08-14 09:27:18 UTC
Created attachment 17366 [details]
kdelibs/kdecore/kpty.cpp

Proposed patch to add utmpx support in libkdecore (KDE 3.5.x). This is
currently protected by #ifdef USE_SOLARIS but may be usable on other OSes
without utempter as well?
Comment 2 Martin von Gagern 2007-07-09 17:04:50 UTC
From pututxent(3C): "When called by a non-root user, pututxline() invokes a setuid() root program to verify and write the entry, since the utmpx database is normally writable only by root."

Looks like Solaris utmpx management had the functionality of utempter built in. Other OSes could be checked for similar descriptions to find out if the solution would apply there as well.

The presence of utmpx.h alone is not enough; on Linux that header and the used functions all exist as well, and still they will only work for users with direct write access to utmp. I know your patch doesn't really check for the header, just wanted to make this point clear.
Comment 3 Oswald Buddenhagen 2007-12-15 17:01:14 UTC
SVN commit 748812 by ossi:

try to write utmp even if neither utempter nor login() are found.
includes utmpx support.
BUG: 132376


 M  +15 -5     ConfigureChecks.cmake  
 M  +5 -0      config-pty.h.cmake  
 M  +89 -10    kpty/kpty.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=748812