[Pkg-acpi-devel] Bug#560804: Bug#560804: Implementation of getXuser is wrong so that logged in user is not detected

Klaus Ethgen Klaus at Ethgen.de
Sun Dec 13 13:49:24 UTC 2009


-----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/2    00: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 Ethgen                            http://www.ethgen.de/
pub  2048R/D1A4EDE5 2000-02-26 Klaus Ethgen <Klaus at 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-----





More information about the Pkg-acpi-devel mailing list