Bug#560804: [Pkg-acpi-devel] Bug#560804: Implementation of getXuser is wrong so that logged in user is not detected
On Sun, Dec 13, 2009 at 02:49:24PM +0100, Klaus Ethgen wrote: Oh, sorry, to not mention it clear enough. The three lines with pts/* are from open shells. If there is no open shell only the first line will be printed. and with the first line the user is not recognized as the test do not know about the format with a char in front of the :0. Oops, sorry for not reading your email completely. w is not an option as it truncates usernames. Ok. But only for very long user names which should be a very rare case; much more rare than a X session without open shells. Well it happens sufficiently often to have this problem reported as a bug twice so far. :-) I guess the best way is to fix the awk statement. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org ICQ: 179140304, AIM/Yahoo/Skype: michaelmeskes, Jabber: mes...@jabber.org VfL Borussia! Forca Barca! Go SF 49ers! Use: Debian GNU/Linux, PostgreSQL -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#560804: [Pkg-acpi-devel] Bug#560804: Implementation of getXuser is wrong so that logged in user is not detected
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi, Am Sa den 12. Dez 2009 um 18:33 schrieb Michael Meskes: The reason is that pinky -fw returns something like: klaus?:0 ? Dec 11 16:57 klaus*pts/0 Dec 11 17:15 :0.0 klaus pts/1 Dec 11 17:16 :0.0 klaus*pts/200:04 Dec 11 17:21 :0.0 This means that $(NF) in that awk statement is :0.0 for the last three lines, so it should print klaus once and then exit. Oh, sorry, to not mention it clear enough. The three lines with pts/* are from open shells. If there is no open shell only the first line will be printed. and with the first line the user is not recognized as the test do not know about the format with a char in front of the :0. The only way I see to not get the user here is if displaynum is not correctly set. Could you please check that getXconsole correctly determines the display. Thats not the problem. _With_ a open shell the display would be finded. - - user=`pinky -fw | awk '{ if ($2 == :'$displaynum' || $(NF) == :'$displaynum' || $2 == :'$displaynum'.0 || $(NF) == :'$displaynum'.0 ) { print $1; exit; } }'` + user=`w -h | awk '{ if ($2 == :'$displaynum' || $3 == :'$displaynum' || $2 == :'$displaynum'.0 || $3 == :'$displaynum'.0 ) { print $1; exit; } }'` w is not an option as it truncates usernames. Ok. But only for very long user names which should be a very rare case; much more rare than a X session without open shells. Regards Klaus - -- Klaus Ethgenhttp://www.ethgen.de/ pub 2048R/D1A4EDE5 2000-02-26 Klaus Ethgen kl...@ethgen.de Fingerprint: D7 67 71 C4 99 A6 D4 FE EA 40 30 57 3C 88 26 2B -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iQEVAwUBSyTw5J+OKpjRpO3lAQo7Cgf9GUimO15uLfnGo34LRQH1ZWuw5sZp+zRA TjH7shViDQwfbPjVU6jji924TlUzEzv3fKPWauN+3dcI6vTnlKHdIOsoCOsh4s1F FwlpINonY29d1VJPKmFPcxDHiCxbyoO/PXiREj2B2wnMFSHi+Nn0TavjUjwySNDd JWvC0AMdxfljmYvii+2eGkQ1RP4fzxFqigfOfhdonLT2m8SzegN76YQIOKIrWcPR udIDn6QE+V6uP4u1Odc/otOuU7Ma7ZzgT7IgiphS/MPsISMTEGB5eYkrFcT6u74q 6b3nF7dOD/N2IRi23MoTY3KoVu+gFi/KHC1xOq1YctWjoJ/qG7c2tQ== =pC1h -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#560804: [Pkg-acpi-devel] Bug#560804: Implementation of getXuser is wrong so that logged in user is not detected
On Sat, Dec 12, 2009 at 01:02:08PM +0100, Klaus Ethgen wrote: When the user is logged in under X and has no open shell the getXuser function will not see him and so the screen is not locked. ... Something's wrong here. The reason is that pinky -fw returns something like: klaus?:0 ? Dec 11 16:57 klaus*pts/0 Dec 11 17:15 :0.0 klaus pts/1 Dec 11 17:16 :0.0 klaus*pts/200:04 Dec 11 17:21 :0.0 This means that $(NF) in that awk statement is :0.0 for the last three lines, so it should print klaus once and then exit. The only way I see to not get the user here is if displaynum is not correctly set. Could you please check that getXconsole correctly determines the display. - - user=`pinky -fw | awk '{ if ($2 == :'$displaynum' || $(NF) == :'$displaynum' || $2 == :'$displaynum'.0 || $(NF) == :'$displaynum'.0 ) { print $1; exit; } }'` + user=`w -h | awk '{ if ($2 == :'$displaynum' || $3 == :'$displaynum' || $2 == :'$displaynum'.0 || $3 == :'$displaynum'.0 ) { print $1; exit; } }'` w is not an option as it truncates usernames. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org ICQ: 179140304, AIM/Yahoo/Skype: michaelmeskes, Jabber: mes...@jabber.org VfL Borussia! Forca Barca! Go SF 49ers! Use: Debian GNU/Linux, PostgreSQL -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org