Project

General

Profile

Bug #5516

perl problems in libbsm/auditxml

Added by Richard PALO almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-01-09
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Noticed a wad of perl warnings in nightly.log concerning lib/libbsm/auditxml:

/usr/bin/perl auditxml -o common common/adt.xml
Use of uninitialized value $opt_i in lc at auditxml line 60.
Use of uninitialized value $opt_e in uc at auditxml line 62.
Use of uninitialized value $omitEntry in uc at auditxml line 863.
Use of uninitialized value $omitEntry in uc at auditxml line 863.
...

the following seems to clear it up, but am wondering if the last bit
which concerns a missing parameter, is actually correct.

diff --git a/usr/src/lib/libbsm/auditxml b/usr/src/lib/libbsm/auditxml
index 42fbf8b..1c361bc 100644
--- a/usr/src/lib/libbsm/auditxml
+++ b/usr/src/lib/libbsm/auditxml
@@ -53,6 +53,9 @@ my $appDebug = 0; # used after return from "new auditxml";

 # Process command-line options
 our ($opt_d, $opt_e, $opt_i, $opt_o);
+$opt_e = "";
+$opt_i = "";
+$opt_o = "";
 if (!getopts('de:i:o:') || $#ARGV != 0) {
     die $usage;
 }
@@ -706,7 +709,7 @@ sub generateTableC {
          $tokenId = 'error';
        }
        my ($xlate, $jni) =
-         formatTableEntry ('', $tokenId, $eventId, '', 0, 0,
+         formatTableEntry ('', $tokenId, $eventId, '', 0, 0, 0,
                            $tokenOrder[$sequence], 'NULL', $omit);
        push (@xlateEntryList, $xlate);
       }

History

#1

Updated by Richard PALO almost 5 years ago

No, adt_xlate.c wasn't generated correctly, this seems better:

diff --git a/usr/src/lib/libbsm/auditxml b/usr/src/lib/libbsm/auditxml
index 42fbf8b..2738de9 100644
--- a/usr/src/lib/libbsm/auditxml
+++ b/usr/src/lib/libbsm/auditxml
@@ -53,6 +53,9 @@ my $appDebug = 0; # used after return from "new auditxml";

 # Process command-line options
 our ($opt_d, $opt_e, $opt_i, $opt_o);
+$opt_e = "";
+$opt_i = "";
+$opt_o = "";
 if (!getopts('de:i:o:') || $#ARGV != 0) {
     die $usage;
 }
@@ -707,7 +710,7 @@ sub generateTableC {
        }
        my ($xlate, $jni) =
          formatTableEntry ('', $tokenId, $eventId, '', 0, 0,
-                           $tokenOrder[$sequence], 'NULL', $omit);
+                           $tokenOrder[$sequence], 'NULL', '', $omit);
        push (@xlateEntryList, $xlate);
       }
       else {

FWIW, I compared with lines 754-756 which invokes as follows:

    my ($xlate, $jni) =
      formatTableEntry($entryId, $tokenName, $eventId, $dataType, $required,
               $tsol, $tokenOrder[$sequence], $tokenFormat,
               $enumGroup, $omit);

it appears that a null $enumGroup was omitted.

#2

Updated by Electric Monk almost 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 81d662ee1fa70e2f91e1d6fa52d3621146c10d61

commit  81d662ee1fa70e2f91e1d6fa52d3621146c10d61
Author: Richard PALO <richard@netbsd.org>
Date:   2015-01-11T22:40:51.000Z

    5516 perl problems in libbsm/auditxml
    Reviewed by: Richard Lowe <richlowe@richlowe.net>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF