This bug appears when you run MC as a normal user (tested on app-misc/mc-4.6.0 and sys-libs/gpm-1.20.0-r5, but probably in earlier versions of gpm). You will get on stderr this message Failed info: [/var/tmp/portage/gpm-1.20.0-r5/work/gpm-1.20.0/src/liblow.c(446)]: Warning: closing connection and syslog contains Apr 13 13:24:50 oldium /usr/sbin/gpm[735]: info: [/var/tmp/portage/gpm-1.20. 0-r5/work/gpm-1.20.0/src/gpm.c(786)]: Apr 13 13:24:50 oldium /usr/sbin/gpm[735]: Connecting at fd 10 Apr 13 13:24:50 oldium /usr/sbin/gpm[735]: warning: [/var/tmp/portage/gpm-1.20. 0-r5/work/gpm-1.20.0/src/gpm.c(857)]: Apr 13 13:24:50 oldium /usr/sbin/gpm[735]: Failed gpm connect attempt by uid 1000 for vc /dev/vc/0 Problem is in /dev/vc/0, which is incorrectly recognized in liblow.c. I found a solution at http://archive.linuxfromscratch. org/mail-archives/lfs-support/2002/08/0482.html (corrects line 265 of liblow.c), but I think there is one more hidden bug (line 246 of liblow.c) - problem is with string allocation and working with strlen(). Here is my patch (one more line corrected compared to a patch at a www page above): --- liblow.c.old 2003-04-13 14:25:52.000000000 +0200 +++ liblow.c 2003-04-13 14:28:32.000000000 +0200 @@ -243,7 +243,7 @@ conn->vc=0; /* default handler */ if (flag > 0) { /* forced vc number */ conn->vc=flag; - if((tty = malloc(strlen(consolename)+Gpm_cnt_digits(flag))) != NULL) + if((tty = malloc(strlen(consolename)+Gpm_cnt_digits(flag)+1)) != NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); snprintf(tty,strlen(consolename)-1,"%s",consolename); sprintf(&tty[strlen(consolename)-1],"%i",flag); @@ -262,7 +262,7 @@ goto err; } - conn->vc=atoi(&tty[strlen(consolename)]); + conn->vc=atoi(&tty[strlen(consolename)-1]); } if (gpm_consolefd == -1)
this is a MUCH needed fix
I think on line 246 in liblow.c it is not needed to add 1 - if consolename contains one number (e.g. "/dev/vc/0") at the end of string.
Will there be version 1.20.1 of GPM? This problem is fixed there. This newest version is about 5 months old (ftp://arcana.linux.it/pub/gpm/) and I didn't find it in Gentoo.
I don't use gpm. The suggested upgrade to gpm-1.20.1 is stymied by local patches that no longer apply. Please give this to somebody more familiar with gpm & mc.
*** Bug 18030 has been marked as a duplicate of this bug. ***
ebuild for the new gpm is one it's way. I have it written just need to test and verify it works well since it's a moderate overhall of the whole ebuild. naz
Ebuild is commited and masked, please test :-) gpm-1.20.1.ebuild naz
The new gpm ebuild is in portage but is marked unstable, I will soon be marking it stable so we can dump so of these problems people are having.