Bug 70794 - HAVE_UTEMPTER never defined in kdelibs
Summary: HAVE_UTEMPTER never defined in kdelibs
Status: RESOLVED WORKSFORME
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-19 02:37 UTC by Gregorio Guidi
Modified: 2004-01-26 17:09 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gregorio Guidi 2003-12-19 02:37:13 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:          Linux

utempter is the helper application that gets called to write utmp entries when kwrited or konsole access pseudo terminals.

the code that calls /usr/sbin/utempter is in kdelibs/kdecore/kpty.cpp, and is protected by
#ifdef HAVE_UTEMPTER

But HAVE_UTEMPTER is never defined by kdelibs configure script, instead the check for utempter happens in kdebase, namely is done by these lines in kdebase/configure.in.in:

kde_have_utempter=yes
AC_CHECK_LIB(utempter, addToUtmp, [LIBUTEMPTER=-lutempter], kde_have_utempter=no)
AC_SUBST(LIBUTEMPTER)
if test "$kde_have_utempter" = "yes"; then
  AC_DEFINE_UNQUOTED(HAVE_UTEMPTER, 1, [Define if you have the utempter helper for utmp managment])
fi

The result is that the code in kdelibs is never picked up. An evidence of this fact is that there's also a little error, corrected by this simple patch:

RCS file: /home/kde/kdelibs/kdecore/kpty.cpp,v
retrieving revision 1.14
diff -u -3 -b -r1.14 kpty.cpp
--- kdecore/kpty.cpp    16 Nov 2003 22:22:06 -0000      1.14
+++ kdecore/kpty.cpp    19 Dec 2003 00:27:08 -0000
@@ -433,7 +433,7 @@
     KProcess_Utmp utmp;
     utmp.cmdFd = d->masterFd;
     utmp << "/usr/sbin/utempter" << "-d" << d->ttyName;
-    utmp.start(KPty::Block);
+    utmp.start(KProcess::Block);
 #elif defined(USE_LOGIN)
     const char *str_ptr = d->ttyName.data();
     if (!memcmp(str_ptr, "/dev/", 5))

I think the check for utempter should be moved to kdelibs/configure.in.in or kdelibs/kdecore/configure.in.in

However, even with this fix, I have troubles running an utempter-aware konsole: during the execution of /usr/sbin/utempter konsole freezes on "read" on line 414 of kdelibs/kdecore/kprocess.cpp. And bypassing that line, konsole freezes again waiting for utempter to exit (it appears as a defunct process in ps). This goes beyond my capabilities.
Can anyone tell me if it is possible to run the code between the HAVE_UTEMPTER?

btw: the configure script check if programs can link to the utempter libraries, but no kde app links to the libs, they just call directly "/usr/sbin/utempter", I think.
Comment 1 Stephan Kulow 2004-01-19 11:38:41 UTC
the code is mainly from/for konsole
Comment 2 Gregorio Guidi 2004-01-26 17:09:40 UTC
The fixes that went in a few days ago were successful. Closing.