diff --git a/common/Make.rules b/common/Make.rules index 74c42cf8b..9108234d0 100644 --- a/common/Make.rules +++ b/common/Make.rules @@ -48,7 +48,7 @@ BUILDDIR=$(shell if [ -d "${TESTBUILDDIR}" ] ; then \ echo "/tmp/${NAME}" ; \ fi ;) endif -RPMHOSTVENDOR=$(shell rpm --eval "%{_host_vendor}") +RPMHOSTVENDOR=$(shell which rpm && rpm --eval "%{_host_vendor}") ifndef DISTRO DISTRO=$(shell if [ -f /etc/slackware-version ] ; then \ echo slackware ; \ @@ -92,30 +92,16 @@ endif ifndef SPECFILE SPECFILE = $(NAME).spec endif -RELEASE = $(shell rpm -q --specfile --define "_sourcedir ." ${RPMARG} --qf "%{RELEASE}" ${SPECFILE}) +RELEASE = $(shell lsb_release -is) $(shell lsb_release -rs) RELEASE_DIR = $(NAME)-$(VERSION) TARBALL = $(NAME)-$(VERSION)-${REPO_VERSION}.tar.gz -TAR = /bin/tar czvp -h --exclude .svn --exclude CVS --exclude .cvsignore --exclude ${TARBALL} --exclude ${RELEASE_DIR}/${RELEASE_DIR} $(shell test -f ${NAME}.exclude && echo "-X ${NAME}.exclude") +TAR = /bin/tar czvp -h --exclude .svn --exclude .bzr --exclude .bzrignore --exclude ${TARBALL} --exclude ${RELEASE_DIR}/${RELEASE_DIR} $(shell test -f ${NAME}.exclude && echo "-X ${NAME}.exclude") LDCONFIG = /sbin/ldconfig -CVSPKG_VERSION=$(shell rpm -q --specfile --define "_sourcedir ." ${RPMARG} ${SPECFILE} | head -1 | tr "." "_") - RPMSUBDIRS=SOURCES SPECS BUILD BUILDROOT SRPMS RPMS/i386 RPMS/i586 \ RPMS/i686 RPMS/athlon RPMS/noarch RPMS/x86_64 BUILDRPMSUBDIRS=$(foreach subdir, $(RPMSUBDIRS), $(BUILDDIR:/=)/$(subdir)) -.PHONY: cvs_tag -cvs_tag: - cvs tag IMMUNIX-${CVSPKG_VERSION} - -.PHONY: checkin -checkin: - if cvs -q up -d | grep -q "^\?" ; then echo "Hey! You have" \ - "files in the directory you have not added into cvs."; exit 1; \ - fi - cvs ci - make cvs_tag - ifdef EXTERNAL_PACKAGE .PHONY: rpm rpm: clean $(BUILDRPMSUBDIRS) diff --git a/libraries/libapparmor/src/scanner.l b/libraries/libapparmor/src/scanner.l index 2515b23e8..3657243e0 100644 --- a/libraries/libapparmor/src/scanner.l +++ b/libraries/libapparmor/src/scanner.l @@ -31,6 +31,8 @@ #include +#define YY_NO_INPUT + unsigned int string_buf_alloc = 0; unsigned int string_buf_len = 0; char *string_buf = NULL; diff --git a/parser/parser_interface.c b/parser/parser_interface.c index 7b801ddf5..3bef0b6fe 100644 --- a/parser/parser_interface.c +++ b/parser/parser_interface.c @@ -816,7 +816,7 @@ int sd_serialize_top_profile(sd_serialize *p, struct codomain *profile) int cache_fd = -1; int sd_serialize_codomain(int option, struct codomain *cod) { - int fd; + int fd = -1; int error = -ENOMEM, size, wsize; sd_serialize *work_area; char *filename = NULL; @@ -984,7 +984,7 @@ static char *next_profile_buffer(char *buffer, int size) int sd_load_buffer(int option, char *buffer, int size) { - int fd; + int fd = -1; int error = -ENOMEM, wsize, bsize; char *filename = NULL; char *b; diff --git a/parser/parser_lex.l b/parser/parser_lex.l index f1596b6d6..dfa10eebb 100644 --- a/parser/parser_lex.l +++ b/parser/parser_lex.l @@ -51,6 +51,8 @@ #define DUMP_PREPROCESS do { if (preprocess_only) ECHO; } while (0) +#define YY_NO_INPUT + int current_lineno = 1; char *current_filename = NULL; diff --git a/parser/parser_main.c b/parser/parser_main.c index 3b60fbe0f..dd61052c0 100644 --- a/parser/parser_main.c +++ b/parser/parser_main.c @@ -38,6 +38,8 @@ #include #include +#include +#include #include "parser.h" #include "parser_version.h" diff --git a/parser/parser_misc.c b/parser/parser_misc.c index e011c0a4e..3efbcd7bb 100644 --- a/parser/parser_misc.c +++ b/parser/parser_misc.c @@ -35,8 +35,10 @@ /* #define DEBUG */ #ifdef DEBUG +#undef PDEBUG #define PDEBUG(fmt, args...) printf("Lexer: " fmt, ## args) #else +#undef PDEBUG #define PDEBUG(fmt, args...) /* Do nothing */ #endif #define NPDEBUG(fmt, args...) /* Do nothing */ @@ -102,7 +104,7 @@ static struct keyword_table rlimit_table[] = { }; /* for alpha matches, check for keywords */ -static int get_table_token(const char *name, struct keyword_table *table, +static int get_table_token(const char *name __unused, struct keyword_table *table, const char *keyword) { int i; @@ -142,42 +144,6 @@ int get_rlimit(const char *name) return get_table_token("rlimit", rlimit_table, name); } -static struct keyword_table address_family[] = { -/* {"unix", AF_UNIX}, - {"local", AF_LOCAL}, */ - {"inet", AF_INET}, -/* {"ax25", AF_AX25}, - {"ipx", AF_IPX}, - {"appletalk", AF_APPLETALK}, - {"netrom", AF_NETROM}, - {"bridge", AF_BRIDGE}, - {"atmpvc", AF_ATMPVC}, - {"x25", AF_X25}, */ - {"inet6", AF_INET6}, -/* {"rose", AF_ROSE}, - {"decnet", AF_DECnet}, - {"netbeui", AF_NETBEUI}, - {"security", AF_SECURITY}, - {"key", AF_KEY}, - {"netlink", AF_NETLINK}, - {"route", AF_ROUTE}, - {"packet", AF_PACKET}, - {"ash", AF_ASH}, - {"econet", AF_ECONET}, - {"atmsvc", AF_ATMSVC}, - {"sna", AF_SNA}, - {"irda", AF_IRDA}, - {"pppox", AF_PPPOX}, - {"wanpipe", AF_WANPIPE}, - {"llc", AF_LLC}, - {"tipc", AF_TIPC}, - {"bluetooth", AF_BLUETOOTH}, - {"iucv", AF_IUCV}, - {"rxrpc", AF_RXRPC}, */ - /* terminate */ - {NULL, 0} -}; - struct network_tuple { char *family_name; unsigned int family; @@ -462,7 +428,7 @@ static void warn_uppercase(void) } } -static int parse_sub_mode(const char *str_mode, const char *mode_desc) +static int parse_sub_mode(const char *str_mode, const char *mode_desc __unused) { #define IS_DIFF_QUAL(mode, q) (((mode) & AA_MAY_EXEC) && (((mode) & AA_EXEC_TYPE) != ((q) & AA_EXEC_TYPE))) diff --git a/parser/parser_symtab.c b/parser/parser_symtab.c index eb182d0ef..d483b97a8 100644 --- a/parser/parser_symtab.c +++ b/parser/parser_symtab.c @@ -425,10 +425,13 @@ static int __expand_variable(struct symtab *symbol) for (ref_item = ref->expanded; ref_item; ref_item = ref_item->next) { char *expanded_string; - asprintf(&expanded_string, "%s%s%s", + if (!asprintf(&expanded_string, "%s%s%s", split->prefix ? split->prefix : "", ref_item->val, - split->suffix ? split->suffix : ""); + split->suffix ? split->suffix : "")) { + PERROR("Out of memory\n"); + exit(1); + } add_to_set(&work_list, expanded_string); free(expanded_string); } diff --git a/parser/parser_yacc.y b/parser/parser_yacc.y index 083685a02..bf9bf089a 100644 --- a/parser/parser_yacc.y +++ b/parser/parser_yacc.y @@ -412,7 +412,7 @@ flagvals: flagval flagval: TOK_FLAG_ID { - struct flagval fv = {0, 0, 0}; + struct flagval fv = { 0, 0, 0, 0 }; if (strcmp($1, "debug") == 0) { yyerror(_("Profile flag 'debug' is no longer valid.")); } else if (strcmp($1, "complain") == 0) {