Your message dated Sun, 16 Nov 2014 18:18:41 +0000
with message-id <[email protected]>
and subject line Bug#762910: fixed in acpitool 0.5.1-4
has caused the Debian Bug report #762910,
regarding lines longer than 39 characters are mishandled in /proc/acpi/wakeup
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
762910: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762910
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: acpitool
Version: 0.5.1-3
Tags: patch

While parsing /proc/acpi/wakeup, src/acpitool.cpp assumes that lines are
maximum 39 char long (40 including the terminating NUL character at the
end of C strings).

Since I have a line in /proc/acpi/wakeup that is exactly 40 char long,
the tool doesn't work (it hangs up when it hits that line, consuming
100% CPU forever).

The attached patch changes this behavior to assume maximum 79 char long
lines by increasing the buffer size to 80.

diff -ur acpitool-0.5.1/debian/patches/wakeup.patch acpitool-0.5.1.patched/debian/patches/wakeup.patch
--- acpitool-0.5.1/debian/patches/wakeup.patch	2014-09-26 10:20:52.000000000 +0200
+++ acpitool-0.5.1.patched/debian/patches/wakeup.patch	2014-09-26 10:16:07.163701983 +0200
@@ -13,15 +13,44 @@
    have a device called "LID" which is 3 characters long.
    Instead of using a fixed size for the device we split the line
    on the first tab (\t) and use the first part.
+
+ * The length of lines in /proc/acpi/wakeup can have more than 39
+   characters, I have one with exactly 40.  So let's increase the
+   reading buffer to 80 characters.
 ---
  src/acpitool.cpp |   23 +++++++++++------------
  1 files changed, 11 insertions(+), 12 deletions(-)
 
-diff --git a/src/acpitool.cpp b/src/acpitool.cpp
-index 2a610a5..71e01d7 100644
---- a/src/acpitool.cpp
-+++ b/src/acpitool.cpp
-@@ -460,16 +460,14 @@ int Show_WakeUp_Devices(int verbose)
+Index: acpitool-0.5.1/src/acpitool.cpp
+===================================================================
+--- acpitool-0.5.1.orig/src/acpitool.cpp
++++ acpitool-0.5.1/src/acpitool.cpp
+@@ -416,7 +416,7 @@ int Do_Fan_Info(int verbose)
+ int Show_WakeUp_Devices(int verbose)
+ {
+     ifstream file_in;
+-    char *filename, str[40];
++    char *filename, str[80];
+     
+     filename = "/proc/acpi/wakeup";
+     
+@@ -437,13 +437,13 @@ int Show_WakeUp_Devices(int verbose)
+     }
+     else
+     {
+-	file_in.getline(str, 40);           // first line are just headers //
++	file_in.getline(str, 80);           // first line are just headers //
+ 	cout<<"   "<<str<<endl;
+ 	cout<<"  ---------------------------------------"<<endl;
+         int t = 1;
+ 	while(!file_in.eof())
+ 	{
+-	    file_in.getline(str, 40);
++	    file_in.getline(str, 80);
+ 	    if (strlen(str)!=0)                     // avoid printing last empty line //
+ 	    {
+ 		cout<<"  "<<t<<". "<<str<<endl;
+@@ -459,16 +459,14 @@ int Show_WakeUp_Devices(int verbose)
  
  int Toggle_WakeUp_Device(const int Device, int verbose)
  {
@@ -43,7 +72,7 @@
      {
      	if(!verbose)        
      	{
-@@ -484,14 +482,15 @@ int Toggle_WakeUp_Device(const int Device, int verbose)
+@@ -483,14 +481,15 @@ int Toggle_WakeUp_Device(const int Devic
      	}	
      }
      
@@ -64,7 +93,3 @@
  	    index++;
  	}
      }	
--- 
-1.7.5.4
-
-

--- End Message ---
--- Begin Message ---
Source: acpitool
Source-Version: 0.5.1-4

We believe that the bug you reported is fixed in the latest version of
acpitool, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Meskes <[email protected]> (supplier of updated acpitool package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 16 Nov 2014 15:46:27 +0100
Source: acpitool
Binary: acpitool acpitool-dbg
Architecture: source amd64
Version: 0.5.1-4
Distribution: unstable
Urgency: medium
Maintainer: Debian Acpi Team <[email protected]>
Changed-By: Michael Meskes <[email protected]>
Description:
 acpitool   - command line ACPI client
 acpitool-dbg - command line ACPI client (debug)
Closes: 684447 738755 762910
Changes:
 acpitool (0.5.1-4) unstable; urgency=medium
 .
   * Handle lines in /proc/acpi/wakeup that are longer than 39 characters.
     Thanks to Guillem Jover <[email protected]> (Closes: #762910)
   * Fixed a couple typos in manpage.
     Thanks to A. Costa <[email protected]> (Closes: #684447)
   * Updated homepage field in control file. (Closes: #738755)
   * Bumped Standards-Version to 3.9.6, no changes needed.
Checksums-Sha1:
 bcf57dd01cc6434cb415892afc7089cdaf8a0b87 1833 acpitool_0.5.1-4.dsc
 6810dfaecd8e588fbd12ffed8732aba1b8d9e54b 10657 acpitool_0.5.1-4.diff.gz
 5e3e567d5c1fe3be5e600e4b9fa040526a76277d 45406 acpitool_0.5.1-4_amd64.deb
 bbeaa0284ea854e053a46b7e024058b9d9ec93e6 157246 acpitool-dbg_0.5.1-4_amd64.deb
Checksums-Sha256:
 031c99bd34b1d35181a41ec1c5e36e062b8a5fae06ab23fb7bd962f0b5b988da 1833 
acpitool_0.5.1-4.dsc
 f707ae18f0b131edfebe029b2b62d67a97ae4aa3f82988077fc9133b29200f10 10657 
acpitool_0.5.1-4.diff.gz
 28e5b281b0fd0ca99205fded69e97d985b87d6ad277e427c9bb514a70fd24a91 45406 
acpitool_0.5.1-4_amd64.deb
 071b7cfc7a155997dd3c948ac8a24c909b29d441bb2593e7098007b8da7c9433 157246 
acpitool-dbg_0.5.1-4_amd64.deb
Files:
 8a6ed7aa4e266662e1f12fc279286065 1833 utils optional acpitool_0.5.1-4.dsc
 6509af0e98c9cfe5fa73b6a959f9165a 10657 utils optional acpitool_0.5.1-4.diff.gz
 d5d68bc4a298ab9dbbb33ffee8ffe370 45406 utils optional 
acpitool_0.5.1-4_amd64.deb
 ef44bb74c51d9f5f57bd8c4db0c56841 157246 debug extra 
acpitool-dbg_0.5.1-4_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIVAwUBVGjnvt8j2jOWl46zAQifKhAAgBftiyNsb3EZx4e42yoTYDJZtEPRw5cx
MFWleVW16Vxx/JS5EFYmaHLSP8wnV2a5XOkdRbn6eOUwmO3pUofyd1mnvx4uUtXZ
RSwuAsJYUr2ntqlFpY04NfwrL4EprN9x/Mo7tyOaqFQVE8T16utjC+Tgl0oyPv1J
12tJFYbtb2Wt8IL86Wt3d4YWL69egRWmh0Mr/QV5yvB72NTP9R5spMX7RflPXixa
wlwdG31+9VoIZdp4/0XnlsoFs7HWJO8vcs243DomG9cIe1G7AY+TNQ+w2U2koPtu
paPSIAE4wkIaS9/qMakgCoS31gGLhn/lgrQRRG9FJe/ki6LyxKP1MvZHN/RSxYYc
ByEHS1YTwvciwpRp0lD0NVw2tN9YtoYKd4YKwHVqVbCGeQJrcyLDtzrqV5GgNsVZ
PfzWOTtMXO2+FEcemm7P1QJ8PkxeDf1oAOtqDY9H8AzAA17H/Rbah9h1S9VQiKBH
B0LXS8w/RyzN6TyxG5ieyPxYJz5Bn+rD/QZHRgQea15TioisYwPtq3Jw3DSGYZWr
9uwJIRkPEq1E9dfbsnbrptIcLn6YdQMPNltbDM5bhOMKQIQq0NRGpX5q3qXsxsU/
NdLvsf5/y5BkafFQ1oIy8BTDQCD5xtlyWdzXoRtT6QvLKjidNCQgih11P+EUYyOF
3f6r3Pd9C7w=
=gvvw
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to