From: Michael Meffie Date: Fri, 8 Nov 2013 21:22:48 +0000 (-0500) Subject: tools: fix unpack in example sysvmq audit reader X-Git-Tag: upstream/1.8.0_pre1^2~624 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7ca2cce89ea525c73bc1571578c316016c6c4461;p=packages%2Fo%2Fopenafs.git tools: fix unpack in example sysvmq audit reader Fix the unpack in the example sysvmq audit reader script to correctly unpack the message type, which is an native long. From the msgrcv perl docoumentation: Note that when a message is received, the message type as a native long integer will be the first thing in VAR, followed by the actual message. This packing may be opened with "unpack("l! a*")". Change-Id: I5c5480c30d530b384d8057fb071b01e67f1b4ad2 Reviewed-on: http://gerrit.openafs.org/10445 Reviewed-by: D Brashear Tested-by: D Brashear --- diff --git a/src/tools/audit/readsysvmq b/src/tools/audit/readsysvmq index 100679982..c8e9880e6 100755 --- a/src/tools/audit/readsysvmq +++ b/src/tools/audit/readsysvmq @@ -77,7 +77,7 @@ my $msgsize = 2048; my ($msg, $msgtype, $msgtext); while (1) { if (msgrcv($mqid, $msg, $msgsize, 0, 0)) { - ($msgtype, $msgtext) = unpack("i! a*", $msg); + ($msgtype, $msgtext) = unpack("l! a*", $msg); print $msgtext, "\n"; } }