Skip to content

Commit 6b9b74a

Browse files
committed
Try to solve Issue #390
See the issue for details. Shor story is that there is some kind of collision between the two generated flag_tabs.h file. No idea what's causing it, but the file being deleted was only for RHEL 4 so it is no longer needed. Deleting it should end the collision.
1 parent 2bdb1da commit 6b9b74a

4 files changed

Lines changed: 5 additions & 97 deletions

File tree

auparse/Makefile.am

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Makefile.am --
2-
# Copyright 2006-08,2011-18 Red Hat Inc.
2+
# Copyright 2006-08,2011-18,2024 Red Hat Inc.
33
# All Rights Reserved.
44
#
55
# This library is free software; you can redistribute it and/or
@@ -56,7 +56,7 @@ message.c:
5656

5757
BUILT_SOURCES = accesstabs.h captabs.h clocktabs.h clone-flagtabs.h \
5858
epoll_ctls.h famtabs.h fcntl-cmdtabs.h fsconfigs.h \
59-
flagtabs.h icmptypetabs.h ipctabs.h ipccmdtabs.h\
59+
icmptypetabs.h ipctabs.h ipccmdtabs.h\
6060
ioctlreqtabs.h ipoptnametabs.h ip6optnametabs.h \
6161
mmaptabs.h mounttabs.h nfprototabs.h open-flagtabs.h \
6262
persontabs.h prctl_opttabs.h pktoptnametabs.h \
@@ -72,7 +72,7 @@ BUILT_SOURCES = accesstabs.h captabs.h clocktabs.h clone-flagtabs.h \
7272
noinst_PROGRAMS = gen_accesstabs_h gen_captabs_h gen_clock_h \
7373
gen_clone-flagtabs_h \
7474
gen_epoll_ctls_h gen_famtabs_h gen_fcntl-cmdtabs_h \
75-
gen_flagtabs_h gen_fsconfigs_h gen_ioctlreqtabs_h \
75+
gen_fsconfigs_h gen_ioctlreqtabs_h \
7676
gen_icmptypetabs_h gen_ipctabs_h gen_ipccmdtabs_h\
7777
gen_ipoptnametabs_h gen_ip6optnametabs_h gen_nfprototabs_h \
7878
gen_mmaptabs_h gen_mounttabs_h \
@@ -167,20 +167,6 @@ gen_famtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD)
167167
famtabs.h: gen_famtabs_h Makefile
168168
./gen_famtabs_h --i2s fam > $@
169169

170-
gen_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h flagtab.h
171-
# ../auparse/ is used to avoid using ../lib/flagtab.h
172-
gen_flagtabs_h_CFLAGS = '-DTABLE_H="../auparse/flagtab.h"'
173-
$(gen_flagtabs_h_OBJECTS): CC=$(CC_FOR_BUILD)
174-
$(gen_flagtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD)
175-
$(gen_flagtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
176-
$(gen_flagtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD)
177-
gen_flagtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD)
178-
gen_flagtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD)
179-
gen_flagtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
180-
gen_flagtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD)
181-
flagtabs.h: gen_flagtabs_h Makefile
182-
./gen_flagtabs_h --i2s-transtab flag > $@
183-
184170
gen_fcntl_cmdtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \
185171
fcntl-cmdtab.h
186172
gen_fcntl_cmdtabs_h_CFLAGS = '-DTABLE_H="fcntl-cmdtab.h"'

auparse/flagtab.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

auparse/interpret.c

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@
9494
#include "epoll_ctls.h"
9595
#include "famtabs.h"
9696
#include "fcntl-cmdtabs.h"
97-
#include "flagtabs.h"
9897
#include "fsconfigs.h"
9998
#include "ipctabs.h"
10099
#include "ipccmdtabs.h"
@@ -1369,44 +1368,6 @@ static const char *print_sockaddr(const char *val)
13691368
return out;
13701369
}
13711370

1372-
/* This is only used in the RHEL4 kernel */
1373-
static const char *print_flags(const char *val)
1374-
{
1375-
int flags, cnt = 0;
1376-
size_t i;
1377-
char *out, buf[sizeof(flag_strings)+FLAG_NUM_ENTRIES+1];
1378-
1379-
errno = 0;
1380-
flags = strtoul(val, NULL, 16);
1381-
if (errno) {
1382-
if (asprintf(&out, "conversion error(%s)", val) < 0)
1383-
out = NULL;
1384-
return out;
1385-
}
1386-
if (flags == 0) {
1387-
if (asprintf(&out, "none") < 0)
1388-
out = NULL;
1389-
return out;
1390-
}
1391-
buf[0] = 0;
1392-
for (i=0; i<FLAG_NUM_ENTRIES; i++) {
1393-
if (flag_table[i].value & flags) {
1394-
if (!cnt) {
1395-
strcat(buf,
1396-
flag_strings + flag_table[i].offset);
1397-
cnt++;
1398-
} else {
1399-
strcat(buf, ",");
1400-
strcat(buf,
1401-
flag_strings + flag_table[i].offset);
1402-
}
1403-
}
1404-
}
1405-
if (buf[0] == 0)
1406-
snprintf(buf, sizeof(buf), "0x%s", val);
1407-
return strdup(buf);
1408-
}
1409-
14101371
static const char *print_promiscuous(const char *val)
14111372
{
14121373
int ival;
@@ -3228,10 +3189,7 @@ int auparse_interp_adjust_type(int rtype, const char *name, const char *val)
32283189
type = AUPARSE_TYPE_ESCAPED;
32293190
else
32303191
type = AUPARSE_TYPE_UNCLASSIFIED;
3231-
} else if (rtype == AUDIT_PATH && *name =='f' &&
3232-
strcmp(name, "flags") == 0)
3233-
type = AUPARSE_TYPE_FLAGS;
3234-
else if (rtype == AUDIT_MQ_OPEN && strcmp(name, "mode") == 0)
3192+
} else if (rtype == AUDIT_MQ_OPEN && strcmp(name, "mode") == 0)
32353193
type = AUPARSE_TYPE_MODE_SHORT;
32363194
else if (rtype == AUDIT_CRYPTO_KEY_USER && strcmp(name, "fp") == 0)
32373195
type = AUPARSE_TYPE_UNCLASSIFIED;
@@ -3330,9 +3288,6 @@ char *auparse_do_interpretation(int type, const idata *id,
33303288
case AUPARSE_TYPE_SOCKADDR:
33313289
out = print_sockaddr(id->val);
33323290
break;
3333-
case AUPARSE_TYPE_FLAGS:
3334-
out = print_flags(id->val);
3335-
break;
33363291
case AUPARSE_TYPE_PROMISC:
33373292
out = print_promiscuous(id->val);
33383293
break;

auparse/typetab.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ _S(AUPARSE_TYPE_PERM, "perm" )
7373
_S(AUPARSE_TYPE_PERM, "perm_mask" )
7474
_S(AUPARSE_TYPE_MODE, "mode" )
7575
_S(AUPARSE_TYPE_SOCKADDR, "saddr" )
76-
//_S(AUPARSE_TYPE_FLAGS, "flags" )
76+
//_S(AUPARSE_TYPE_FLAGS, "flags" ) deprecated - RHEL4
7777
_S(AUPARSE_TYPE_PROMISC, "prom" )
7878
_S(AUPARSE_TYPE_PROMISC, "old_prom" )
7979
_S(AUPARSE_TYPE_CAPABILITY, "capability" )

0 commit comments

Comments
 (0)