Bug 213369 - konsole does not register to utmp (again)
konsole does not register to utmp (again)
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: kdebase (Show other bugs)
6
All Linux
urgent Severity urgent
: ---
: ---
Assigned To: Ngo Than
: Regression
: 216562 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-01 01:28 EST by Ville Skyttä
Modified: 2007-11-30 17:11 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-02-14 12:33:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
KDE Software Compilation 140308 None None None Never

  None (edit)
Description Ville Skyttä 2006-11-01 01:28:41 EST
konsole fails to register users in utmp/wtmp again in FC6's original kde and the
3.5.5-0.2 update.  Bug 205767 seems indicate that libkdecore should maybe be
linked with libutempter.so.* but it is not:

$ rpm -q kdelibs
kdelibs-3.5.5-0.2.fc6.x86_64
$ rpm -qR kdelibs | grep utemp
$

Additionally, kdecore/kpty.cpp has some code which tries to execute
/usr/sbin/utempter which doesn't exist in libutempter, and libutempter's
/usr/libexec/utempter/utempter and the dir it is in have so restrictive
permissions that normal users won't be able to execute it anyway (I wonder if
that's on purpose?).
Comment 1 Rex Dieter 2006-12-06 10:44:49 EST
Sure enough, even though kdelibs includes
BuildRequires: libutempter-devel
and
%configure --with-utempter
and configure checks:
checking for addToUtmp in -lutempter... yes

It doesn't actually link against it.  

As Ville pointed out, the only reference to it anywhere in kdelibs is
kdecore/kpty.cpp, and that's only for directly using (the non-existent)
/usr/sbin/utempter
Comment 2 Adam Pribyl 2006-12-26 04:11:12 EST
FYI: xterm also does not update utmp when run as anybody else than root.
Comment 3 Ville Skyttä 2006-12-26 04:31:23 EST
Any ETA for a fix?  This is something that affects quite a few things.
Comment 4 Christopher Stone 2007-01-13 15:39:07 EST
*** Bug 216562 has been marked as a duplicate of this bug. ***
Comment 5 Dennis Gilmore 2007-01-13 15:41:14 EST
I am seeing this also.

Changing priority and status.  This should be considered a security issue. 
Comment 6 Lubomir Kundrak 2007-01-15 07:16:59 EST
(In reply to comment #5)
> I am seeing this also.
> 
> Changing priority and status.  This should be considered a security issue. 

Could you clarify why do you think this is a security issue?
Comment 7 Dennis Gilmore 2007-01-15 07:59:54 EST
It could give a sysadmin a false sense that no one is logged in and doing 
anything.  resulting in them not checking on what users are doing. If a system 
is configured to use gdm   kde sessions dont show up  at all  w  shows 0 
users. 
Comment 8 Lubomir Kundrak 2007-01-15 09:34:25 EST
(In reply to comment #7)
> It could give a sysadmin a false sense that no one is logged in and doing 
> anything.  resulting in them not checking on what users are doing. If a system 
> is configured to use gdm   kde sessions dont show up  at all  w  shows 0 
> users. 

utmp is _not_ a reliable source of imformation about what are people doing,
it is just informative, for users' convenence. There's no way to force user
to have an utmp entry. If he wants he can start a program, and log off
from terminal (emulator)?. If an operator wants to see what's going on, he
uses ps(8).

I am removing the Security keyword.
Comment 9 Rex Dieter 2007-01-15 11:45:22 EST
Re: comment #7, Dennis, (at least afaik) it is only shells started from konsole
that are missing from utmp.
Comment 10 Dennis Gilmore 2007-01-15 12:00:41 EST
Rex,  I did not test bt it was reported in #fedora-extras  that if you use gdm  
your whole session fails to register.  and if you do a w it will show  0 users
Comment 11 Christopher Stone 2007-01-15 12:02:57 EST
(In reply to comment #9)
> Re: comment #7, Dennis, (at least afaik) it is only shells started from konsole
> that are missing from utmp.

# w
 22:08:07 up 11 min,  0 users,  load average: 0.10, 0.24, 0.20
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT

You can get this result by using gdm and running w from within a konsole, so is
gdm broken also?  When I switched to kdm I see the login for kdm.

Has anyone tried using xdm and xterms?  I bet those dont work either.
Comment 12 Rex Dieter 2007-01-15 12:13:38 EST
RE: gdm
Hmm, offhand, sounds like a gdm buglet to me.  Regardless, that's a
another/separate (but related, of course) issue to *this* one.
Comment 13 Adam Pribyl 2007-01-19 15:45:32 EST
The external bug is reported against freebsd. It could be that its the same
thing however, just need to extend the platforms/OS.
Comment 14 Sammy 2007-01-26 11:30:43 EST
For whoever is in charge of this bug and Fedora CVS:

I have built all packages of KDE 3.5.6 for FC6+updates.

The utmp registration works fine without any patches for me.

When I add the patch you just checked into cvs Patch41, it
no longer works!

FYI
Comment 15 Ngo Than 2007-01-29 05:24:24 EST
Sammy, i assume you have changed libutempter. It cannot work if you are using 
libutempter-1.1.4-3.fc6. Could you please check where the utempter is installed
on your machine? Thanks
Comment 16 Sammy 2007-01-30 10:43:50 EST
Well, I am using:
=====================================
$ rpm -q -a | grep libutempter
libutempter-1.1.4-3.fc6
libutempter-devel-1.1.4-3.fc6
libutempter-devel-1.1.4-3.fc6
libutempter-1.1.4-3.fc6
======================================
The "w" command at this instant shows:
======================================
$ w
 09:28:29 up 20:03,  5 users,  load average: 4.66, 2.89, 1.33
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
umar     :0       -                08:32   ?xdm?   3:32   0.03s /bin/sh
/usr/bin/startkde
umar     pts/0    -                08:32   55:59   0.00s  0.25s kded --new-startup
umar     pts/1    -                08:33    0.00s  0.04s  0.00s w
umar     pts/2    -                09:19    6:48   1.31s  0.02s /bin/bash
umar     pts/3    -                09:22    5:42   0.13s  0.02s /bin/bash
==============================================
The spec files are essentially the same. I just added few patches from svn
commits that does not have anything to do with this. When I used the above
patch the "w" command produced nothing.
Comment 17 Sammy 2007-01-30 10:56:01 EST
I rechecked the final version of kpty.cpp file and it is the
unpatched one (all the lines deleted in that patch are there).
The last command is also showind all the sessions as login.

The config.log file sais:
=======================================
configure:41982: gcc -o conftest -DNDEBUG -O2  -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
-m64 -mtune=generic  -DQT_THREAD_SUPPORT  -D_REENTRANT  conftest.c -lutempter   >&5
configure:41988: $? = 0
configure:41992: test -z
                         || test ! -s conftest.err
configure:41995: $? = 0
configure:41998: test -s conftest
configure:42001: $? = 0
configure:42014: result: yes
===============================================================
ac_cv_lib_utempter_addToUtmp=yes
===============================================================
LIBUTEMPTER='-lutempter'
===============================================================
Comment 18 Sammy 2007-01-30 11:06:10 EST
My /usr/include/utempter.h file has:
====================================================================
/* New interface. */

extern int utempter_add_record (int master_fd, const char *hostname);
extern int utempter_remove_record (int master_fd);
extern int utempter_remove_added_record (void);
extern void utempter_set_helper (const char *pathname);

/* Old interface. */

extern void addToUtmp (const char *pty, const char *hostname, int master_fd);
extern void removeFromUtmp (void);
extern void removeLineFromUtmp (const char *pty, int master_fd);
======================================================================
Comment 19 Christopher Stone 2007-02-13 17:09:52 EST
xterm and kdm seem to be working now with the latest update today.  konsole
still not working.
Comment 20 Sammy 2007-02-13 18:16:08 EST
This bug is very puzzling to me. I build the rpm "without" the patch
and it worked for konsole. Today I rebuilt it and now it is not
working for konsole on i386 and working for kdm on x86_64. I will
check konsole at the office on x86_64 tomorrow. I have been noticing
this behavior though, it sometimes works and sometimes doesn't
(meaning from one build to another).
Comment 21 Sammy 2007-02-14 11:38:33 EST
OK. Some more info: I build FC6 kdelibs with the NEW utempter patch used
in rawhide. Now, the kdelibs is explicitly linked with libutempter. Also,
if you do ldd /usr/bin/konsole it shows link to libutempter. However,

1. For root logins everything is working correctly (including konsole).
2. For ordinary users only kdm is showing and no konsole.

FYI
Umar
Comment 22 Laurent Rineau 2007-02-14 11:52:06 EST
(In reply to comment #21)
> 1. For root logins everything is working correctly (including konsole).
> 2. For ordinary users only kdm is showing and no konsole.

What is your SELinux status? (Use "getenforce" to display the status of 
SELinux on you system.)
Comment 23 Sammy 2007-02-14 11:54:22 EST
$ getenforce
Disabled
Comment 24 Sammy 2007-02-14 12:00:05 EST
$ getenforce
Disabled
Comment 25 Sammy 2007-02-14 12:22:02 EST
More info. Startring xterms as a user registers with utmp correctly.
Both xterm and konsole are linked with libutempter. However, checking
permissions:

-rwxr-sr-x 1 root utempter 359136 Jan 18 08:52 /usr/bin/xterm
-rwxr-xr-x 1 root root 4352 Feb 14 08:37 /usr/bin/konsole

making konsole's group and mode same as xterm results in a working
konsole registration. Is this what it should be?
Comment 26 Ngo Than 2007-02-14 12:33:20 EST
Correct, the permission of konsole should be changed like xterm.
It's now fixed rawhide. I will build new kdebase inncluding this fix for FC6 soon.
Comment 27 Christopher Stone 2007-04-03 01:01:17 EDT
Just a friendly reminder that this appears to still need fixing in FC6.

Note You need to log in before you can comment on or make changes to this bug.