x11-terms/mrxvt-0.3.5 utemp-lib support request maybe w/ a flag <snip> From 0.3.5, mrxvt supports utempter library, which means if you have installed the utempter library, you can remove the setuid root permission from mrxvt binary without losing the logging feature. But doing so may cause trouble to chown the tty on some systems. </snip>
Yes, I was about to add utempter USE flag (If you open mrxvt-0.3.5.ebuild you will see what I was doing), but mrxvt doesn't seem to link utempter. Also, ppc-macos doesn't support utempter (it's dependencies need to be marked at least ~ppc-macos, but several deps are broken at the moment), so I left it so. If you are interested in testing, try EXTRA_ECONF="--enable-utempter" emerge mrxvt and see what `ldd /usr/bin/mrxvt` says. We need to turn off --disable-utmp and --disable-wtmp? (haven't tried yet) If you succeed to enable utempter on x86, i'm pleased to add utempter support for mrxvt. (i'll mask utempter for ppc-macos then)
mrxvt configure script will try to link utempter library if --enable-everything or --enable-utempter is specified. but if it fails to link utempter library, it will fall back to its own utmp/wtmp implementations. I do not know why mrxvt cannot link utempter on gentoo. maybe someone can check the config.log, see what's the error message?
configure:5839: checking for utempter_add_record in -lutempter configure:5869: gcc -o conftest -O2 -Wall -fPIC -I/usr/X11R6/include -lSM -lICE conftest.c -lutempter -lX11 -L/usr/X11R6/lib >&5 /tmp/ccYrdpPc.o(.text+0x18): In function `main': : undefined reference to `utempter_add_record' collect2: ld returned 1 exit status utempter version is 0.5.5.5.
I see. I use utempter 1.1.1 on my slackware -current. The utempter API has been changed from 0.5.x to 1.x. Mrxvt chooses to use the new API. Probably it is time to upgrade utempter library? ;-)
From 0.3.10, mrxvt binary will be installed without setuid root due to security concerns. Thus, if mrxvt is not compiled with utempter library support, you will lose the logging features.
Grr, utempter... Still it is nice to have utmp writing, and the ebuild is enabling support for it already. Personally I'm willing to take the setgid risk, and it appears at least x11-terms/aterm is willing too. The attached patch changes the behaviour to match x11-terms/aterm, so logging works. Notice setgid utmp, not setuid root.
Created attachment 56408 [details, diff] mrxvt-utmp_write.patch Obviously this is against 0.4.0, but the same applies to the older versions.
Sorry for the delay. We finally got libutempter in Portage tree, so I added utempter local USE flag to enable/disable utempter. Thanks for the patch and comments.