Created
December 3, 2013 10:16
-
-
Save kaworu/7766978 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/add.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_flags on line 73 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 176, nb passed = 0 =========> 0.000000% passed | |
| nb good = 176, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/annotate.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 46 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 332, nb passed = 0 =========> 0.000000% passed | |
| nb good = 332, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/audit.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 136 | |
| ERROR-RECOV: found sync '}' at line 219 | |
| parsing pass2: try again | |
| (ONCE) CPP-IFDEF: or related inside function. I treat it as comment | |
| (ONCE) CPP-TYPEDEF: promoting:(2) XML_Parser on line 540 | |
| (ONCE) CPP-MACRO: found foreach: LL_FOREACH | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 692 | |
| (ONCE) CPP-MACRO: found foreach: LL_FOREACH_SAFE | |
| passed:#if ARCHIVE_VERSION_NUMBER < 3000002 | |
| passed:#else | |
| passed:#endif | |
| passed:#if ARCHIVE_VERSION_NUMBER < 3000002 | |
| passed:#else | |
| passed:#endif | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 984, nb passed = 6 =========> 0.609756% passed | |
| nb good = 984, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/autoremove.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 52 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_flags on line 55 | |
| passed:__unused __unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 144, nb passed = 1 =========> 0.694444% passed | |
| nb good = 144, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/backup.c | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 81, nb passed = 0 =========> 0.000000% passed | |
| nb good = 81, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/check.c | |
| ERROR-RECOV: found sync '}' at line 48 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 48 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parse error | |
| = File "pkg/check.c", line 47, column 26, charpos = 1778 | |
| around = 'next', whole content = STAILQ_ENTRY(deps_entry) next; | |
| badcount: 7 | |
| bad: #include "pkgcli.h" | |
| bad: | |
| bad: struct deps_entry { | |
| bad: char *name; | |
| bad: char *version; | |
| bad: char *origin; | |
| BAD:!!!!! STAILQ_ENTRY(deps_entry) next; | |
| bad: }; | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 52 | |
| (ONCE) CPP-MACRO: found foreach: STAILQ_FOREACH | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_flags on line 135 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| STAILQ_ENTRY: present in 1 parsing errors | |
| example: | |
| char *version; | |
| char *origin; | |
| STAILQ_ENTRY(deps_entry) next; | |
| }; | |
| deps_entry: present in 1 parsing errors | |
| example: | |
| char *version; | |
| char *origin; | |
| STAILQ_ENTRY(deps_entry) next; | |
| }; | |
| next: present in 1 parsing errors | |
| example: | |
| char *version; | |
| char *origin; | |
| STAILQ_ENTRY(deps_entry) next; | |
| }; | |
| origin: present in 1 parsing errors | |
| example: | |
| char *version; | |
| char *origin; | |
| STAILQ_ENTRY(deps_entry) next; | |
| }; | |
| version: present in 1 parsing errors | |
| example: | |
| char *version; | |
| char *origin; | |
| STAILQ_ENTRY(deps_entry) next; | |
| }; | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0% | |
| nb good = 396, nb passed = 0 =========> 0.000000% passed | |
| nb good = 396, nb bad = 7 =========> 98.263027% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/clean.c | |
| ERROR-RECOV: found sync '}' at line 50 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 50 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parse error | |
| = File "pkg/clean.c", line 43, column 29, charpos = 1724 | |
| around = 'next', whole content = STAILQ_ENTRY(deletion_list) next; | |
| badcount: 10 | |
| bad: #include "pkgcli.h" | |
| bad: | |
| bad: struct deletion_list { | |
| BAD:!!!!! STAILQ_ENTRY(deletion_list) next; | |
| bad: unsigned reason; | |
| bad: const char *path; | |
| bad: const char *origin; | |
| bad: const char *newname; | |
| bad: const char *newversion; | |
| bad: char data[0]; | |
| bad: }; | |
| (ONCE) CPP-MACRO: found foreach: STAILQ_FOREACH | |
| (ONCE) CPP-TYPEDEF: promoting:(21) FTS on line 222 | |
| (ONCE) CPP-TYPEDEF: promoting:(21) FTSENT on line 223 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 228 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| deletion_list: present in 2 parsing errors | |
| example: | |
| struct deletion_list { | |
| STAILQ_ENTRY(deletion_list) next; | |
| unsigned reason; | |
| STAILQ_ENTRY: present in 1 parsing errors | |
| example: | |
| struct deletion_list { | |
| STAILQ_ENTRY(deletion_list) next; | |
| unsigned reason; | |
| next: present in 1 parsing errors | |
| example: | |
| struct deletion_list { | |
| STAILQ_ENTRY(deletion_list) next; | |
| unsigned reason; | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0% | |
| nb good = 412, nb passed = 0 =========> 0.000000% passed | |
| nb good = 412, nb bad = 10 =========> 97.630332% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/config.c | |
| (ONCE) CPP-MACRO: found string-macro PRId64 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 55 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 100, nb passed = 0 =========> 0.000000% passed | |
| nb good = 100, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/convert.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 51 | |
| passed:__unused __unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 305, nb passed = 1 =========> 0.327869% passed | |
| nb good = 305, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/create.c | |
| ERROR-RECOV: found sync '}' at line 50 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 50 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parse error | |
| = File "pkg/create.c", line 49, column 25, charpos = 1847 | |
| around = 'next', whole content = STAILQ_ENTRY(pkg_entry) next; | |
| badcount: 5 | |
| bad: #include "pkgcli.h" | |
| bad: | |
| bad: struct pkg_entry { | |
| bad: struct pkg *pkg; | |
| BAD:!!!!! STAILQ_ENTRY(pkg_entry) next; | |
| bad: }; | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_formats on line 67 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 68 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| pkg: present in 2 parsing errors | |
| example: | |
| struct pkg_entry { | |
| struct pkg *pkg; | |
| STAILQ_ENTRY(pkg_entry) next; | |
| }; | |
| pkg_entry: present in 2 parsing errors | |
| example: | |
| struct pkg_entry { | |
| struct pkg *pkg; | |
| STAILQ_ENTRY(pkg_entry) next; | |
| }; | |
| STAILQ_ENTRY: present in 1 parsing errors | |
| example: | |
| struct pkg_entry { | |
| struct pkg *pkg; | |
| STAILQ_ENTRY(pkg_entry) next; | |
| }; | |
| next: present in 1 parsing errors | |
| example: | |
| struct pkg_entry { | |
| struct pkg *pkg; | |
| STAILQ_ENTRY(pkg_entry) next; | |
| }; | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0% | |
| nb good = 260, nb passed = 0 =========> 0.000000% passed | |
| nb good = 260, nb bad = 5 =========> 98.113208% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/delete.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 55 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_flags on line 60 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 198, nb passed = 0 =========> 0.000000% passed | |
| nb good = 198, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/event.c | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 331, nb passed = 0 =========> 0.000000% passed | |
| nb good = 331, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/fetch.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 60 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_flags on line 65 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 188, nb passed = 0 =========> 0.000000% passed | |
| nb good = 188, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/info.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 79 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 427, nb passed = 0 =========> 0.000000% passed | |
| nb good = 427, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/install.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 62 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_flags on line 67 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 206, nb passed = 0 =========> 0.000000% passed | |
| nb good = 206, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/lock.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 45 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 208, nb passed = 0 =========> 0.000000% passed | |
| nb good = 208, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/main.c | |
| (ONCE) CPP-found ifdef-mid-something | |
| (ONCE) CPP-MACRO: found string-macro PRId64 | |
| (ONCE) CPP-MACRO: found string-macro PKG_PORTVERSION | |
| (ONCE) CPP-MACRO: found string-macro GITHASH | |
| (ONCE) CPP-MACRO: found string-macro PKG_EXEC_NAME | |
| (ONCE) CPP-MACRO: found string-macro PKG_STATIC_NAME | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 56 | |
| ERROR-RECOV: found sync col 0 at line 105 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync col 0 at line 105 | |
| parse error | |
| = File "pkg/main.c", line 104, column 19, charpos = 5336 | |
| around = ',', whole content = static STAILQ_HEAD(, plugcmd) plugins = STAILQ_HEAD_INITIALIZER(plugins); | |
| badcount: 2 | |
| bad: static const unsigned int cmd_len = NELEM(cmd); | |
| bad: | |
| BAD:!!!!! static STAILQ_HEAD(, plugcmd) plugins = STAILQ_HEAD_INITIALIZER(plugins); | |
| ERROR-RECOV: found sync '}' at line 110 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 110 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parse error | |
| = File "pkg/main.c", line 109, column 23, charpos = 5506 | |
| around = 'next', whole content = STAILQ_ENTRY(plugcmd) next; | |
| badcount: 6 | |
| bad: static STAILQ_HEAD(, plugcmd) plugins = STAILQ_HEAD_INITIALIZER(plugins); | |
| bad: struct plugcmd { | |
| bad: const char *name; | |
| bad: const char *desc; | |
| bad: int (*exec)(int argc, char **argv); | |
| BAD:!!!!! STAILQ_ENTRY(plugcmd) next; | |
| bad: }; | |
| (ONCE) CPP-MACRO: found foreach: STAILQ_FOREACH | |
| (ONCE) CPP-TYPEDEF: promoting:(21) Tokenizer on line 547 | |
| passed:#ifndef NO_LIBJAIL | |
| passed:#else | |
| passed:while ( ( ch = getopt ( argc , argv , "d:c:C:R:lNvq" ) ) != - 1 ) { | |
| passed:#endif | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| plugcmd: present in 2 parsing errors | |
| example: | |
| const char *desc; | |
| int (*exec)(int argc, char **argv); | |
| STAILQ_ENTRY(plugcmd) next; | |
| }; | |
| plugins: present in 2 parsing errors | |
| example: | |
| static const unsigned int cmd_len = NELEM(cmd); | |
| static STAILQ_HEAD(, plugcmd) plugins = STAILQ_HEAD_INITIALIZER(plugins); | |
| struct plugcmd { | |
| STAILQ_ENTRY: present in 1 parsing errors | |
| example: | |
| const char *desc; | |
| int (*exec)(int argc, char **argv); | |
| STAILQ_ENTRY(plugcmd) next; | |
| }; | |
| STAILQ_HEAD: present in 1 parsing errors | |
| example: | |
| static const unsigned int cmd_len = NELEM(cmd); | |
| static STAILQ_HEAD(, plugcmd) plugins = STAILQ_HEAD_INITIALIZER(plugins); | |
| struct plugcmd { | |
| STAILQ_HEAD_INITIALIZER: present in 1 parsing errors | |
| example: | |
| static const unsigned int cmd_len = NELEM(cmd); | |
| static STAILQ_HEAD(, plugcmd) plugins = STAILQ_HEAD_INITIALIZER(plugins); | |
| struct plugcmd { | |
| argc: present in 1 parsing errors | |
| example: | |
| const char *desc; | |
| int (*exec)(int argc, char **argv); | |
| STAILQ_ENTRY(plugcmd) next; | |
| }; | |
| argv: present in 1 parsing errors | |
| example: | |
| const char *desc; | |
| int (*exec)(int argc, char **argv); | |
| STAILQ_ENTRY(plugcmd) next; | |
| }; | |
| desc: present in 1 parsing errors | |
| example: | |
| const char *desc; | |
| int (*exec)(int argc, char **argv); | |
| STAILQ_ENTRY(plugcmd) next; | |
| }; | |
| exec: present in 1 parsing errors | |
| example: | |
| const char *desc; | |
| int (*exec)(int argc, char **argv); | |
| STAILQ_ENTRY(plugcmd) next; | |
| }; | |
| next: present in 1 parsing errors | |
| example: | |
| const char *desc; | |
| int (*exec)(int argc, char **argv); | |
| STAILQ_ENTRY(plugcmd) next; | |
| }; | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0% | |
| nb good = 767, nb passed = 4 =========> 0.521512% passed | |
| nb good = 767, nb bad = 8 =========> 98.967742% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/plugins.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 48 | |
| passed:__unused __unused | |
| passed:__unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 75, nb passed = 2 =========> 2.666667% passed | |
| nb good = 75, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/progressmeter.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| passed:__unused | |
| passed:__unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 325, nb passed = 2 =========> 0.615385% passed | |
| nb good = 325, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/query.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 79 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 965, nb passed = 0 =========> 0.000000% passed | |
| nb good = 965, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/register.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 101 | |
| passed:__unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 324, nb passed = 1 =========> 0.308642% passed | |
| nb good = 324, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/repo.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 92 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 145, nb passed = 0 =========> 0.000000% passed | |
| nb good = 145, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/rquery.c | |
| (ONCE) CPP-MACRO: found string-macro PORTSDIR | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 113 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 252, nb passed = 0 =========> 0.000000% passed | |
| nb good = 252, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/search.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkgdb_field on line 106 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 254 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 400, nb passed = 0 =========> 0.000000% passed | |
| nb good = 400, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/set.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 56 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 226, nb passed = 0 =========> 0.000000% passed | |
| nb good = 226, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/shell.c | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 46, nb passed = 0 =========> 0.000000% passed | |
| nb good = 46, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/shlib.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 147 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 188, nb passed = 0 =========> 0.000000% passed | |
| nb good = 188, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/ssh.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| passed:__unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 52, nb passed = 1 =========> 1.923077% passed | |
| nb good = 52, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/stats.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-MACRO: found string-macro PRId64 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 52 | |
| passed:__unused __unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 116, nb passed = 1 =========> 0.862069% passed | |
| nb good = 116, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/update.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 47 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 124, nb passed = 0 =========> 0.000000% passed | |
| nb good = 124, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/updating.c | |
| ERROR-RECOV: found sync '}' at line 42 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 42 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parse error | |
| = File "pkg/updating.c", line 41, column 30, charpos = 1646 | |
| around = 'next', whole content = SLIST_ENTRY(installed_ports) next; | |
| badcount: 5 | |
| bad: #include "pkgcli.h" | |
| bad: | |
| bad: struct installed_ports { | |
| bad: char *origin; | |
| BAD:!!!!! SLIST_ENTRY(installed_ports) next; | |
| bad: }; | |
| ERROR-RECOV: found sync '}' at line 165 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 165 | |
| parse error | |
| = File "pkg/updating.c", line 59, column 12, charpos = 1997 | |
| around = ',', whole content = SLIST_HEAD(,installed_ports) origins; | |
| badcount: 115 | |
| bad: } | |
| bad: | |
| bad: int | |
| bad: exec_updating(int argc, char **argv) | |
| bad: { | |
| bad: char *date = NULL; | |
| bad: char *dateline = NULL; | |
| bad: char *updatingfile = NULL; | |
| bad: struct installed_ports *port; | |
| BAD:!!!!! SLIST_HEAD(,installed_ports) origins; | |
| bad: int ch; | |
| bad: char *line = NULL; | |
| bad: size_t linecap = 0; | |
| bad: ssize_t linelen; | |
| bad: char *tmp; | |
| bad: int head = 0; | |
| bad: int found = 0; | |
| bad: struct pkgdb *db = NULL; | |
| bad: struct pkg *pkg = NULL; | |
| bad: struct pkgdb_it *it = NULL; | |
| bad: const char *origin; | |
| bad: FILE *fd; | |
| bad: | |
| bad: while ((ch = getopt(argc, argv, "d:f:")) != -1) { | |
| bad: switch (ch) { | |
| bad: case 'd': | |
| bad: date = optarg; | |
| bad: break; | |
| bad: case 'f': | |
| bad: updatingfile = optarg; | |
| bad: break; | |
| bad: default: | |
| bad: usage_updating(); | |
| bad: return (EX_USAGE); | |
| bad: } | |
| bad: } | |
| bad: argc -= optind; | |
| bad: argv += optind; | |
| bad: | |
| bad: /* checking date format */ | |
| bad: if (date != NULL) | |
| bad: if (strlen(date) != 8 || strspn(date, "0123456789") != 8) | |
| bad: err(EX_DATAERR, "Invalid date format"); | |
| bad: | |
| bad: if (pkgdb_open(&db, PKGDB_DEFAULT) != EPKG_OK) | |
| bad: return (EX_IOERR); | |
| bad: | |
| bad: SLIST_INIT(&origins); | |
| bad: if (argc == 0) { | |
| bad: if ((it = pkgdb_query(db, NULL, MATCH_ALL)) == NULL) | |
| bad: goto cleanup; | |
| bad: | |
| bad: while (pkgdb_it_next(it, &pkg, PKG_LOAD_BASIC) == EPKG_OK) { | |
| bad: port = malloc(sizeof(struct installed_ports)); | |
| bad: pkg_get(pkg, PKG_ORIGIN, &origin); | |
| bad: port->origin = strdup(origin); | |
| bad: SLIST_INSERT_HEAD(&origins, port, next); | |
| bad: } | |
| bad: } else { | |
| bad: while (*argv) { | |
| bad: port = malloc(sizeof(struct installed_ports)); | |
| bad: port->origin = strdup(*argv); | |
| bad: SLIST_INSERT_HEAD(&origins, port, next); | |
| bad: argv++; | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: if (updatingfile == NULL) { | |
| bad: const char *portsdir; | |
| bad: if (pkg_config_string(PKG_CONFIG_PORTSDIR, &portsdir) != EPKG_OK) { | |
| bad: warnx("Cannot get portsdir config entry!"); | |
| bad: return (1); | |
| bad: } | |
| bad: asprintf(&updatingfile, "%s/UPDATING", portsdir); | |
| bad: } | |
| bad: | |
| bad: fd = fopen(updatingfile, "r"); | |
| bad: if (fd == NULL) | |
| bad: errx(EX_UNAVAILABLE, "Unable to open: %s", updatingfile); | |
| bad: | |
| bad: while ((linelen = getline(&line, &linecap, fd)) > 0) { | |
| bad: if (strspn(line, "0123456789:") == 9) { | |
| bad: dateline = strdup(line); | |
| bad: found = 0; | |
| bad: head = 1; | |
| bad: } else if (head == 0) { | |
| bad: continue; | |
| bad: } | |
| bad: | |
| bad: tmp = NULL; | |
| bad: if (found == 0) { | |
| bad: if (strstr(line, "AFFECTS") != NULL) { | |
| bad: SLIST_FOREACH(port, &origins, next) { | |
| bad: if ((tmp = strstr(line, port->origin)) != NULL) { | |
| bad: break; | |
| bad: } | |
| bad: } | |
| bad: if (tmp != NULL) { | |
| bad: if ((date != NULL) && strncmp(dateline, date, 8) < 0) | |
| bad: continue; | |
| bad: printf("%s%s",dateline, line); | |
| bad: found = 1; | |
| bad: } | |
| bad: } | |
| bad: } else { | |
| bad: printf("%s",line); | |
| bad: } | |
| bad: } | |
| bad: fclose(fd); | |
| bad: cleanup: | |
| bad: pkgdb_it_free(it); | |
| bad: pkgdb_close(db); | |
| bad: pkg_free(pkg); | |
| bad: | |
| bad: return (EXIT_SUCCESS); | |
| bad: } | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| installed_ports: present in 4 parsing errors | |
| example: | |
| char *updatingfile = NULL; | |
| struct installed_ports *port; | |
| SLIST_HEAD(,installed_ports) origins; | |
| int ch; | |
| NULL: present in 1 parsing errors | |
| example: | |
| char *updatingfile = NULL; | |
| struct installed_ports *port; | |
| SLIST_HEAD(,installed_ports) origins; | |
| int ch; | |
| SLIST_ENTRY: present in 1 parsing errors | |
| example: | |
| struct installed_ports { | |
| char *origin; | |
| SLIST_ENTRY(installed_ports) next; | |
| }; | |
| SLIST_HEAD: present in 1 parsing errors | |
| example: | |
| char *updatingfile = NULL; | |
| struct installed_ports *port; | |
| SLIST_HEAD(,installed_ports) origins; | |
| int ch; | |
| next: present in 1 parsing errors | |
| example: | |
| struct installed_ports { | |
| char *origin; | |
| SLIST_ENTRY(installed_ports) next; | |
| }; | |
| origin: present in 1 parsing errors | |
| example: | |
| struct installed_ports { | |
| char *origin; | |
| SLIST_ENTRY(installed_ports) next; | |
| }; | |
| origins: present in 1 parsing errors | |
| example: | |
| char *updatingfile = NULL; | |
| struct installed_ports *port; | |
| SLIST_HEAD(,installed_ports) origins; | |
| int ch; | |
| port: present in 1 parsing errors | |
| example: | |
| char *updatingfile = NULL; | |
| struct installed_ports *port; | |
| SLIST_HEAD(,installed_ports) origins; | |
| int ch; | |
| updatingfile: present in 1 parsing errors | |
| example: | |
| char *updatingfile = NULL; | |
| struct installed_ports *port; | |
| SLIST_HEAD(,installed_ports) origins; | |
| int ch; | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0% | |
| nb good = 44, nb passed = 0 =========> 0.000000% passed | |
| nb good = 44, nb bad = 120 =========> 26.829268% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/upgrade.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 54 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_flags on line 58 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 182, nb passed = 0 =========> 0.000000% passed | |
| nb good = 182, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/utils.c | |
| (ONCE) CPP-MACRO: found string-macro PRId64 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 45 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) va_list on line 50 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) SHA256_CTX on line 735 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 764, nb passed = 0 =========> 0.000000% passed | |
| nb good = 764, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/version.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) UT_hash_handle on line 55 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 71 | |
| ERROR-RECOV: found sync '}' at line 438 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 438 | |
| parse error | |
| = File "pkg/version.c", line 425, column 38, charpos = 10919 | |
| around = '{', whole content = HASH_ITER(hh, indexhead, entry, tmp) { | |
| badcount: 299 | |
| bad: } | |
| bad: | |
| bad: int | |
| bad: exec_version(int argc, char **argv) | |
| bad: { | |
| bad: unsigned int opt = 0; | |
| bad: int ch; | |
| bad: FILE *indexfile; | |
| bad: char indexpath[MAXPATHLEN + 1]; | |
| bad: struct index_entry *indexhead = NULL; | |
| bad: struct utsname u; | |
| bad: int rel_major_ver; | |
| bad: int retval; | |
| bad: char *line = NULL; | |
| bad: size_t linecap = 0; | |
| bad: ssize_t linelen; | |
| bad: char *buf; | |
| bad: char *version; | |
| bad: struct index_entry *entry, *tmp; | |
| bad: struct pkgdb *db = NULL; | |
| bad: struct pkg *pkg = NULL, *pkg_remote = NULL; | |
| bad: struct pkgdb_it *it = NULL, *it_remote = NULL; | |
| bad: char limchar = '-'; | |
| bad: struct sbuf *cmd; | |
| bad: struct sbuf *res; | |
| bad: const char *portsdir; | |
| bad: const char *origin; | |
| bad: const char *matchorigin = NULL; | |
| bad: const char *reponame = NULL; | |
| bad: const char *version_remote = NULL; | |
| bad: bool have_ports; | |
| bad: bool auto_update; | |
| bad: match_t match = MATCH_ALL; | |
| bad: char *pattern=NULL; | |
| bad: struct stat sb; | |
| bad: char portsdirmakefile[MAXPATHLEN]; | |
| bad: | |
| bad: pkg_config_bool(PKG_CONFIG_REPO_AUTOUPDATE, &auto_update); | |
| bad: | |
| bad: while ((ch = getopt(argc, argv, "hIPRUoqvl:L:ix:g:e:O:r:tT")) != -1) { | |
| bad: switch (ch) { | |
| bad: case 'h': | |
| bad: usage_version(); | |
| bad: return (EX_OK); | |
| bad: case 'I': | |
| bad: opt |= VERSION_SOURCE_INDEX; | |
| bad: break; | |
| bad: case 'R': | |
| bad: opt |= VERSION_SOURCE_REMOTE; | |
| bad: break; | |
| bad: case 'U': | |
| bad: auto_update = false; | |
| bad: break; | |
| bad: case 'P': | |
| bad: opt |= VERSION_SOURCE_PORTS; | |
| bad: break; | |
| bad: case 'o': | |
| bad: opt |= VERSION_ORIGIN; | |
| bad: break; | |
| bad: case 'q': | |
| bad: opt |= VERSION_QUIET; | |
| bad: break; | |
| bad: case 'v': | |
| bad: opt |= VERSION_VERBOSE; | |
| bad: break; | |
| bad: case 'l': | |
| bad: opt |= VERSION_STATUS; | |
| bad: limchar = *optarg; | |
| bad: break; | |
| bad: case 'L': | |
| bad: opt |= VERSION_NOSTATUS; | |
| bad: limchar = *optarg; | |
| bad: break; | |
| bad: case 'i': | |
| bad: pkgdb_set_case_sensitivity(false); | |
| bad: break; | |
| bad: case 'x': | |
| bad: match = MATCH_REGEX; | |
| bad: pattern = optarg; | |
| bad: break; | |
| bad: case 'g': | |
| bad: match = MATCH_GLOB; | |
| bad: pattern = optarg; | |
| bad: break; | |
| bad: case 'e': | |
| bad: match = MATCH_EXACT; | |
| bad: pattern = optarg; | |
| bad: break; | |
| bad: case 'r': | |
| bad: reponame = optarg; | |
| bad: break; | |
| bad: case 'O': | |
| bad: opt |= VERSION_WITHORIGIN; | |
| bad: matchorigin = optarg; | |
| bad: break; | |
| bad: case 't': | |
| bad: opt |= VERSION_TESTVERSION; | |
| bad: break; | |
| bad: case 'T': | |
| bad: opt |= VERSION_TESTPATTERN; | |
| bad: break; | |
| bad: default: | |
| bad: usage_version(); | |
| bad: return (EX_USAGE); | |
| bad: } | |
| bad: } | |
| bad: argc -= optind; | |
| bad: argv += optind; | |
| bad: | |
| bad: if (opt & VERSION_STATUS) { | |
| bad: if (limchar != '<' && | |
| bad: limchar != '>' && | |
| bad: limchar != '=') { | |
| bad: usage_version(); | |
| bad: return (EX_USAGE); | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: /* -t must be unique */ | |
| bad: if (((opt & VERSION_TESTVERSION) && opt != VERSION_TESTVERSION) || | |
| bad: (opt == VERSION_TESTVERSION && argc < 2)) { | |
| bad: usage_version(); | |
| bad: return (EX_USAGE); | |
| bad: | |
| bad: } else if (opt == VERSION_TESTVERSION) { | |
| bad: switch (pkg_version_cmp(argv[0], argv[1])) { | |
| bad: case -1: | |
| bad: printf("<\n"); | |
| bad: break; | |
| bad: case 0: | |
| bad: printf("=\n"); | |
| bad: break; | |
| bad: case 1: | |
| bad: printf(">\n"); | |
| bad: break; | |
| bad: } | |
| bad: /* -T must be unique */ | |
| bad: } else if (((opt & VERSION_TESTPATTERN) && opt != VERSION_TESTPATTERN) || | |
| bad: (opt == VERSION_TESTPATTERN && argc != 2)) { | |
| bad: usage_version(); | |
| bad: return (EX_USAGE); | |
| bad: | |
| bad: } else if (opt == VERSION_TESTPATTERN) { | |
| bad: if (strcmp(argv[0], "-") == 0) { | |
| bad: ch = 0; /* pattern from stdin */ | |
| bad: } else if (strcmp(argv[1], "-") == 0) { | |
| bad: ch = 1; /* pkgname from stdin */ | |
| bad: } else return (fnmatch(argv[1], argv[0], 0)); | |
| bad: | |
| bad: retval = FNM_NOMATCH; | |
| bad: | |
| bad: while ((linelen = getline(&line, &linecap, stdin)) > 0) { | |
| bad: line[linelen - 1] = '\0'; /* Strip trailing newline */ | |
| bad: if ((ch == 0 && (fnmatch(argv[1], line, 0) == 0)) || | |
| bad: (ch == 1 && (fnmatch(line, argv[0], 0) == 0))) { | |
| bad: retval = EPKG_OK; | |
| bad: printf("%.*s\n", (int)linelen, line); | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: free(line); | |
| bad: | |
| bad: return (retval); | |
| bad: | |
| bad: } else { | |
| bad: if (pkg_config_string(PKG_CONFIG_PORTSDIR, &portsdir) != EPKG_OK) | |
| bad: err(1, "Cannot get portsdir config entry!"); | |
| bad: | |
| bad: snprintf(portsdirmakefile, sizeof(portsdirmakefile), | |
| bad: "%s/Makefile", portsdir); | |
| bad: | |
| bad: have_ports = (stat(portsdirmakefile, &sb) == 0 && S_ISREG(sb.st_mode)); | |
| bad: | |
| bad: /* If none of -IPR were specified, and portsdir exists use that, | |
| bad: otherwise fallback to remote. */ | |
| bad: if ((opt & (VERSION_SOURCE_PORTS|VERSION_SOURCE_REMOTE|VERSION_SOURCE_INDEX)) == 0) { | |
| bad: if (have_ports) | |
| bad: opt |= VERSION_SOURCE_PORTS; | |
| bad: else | |
| bad: opt |= VERSION_SOURCE_REMOTE; | |
| bad: } | |
| bad: | |
| bad: if (!have_ports && (opt & (VERSION_SOURCE_INDEX|VERSION_SOURCE_PORTS))) | |
| bad: err(1, "Unable to open ports directory %s", portsdir); | |
| bad: | |
| bad: /* Only force remote mode if looking up remote, otherwise | |
| bad: user is forced to have a repo.sqlite */ | |
| bad: if (opt & VERSION_SOURCE_REMOTE) { | |
| bad: if (auto_update) { | |
| bad: int retcode; | |
| bad: | |
| bad: retcode = pkgcli_update(false); | |
| bad: if (retcode != EPKG_OK) | |
| bad: return (retcode); | |
| bad: } | |
| bad: if (pkgdb_open(&db, PKGDB_REMOTE) != EPKG_OK) | |
| bad: return (EX_IOERR); | |
| bad: } else | |
| bad: if (pkgdb_open(&db, PKGDB_DEFAULT) != EPKG_OK) | |
| bad: return (EX_IOERR); | |
| bad: | |
| bad: if ((it = pkgdb_query(db, pattern, match)) == NULL) | |
| bad: goto cleanup; | |
| bad: | |
| bad: if (opt & VERSION_SOURCE_INDEX) { | |
| bad: uname(&u); | |
| bad: rel_major_ver = (int) strtol(u.release, NULL, 10); | |
| bad: snprintf(indexpath, sizeof(indexpath), "%s/INDEX-%d", portsdir, rel_major_ver); | |
| bad: indexfile = fopen(indexpath, "r"); | |
| bad: if (!indexfile) | |
| bad: err(EX_SOFTWARE, "Unable to open %s!", indexpath); | |
| bad: | |
| bad: while ((linelen = getline(&line, &linecap, indexfile)) > 0) { | |
| bad: /* line is pkgname|portdir|... */ | |
| bad: buf = strchr(line, '|'); | |
| bad: buf[0] = '\0'; | |
| bad: buf++; | |
| bad: version = strrchr(line, '-'); | |
| bad: version[0] = '\0'; | |
| bad: version++; | |
| bad: buf = strchr(buf, '|'); | |
| bad: buf[0] = '\0'; | |
| bad: buf--; | |
| bad: /* go backward to get the last two dirs of portsdir */ | |
| bad: while (buf[0] != '/') | |
| bad: buf--; | |
| bad: buf--; | |
| bad: while (buf[0] != '/') | |
| bad: buf--; | |
| bad: buf++; | |
| bad: | |
| bad: entry = malloc(sizeof(struct index_entry)); | |
| bad: entry->version = strdup(version); | |
| bad: entry->origin = strdup(buf); | |
| bad: HASH_ADD_KEYPTR(hh, indexhead, entry->origin, strlen(entry->origin), entry); | |
| bad: } | |
| bad: free(line); | |
| bad: fclose(indexfile); | |
| bad: } | |
| bad: | |
| bad: while (pkgdb_it_next(it, &pkg, PKG_LOAD_BASIC) == EPKG_OK) { | |
| bad: pkg_get(pkg, PKG_ORIGIN, &origin); | |
| bad: | |
| bad: /* If -O was specific, check if this origin matches */ | |
| bad: if ((opt & VERSION_WITHORIGIN) && strcmp(origin, matchorigin) != 0) | |
| bad: continue; | |
| bad: | |
| bad: if (opt & VERSION_SOURCE_INDEX) { | |
| bad: HASH_FIND_STR(indexhead, origin, entry); | |
| bad: if (entry != NULL) | |
| bad: print_version(pkg, "index", entry->version, limchar, opt); | |
| bad: } else if (opt & VERSION_SOURCE_PORTS) { | |
| bad: cmd = sbuf_new_auto(); | |
| bad: sbuf_printf(cmd, "make -C %s/%s -VPKGVERSION 2>/dev/null", portsdir, origin); | |
| bad: sbuf_finish(cmd); | |
| bad: | |
| bad: if ((res = exec_buf(sbuf_data(cmd))) != NULL) { | |
| bad: buf = sbuf_data(res); | |
| bad: while (*buf != '\0') { | |
| bad: if (*buf == '\n') { | |
| bad: *buf = '\0'; | |
| bad: break; | |
| bad: } | |
| bad: buf++; | |
| bad: } | |
| bad: print_version(pkg, "port", sbuf_data(res), limchar, opt); | |
| bad: sbuf_delete(res); | |
| bad: } else { | |
| bad: print_version(pkg, "port", NULL, limchar, opt); | |
| bad: } | |
| bad: sbuf_delete(cmd); | |
| bad: } else if (opt & VERSION_SOURCE_REMOTE) { | |
| bad: if ((it_remote = pkgdb_rquery(db, origin, MATCH_EXACT, reponame)) == NULL) | |
| bad: return (EX_IOERR); | |
| bad: if (pkgdb_it_next(it_remote, &pkg_remote, PKG_LOAD_BASIC) == EPKG_OK) { | |
| bad: pkg_get(pkg_remote, PKG_VERSION, &version_remote); | |
| bad: print_version(pkg, "remote", version_remote, limchar, opt); | |
| bad: } else { | |
| bad: print_version(pkg, "remote", NULL, limchar, opt); | |
| bad: } | |
| bad: pkgdb_it_free(it_remote); | |
| bad: } | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: cleanup: | |
| BAD:!!!!! HASH_ITER(hh, indexhead, entry, tmp) { | |
| bad: HASH_DEL(indexhead, entry); | |
| bad: free(entry->origin); | |
| bad: free(entry->version); | |
| bad: free(entry); | |
| bad: } | |
| bad: | |
| bad: pkg_free(pkg); | |
| bad: pkg_free(pkg_remote); | |
| bad: pkgdb_it_free(it); | |
| bad: pkgdb_close(db); | |
| bad: | |
| bad: return (EX_OK); | |
| bad: } | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| HASH_ITER: present in 1 parsing errors | |
| example: | |
| cleanup: | |
| HASH_ITER(hh, indexhead, entry, tmp) { | |
| HASH_DEL(indexhead, entry); | |
| cleanup: present in 1 parsing errors | |
| example: | |
| cleanup: | |
| HASH_ITER(hh, indexhead, entry, tmp) { | |
| HASH_DEL(indexhead, entry); | |
| entry: present in 1 parsing errors | |
| example: | |
| cleanup: | |
| HASH_ITER(hh, indexhead, entry, tmp) { | |
| HASH_DEL(indexhead, entry); | |
| hh: present in 1 parsing errors | |
| example: | |
| cleanup: | |
| HASH_ITER(hh, indexhead, entry, tmp) { | |
| HASH_DEL(indexhead, entry); | |
| indexhead: present in 1 parsing errors | |
| example: | |
| cleanup: | |
| HASH_ITER(hh, indexhead, entry, tmp) { | |
| HASH_DEL(indexhead, entry); | |
| tmp: present in 1 parsing errors | |
| example: | |
| cleanup: | |
| HASH_ITER(hh, indexhead, entry, tmp) { | |
| HASH_DEL(indexhead, entry); | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0% | |
| nb good = 138, nb passed = 0 =========> 0.000000% passed | |
| nb good = 138, nb bad = 299 =========> 31.578947% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: pkg/which.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 55 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 117, nb passed = 0 =========> 0.000000% passed | |
| nb good = 117, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/backup.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-TYPEDEF: promoting:(14) sqlite3 on line 59 | |
| (ONCE) CPP-TYPEDEF: promoting:(23) sqlite3_backup on line 61 | |
| PB MAYBE: dangerous typedef inference, maybe not a typedef: sqlite3_backup | |
| passed:__unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 190, nb passed = 1 =========> 0.526316% passed | |
| nb good = 190, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/dns_utils.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) HEADER on line 39 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 259, nb passed = 0 =========> 0.000000% passed | |
| nb good = 259, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/elfhints.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) UT_hash_handle on line 54 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 63 | |
| ERROR-RECOV: found sync '}' at line 154 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 154 | |
| parse error | |
| = File "libpkg/elfhints.c", line 149, column 33, charpos = 4138 | |
| around = '{', whole content = HASH_ITER(hh, shlibs, sl1, sl2) { | |
| badcount: 12 | |
| bad: } | |
| bad: | |
| bad: void | |
| bad: shlib_list_free(void) | |
| bad: { | |
| bad: struct shlib_list *sl1, *sl2; | |
| bad: | |
| BAD:!!!!! HASH_ITER(hh, shlibs, sl1, sl2) { | |
| bad: HASH_DEL(shlibs, sl1); | |
| bad: free(sl1); | |
| bad: } | |
| bad: shlibs = NULL; | |
| bad: } | |
| ERROR-RECOV: found sync '}' at line 166 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 166 | |
| parse error | |
| = File "libpkg/elfhints.c", line 161, column 32, charpos = 4293 | |
| around = '{', whole content = HASH_ITER(hh, rpath, sl1, sl2) { | |
| badcount: 12 | |
| bad: } | |
| bad: | |
| bad: void | |
| bad: rpath_list_free(void) | |
| bad: { | |
| bad: struct shlib_list *sl1, *sl2; | |
| bad: | |
| BAD:!!!!! HASH_ITER(hh, rpath, sl1, sl2) { | |
| bad: HASH_DEL(rpath, sl1); | |
| bad: free(sl1); | |
| bad: } | |
| bad: rpath = NULL; | |
| bad: } | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| sl1: present in 4 parsing errors | |
| example: | |
| struct shlib_list *sl1, *sl2; | |
| HASH_ITER(hh, rpath, sl1, sl2) { | |
| HASH_DEL(rpath, sl1); | |
| sl2: present in 4 parsing errors | |
| example: | |
| struct shlib_list *sl1, *sl2; | |
| HASH_ITER(hh, rpath, sl1, sl2) { | |
| HASH_DEL(rpath, sl1); | |
| HASH_ITER: present in 2 parsing errors | |
| example: | |
| struct shlib_list *sl1, *sl2; | |
| HASH_ITER(hh, rpath, sl1, sl2) { | |
| HASH_DEL(rpath, sl1); | |
| hh: present in 2 parsing errors | |
| example: | |
| struct shlib_list *sl1, *sl2; | |
| HASH_ITER(hh, rpath, sl1, sl2) { | |
| HASH_DEL(rpath, sl1); | |
| shlib_list: present in 2 parsing errors | |
| example: | |
| struct shlib_list *sl1, *sl2; | |
| HASH_ITER(hh, rpath, sl1, sl2) { | |
| HASH_DEL(rpath, sl1); | |
| rpath: present in 1 parsing errors | |
| example: | |
| struct shlib_list *sl1, *sl2; | |
| HASH_ITER(hh, rpath, sl1, sl2) { | |
| HASH_DEL(rpath, sl1); | |
| shlibs: present in 1 parsing errors | |
| example: | |
| struct shlib_list *sl1, *sl2; | |
| HASH_ITER(hh, shlibs, sl1, sl2) { | |
| HASH_DEL(shlibs, sl1); | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0% | |
| nb good = 514, nb passed = 0 =========> 0.000000% passed | |
| nb good = 514, nb bad = 24 =========> 95.539033% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/fetch.c | |
| (ONCE) CPP-MACRO: found string-macro PRIdMAX | |
| (ONCE) CPP-MACRO: found string-macro URL_SCHEME_PREFIX | |
| (ONCE) CPP-TYPEDEF: promoting:(2) fd_set on line 149 | |
| ERROR-RECOV: found sync '}' at line 232 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 232 | |
| parse error | |
| = File "libpkg/fetch.c", line 211, column 34, charpos = 5100 | |
| around = '>', whole content = if (!timercmp(&timeout, &now, >)) { | |
| badcount: 90 | |
| bad: } | |
| bad: | |
| bad: static int | |
| bad: ssh_read(void *data, char *buf, int len) | |
| bad: { | |
| bad: struct pkg_repo *repo = (struct pkg_repo *) data; | |
| bad: struct timeval now, timeout, delta; | |
| bad: fd_set readfds; | |
| bad: ssize_t rlen, total; | |
| bad: char *start; | |
| bad: | |
| bad: pkg_debug(2, "ssh: start reading"); | |
| bad: | |
| bad: if (fetchTimeout > 0) { | |
| bad: gettimeofday(&timeout, NULL); | |
| bad: timeout.tv_sec += fetchTimeout; | |
| bad: } | |
| bad: | |
| bad: total = 0; | |
| bad: start = buf; | |
| bad: | |
| bad: if (repo->sshio.cache.len > 0) { | |
| bad: /* | |
| bad: * The last invocation of fetch_read was interrupted by a | |
| bad: * signal after some data had been read from the socket. Copy | |
| bad: * the cached data into the supplied buffer before trying to | |
| bad: * read from the socket again. | |
| bad: */ | |
| bad: total = (repo->sshio.cache.len < (size_t)len) ? repo->sshio.cache.len : (size_t)len; | |
| bad: memcpy(buf, repo->sshio.cache.buf, total); | |
| bad: | |
| bad: repo->sshio.cache.len -= total; | |
| bad: repo->sshio.cache.pos += total; | |
| bad: len -= total; | |
| bad: buf += total; | |
| bad: } | |
| bad: | |
| bad: | |
| bad: while (len > 0) { | |
| bad: if (repo->tofetch > 0 && repo->tofetch == repo->fetched) | |
| bad: break; | |
| bad: | |
| bad: rlen = read(repo->sshio.in, buf, len); | |
| bad: if (rlen == 0) { | |
| bad: break; | |
| bad: } else if (rlen > 0) { | |
| bad: len -= rlen; | |
| bad: buf += rlen; | |
| bad: if (repo->tofetch > 0) | |
| bad: repo->fetched += rlen; | |
| bad: total += rlen; | |
| bad: continue; | |
| bad: } else if (rlen == -1) { | |
| bad: if (errno == EINTR) | |
| bad: ssh_cache_data(repo, start, total); | |
| bad: if (errno != EAGAIN) { | |
| bad: pkg_emit_errno("timeout", "ssh"); | |
| bad: return (-1); | |
| bad: } | |
| bad: if (errno == EAGAIN && total > 0) { | |
| bad: break; | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: FD_ZERO(&readfds); | |
| bad: while (!FD_ISSET(repo->sshio.in, &readfds)) { | |
| bad: FD_SET(repo->sshio.in, &readfds); | |
| bad: if (fetchTimeout > 0) { | |
| bad: gettimeofday(&now, NULL); | |
| BAD:!!!!! if (!timercmp(&timeout, &now, >)) { | |
| bad: errno = ETIMEDOUT; | |
| bad: return (-1); | |
| bad: } | |
| bad: timersub(&timeout, &now, &delta); | |
| bad: } | |
| bad: errno = 0; | |
| bad: if (select(repo->sshio.in + 1, &readfds, NULL, NULL, | |
| bad: fetchTimeout > 0 ? &delta : NULL) < 0) { | |
| bad: if (errno == EINTR) { | |
| bad: /* Save anything that was read. */ | |
| bad: ssh_cache_data(repo, start, total); | |
| bad: continue; | |
| bad: } | |
| bad: return (-1); | |
| bad: } | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: pkg_debug(2, "ssh: have read %d bytes", total); | |
| bad: return (total); | |
| bad: } | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 402 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| now: present in 2 parsing errors | |
| example: | |
| if (fetchTimeout > 0) { | |
| gettimeofday(&now, NULL); | |
| if (!timercmp(&timeout, &now, >)) { | |
| errno = ETIMEDOUT; | |
| NULL: present in 1 parsing errors | |
| example: | |
| if (fetchTimeout > 0) { | |
| gettimeofday(&now, NULL); | |
| if (!timercmp(&timeout, &now, >)) { | |
| errno = ETIMEDOUT; | |
| fetchTimeout: present in 1 parsing errors | |
| example: | |
| if (fetchTimeout > 0) { | |
| gettimeofday(&now, NULL); | |
| if (!timercmp(&timeout, &now, >)) { | |
| errno = ETIMEDOUT; | |
| gettimeofday: present in 1 parsing errors | |
| example: | |
| if (fetchTimeout > 0) { | |
| gettimeofday(&now, NULL); | |
| if (!timercmp(&timeout, &now, >)) { | |
| errno = ETIMEDOUT; | |
| timeout: present in 1 parsing errors | |
| example: | |
| if (fetchTimeout > 0) { | |
| gettimeofday(&now, NULL); | |
| if (!timercmp(&timeout, &now, >)) { | |
| errno = ETIMEDOUT; | |
| timercmp: present in 1 parsing errors | |
| example: | |
| if (fetchTimeout > 0) { | |
| gettimeofday(&now, NULL); | |
| if (!timercmp(&timeout, &now, >)) { | |
| errno = ETIMEDOUT; | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0% | |
| nb good = 497, nb passed = 0 =========> 0.000000% passed | |
| nb good = 497, nb bad = 90 =========> 84.667802% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/packing.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_formats on line 46 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 49 | |
| (ONCE) CPP-TYPEDEF: promoting:(21) FTS on line 278 | |
| (ONCE) CPP-TYPEDEF: promoting:(21) FTSENT on line 279 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 384, nb passed = 0 =========> 0.000000% passed | |
| nb good = 384, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) va_list on line 187 | |
| (ONCE) CPP-TYPEDEF: promoting:(5) bool on line 212 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_attr on line 344 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_script on line 741 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_list on line 1040 | |
| passed:restrict | |
| passed:restrict | |
| passed:restrict | |
| passed:restrict | |
| passed:restrict | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 1518, nb passed = 5 =========> 0.329381% passed | |
| nb good = 1518, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_add.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 163 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 355, nb passed = 0 =========> 0.000000% passed | |
| nb good = 355, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_attributes.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_dep_attr on line 61 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 81 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_file_attr on line 112 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_dir_attr on line 175 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_script on line 356 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 490, nb passed = 0 =========> 0.000000% passed | |
| nb good = 490, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_config.c | |
| (ONCE) CPP-MACRO: found string-macro PKGVERSION | |
| (ONCE) CPP-MACRO: found string-macro REPO_NAME_PREFIX | |
| (ONCE) CPP-MACRO: found string-macro PREFIX | |
| ERROR-RECOV: found sync '}' at line 290 | |
| ERROR-RECOV: found sync bis, eating } and ; | |
| parsing pass2: try again | |
| (ONCE) CPP-In Initializer passing | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 292 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_config_key on line 494 | |
| passed:#ifdef DEFAULT_PACKAGESITE | |
| passed:#else | |
| passed:#endif | |
| passed:#ifdef PORTSDIR | |
| passed:#else | |
| passed:#endif | |
| passed:#ifdef DEFAULT_AUDIT_URL | |
| passed:#else | |
| passed:#endif | |
| passed:#ifdef DEFAULT_VULNXML_URL | |
| passed:#else | |
| passed:#endif | |
| passed:#if DEFAULT_MIRROR_TYPE == 1 | |
| passed:#elif DEFAULT_MIRROR_TYPE == 2 | |
| passed:#else | |
| passed:#endif | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 1419, nb passed = 16 =========> 1.127555% passed | |
| nb good = 1419, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_create.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 53 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_formats on line 163 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 382, nb passed = 0 =========> 0.000000% passed | |
| nb good = 382, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_delete.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 46 | |
| passed:__unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 192, nb passed = 1 =========> 0.520833% passed | |
| nb good = 192, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_elf.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 87 | |
| (ONCE) SEMANTIC:parameter name omitted, but I continue | |
| (ONCE) CPP-TYPEDEF: promoting:(21) Elf on line 194 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) GElf_Ehdr on line 195 | |
| (ONCE) CPP-TYPEDEF: promoting:(21) Elf_Scn on line 196 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) GElf_Shdr on line 199 | |
| (ONCE) CPP-TYPEDEF: promoting:(23) Elf_Data on line 200 | |
| PB MAYBE: dangerous typedef inference, maybe not a typedef: Elf_Data | |
| (ONCE) CPP-TYPEDEF: promoting:(24) GElf_Dyn on line 201 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) Elf_Note on line 628 | |
| TYPEDEF CONFLICT:Elf_Note | |
| transforming some ident in typedef | |
| passed:__unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 871, nb passed = 1 =========> 0.114811% passed | |
| nb good = 871, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_event.c | |
| (ONCE) CPP-MACRO: found string-macro PRId64 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_event_cb on line 37 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) va_list on line 352 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 449 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 738, nb passed = 0 =========> 0.000000% passed | |
| nb good = 738, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_jobs.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 45 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_flags on line 72 | |
| ERROR-RECOV: found sync '}' at line 174 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 174 | |
| parse error | |
| = File "libpkg/pkg_jobs.c", line 167, column 34, charpos = 4723 | |
| around = '{', whole content = HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| badcount: 15 | |
| bad: } | |
| bad: | |
| bad: static void | |
| bad: remove_from_rdeps(struct pkg_jobs *j, const char *origin) | |
| bad: { | |
| bad: struct pkg *pkg, *tmp; | |
| bad: struct pkg_dep *d; | |
| bad: | |
| BAD:!!!!! HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| bad: HASH_FIND_STR(pkg->rdeps, origin, d); | |
| bad: if (d != NULL) { | |
| bad: HASH_DEL(pkg->rdeps, d); | |
| bad: pkg_dep_free(d); | |
| bad: } | |
| bad: } | |
| bad: } | |
| ERROR-RECOV: found sync '}' at line 231 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 231 | |
| parse error | |
| = File "libpkg/pkg_jobs.c", line 186, column 34, charpos = 5072 | |
| around = '{', whole content = HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| badcount: 57 | |
| bad: } | |
| bad: | |
| bad: static int | |
| bad: reverse_order_pool(struct pkg_jobs *j, bool force) | |
| bad: { | |
| bad: struct pkg *pkg, *tmp; | |
| bad: struct pkg_dep *d, *dtmp; | |
| bad: char *origin; | |
| bad: unsigned int nb; | |
| bad: struct sbuf *errb; | |
| bad: | |
| bad: nb = HASH_COUNT(j->bulk); | |
| BAD:!!!!! HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| bad: pkg_get(pkg, PKG_ORIGIN, &origin); | |
| bad: if (HASH_COUNT(pkg->rdeps) == 0) { | |
| bad: HASH_DEL(j->bulk, pkg); | |
| bad: HASH_ADD_KEYPTR(hh, j->jobs, origin, strlen(origin), pkg); | |
| bad: remove_from_rdeps(j, origin); | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: if (nb == HASH_COUNT(j->bulk)) { | |
| bad: errb = sbuf_new_auto(); | |
| bad: HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| bad: pkg_get(pkg, PKG_ORIGIN, &origin); | |
| bad: sbuf_printf(errb, "%s: ", origin); | |
| bad: HASH_ITER(hh, pkg->rdeps, d, dtmp) { | |
| bad: if (d->hh.next != NULL) | |
| bad: sbuf_printf(errb, "%s, ", pkg_dep_get(d, PKG_DEP_ORIGIN)); | |
| bad: else | |
| bad: sbuf_printf(errb, "%s\n", pkg_dep_get(d, PKG_DEP_ORIGIN)); | |
| bad: } | |
| bad: if (force) { | |
| bad: HASH_DEL(j->bulk, pkg); | |
| bad: HASH_ADD_KEYPTR(hh, j->jobs, origin, strlen(origin), pkg); | |
| bad: remove_from_rdeps(j, origin); | |
| bad: } | |
| bad: | |
| bad: } | |
| bad: sbuf_finish(errb); | |
| bad: if (!force) { | |
| bad: pkg_emit_error("Error while trying to delete packages, " | |
| bad: "dependencies that are still required:\n%s", sbuf_data(errb)); | |
| bad: sbuf_delete(errb); | |
| bad: return (EPKG_FATAL); | |
| bad: } | |
| bad: else { | |
| bad: pkg_emit_notice("You are trying to delete package(s) which has " | |
| bad: "dependencies that are still required:\n%s" | |
| bad: "... delete these packages anyway in forced mode", | |
| bad: sbuf_data(errb)); | |
| bad: sbuf_delete(errb); | |
| bad: return (EPKG_END); | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: return (EPKG_OK); | |
| bad: } | |
| (ONCE) CPP-MACRO: found foreach: LL_FOREACH | |
| ERROR-RECOV: found sync '}' at line 289 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 289 | |
| parse error | |
| = File "libpkg/pkg_jobs.c", line 264, column 34, charpos = 7206 | |
| around = '{', whole content = HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| badcount: 58 | |
| bad: } | |
| bad: static int | |
| bad: jobs_solve_deinstall(struct pkg_jobs *j) | |
| bad: { | |
| bad: struct job_pattern *jp = NULL; | |
| bad: struct pkg *pkg = NULL; | |
| bad: struct pkg *tmp, *p; | |
| bad: struct pkg_dep *d, *dtmp; | |
| bad: struct pkgdb_it *it; | |
| bad: int64_t oldsize; | |
| bad: char *origin; | |
| bad: int ret; | |
| bad: bool recursive = false; | |
| bad: | |
| bad: if ((j->flags & PKG_FLAG_RECURSIVE) == PKG_FLAG_RECURSIVE) | |
| bad: recursive = true; | |
| bad: | |
| bad: LL_FOREACH(j->patterns, jp) { | |
| bad: if ((it = pkgdb_query(j->db, jp->pattern, jp->match)) == NULL) | |
| bad: return (EPKG_FATAL); | |
| bad: | |
| bad: while (pkgdb_it_next(it, &pkg, PKG_LOAD_BASIC|PKG_LOAD_RDEPS) == EPKG_OK) { | |
| bad: pkg_get(pkg, PKG_ORIGIN, &origin, PKG_FLATSIZE, &oldsize); | |
| bad: pkg_set(pkg, PKG_OLD_FLATSIZE, oldsize, PKG_FLATSIZE, (int64_t)0); | |
| bad: HASH_ADD_KEYPTR(hh, j->bulk, origin, strlen(origin), pkg); | |
| bad: if (recursive) | |
| bad: populate_local_rdeps(j, pkg); | |
| bad: pkg = NULL; | |
| bad: } | |
| bad: pkgdb_it_free(it); | |
| bad: } | |
| bad: | |
| bad: /* remove everything seen from deps */ | |
| BAD:!!!!! HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| bad: d = NULL; | |
| bad: HASH_ITER(hh, pkg->rdeps, d, dtmp) { | |
| bad: HASH_FIND_STR(j->seen, pkg_dep_get(d, PKG_DEP_ORIGIN), p); | |
| bad: if (p != NULL) { | |
| bad: HASH_DEL(pkg->rdeps, d); | |
| bad: pkg_dep_free(d); | |
| bad: } | |
| bad: } | |
| bad: } | |
| bad: HASH_FREE(j->seen, pkg, pkg_free); | |
| bad: | |
| bad: while (HASH_COUNT(j->bulk) > 0) { | |
| bad: if ((ret = reverse_order_pool(j, (j->flags & PKG_FLAG_FORCE) == PKG_FLAG_FORCE)) | |
| bad: != EPKG_OK) { | |
| bad: if (ret == EPKG_END) | |
| bad: break; | |
| bad: else | |
| bad: return (EPKG_FATAL); | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: j->solved = true; | |
| bad: | |
| bad: return( EPKG_OK); | |
| bad: } | |
| ERROR-RECOV: found sync '}' at line 310 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 310 | |
| parse error | |
| = File "libpkg/pkg_jobs.c", line 298, column 36, charpos = 7845 | |
| around = '{', whole content = HASH_ITER(hh, j->bulk, pkg1, tmp1) { | |
| badcount: 21 | |
| bad: } | |
| bad: | |
| bad: static bool | |
| bad: recursive_autoremove(struct pkg_jobs *j) | |
| bad: { | |
| bad: struct pkg *pkg1, *tmp1; | |
| bad: int64_t oldsize; | |
| bad: char *origin; | |
| bad: | |
| BAD:!!!!! HASH_ITER(hh, j->bulk, pkg1, tmp1) { | |
| bad: if (HASH_COUNT(pkg1->rdeps) == 0) { | |
| bad: HASH_DEL(j->bulk, pkg1); | |
| bad: pkg_get(pkg1, PKG_ORIGIN, &origin, PKG_FLATSIZE, &oldsize); | |
| bad: pkg_set(pkg1, PKG_OLD_FLATSIZE, oldsize, PKG_FLATSIZE, (int64_t)0); | |
| bad: HASH_ADD_KEYPTR(hh, j->jobs, origin, strlen(origin), pkg1); | |
| bad: remove_from_rdeps(j, origin); | |
| bad: return (true); | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: return (false); | |
| bad: } | |
| ERROR-RECOV: found sync '}' at line 393 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 393 | |
| parse error | |
| = File "libpkg/pkg_jobs.c", line 367, column 34, charpos = 9511 | |
| around = '{', whole content = HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| badcount: 57 | |
| bad: } | |
| bad: | |
| bad: static int | |
| bad: jobs_solve_upgrade(struct pkg_jobs *j) | |
| bad: { | |
| bad: struct pkg *pkg = NULL; | |
| bad: struct pkg *p, *tmp; | |
| bad: struct pkgdb_it *it; | |
| bad: char *origin; | |
| bad: struct pkg_dep *d, *dtmp; | |
| bad: int ret; | |
| bad: | |
| bad: if ((j->flags & PKG_FLAG_SKIP_INSTALL) == 0 && | |
| bad: (j->flags & PKG_FLAG_PKG_VERSION_TEST) == PKG_FLAG_PKG_VERSION_TEST) | |
| bad: if (new_pkg_version(j)) { | |
| bad: pkg_emit_newpkgversion(); | |
| bad: goto order; | |
| bad: } | |
| bad: | |
| bad: if ((it = pkgdb_query(j->db, NULL, MATCH_ALL)) == NULL) | |
| bad: return (EPKG_FATAL); | |
| bad: | |
| bad: while (pkgdb_it_next(it, &pkg, PKG_LOAD_BASIC) == EPKG_OK) { | |
| bad: pkg_get(pkg, PKG_ORIGIN, &origin); | |
| bad: /* Do not test we ignore what doesn't exists remotely */ | |
| bad: get_remote_pkg(j, origin, MATCH_EXACT, false); | |
| bad: pkg = NULL; | |
| bad: } | |
| bad: pkgdb_it_free(it); | |
| bad: | |
| bad: /* remove everything seen from deps */ | |
| BAD:!!!!! HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| bad: d = NULL; | |
| bad: HASH_ITER(hh, pkg->deps, d, dtmp) { | |
| bad: HASH_FIND_STR(j->seen, pkg_dep_get(d, PKG_DEP_ORIGIN), p); | |
| bad: if (p != NULL) { | |
| bad: HASH_DEL(pkg->deps, d); | |
| bad: pkg_dep_free(d); | |
| bad: } | |
| bad: } | |
| bad: } | |
| bad: order: | |
| bad: HASH_FREE(j->seen, pkg, pkg_free); | |
| bad: | |
| bad: /* now order the pool */ | |
| bad: while (HASH_COUNT(j->bulk) > 0) { | |
| bad: /* XXX: see comment at jobs_solve_install */ | |
| bad: ret = order_pool(j, false); | |
| bad: if (ret == EPKG_FATAL) | |
| bad: return (EPKG_FATAL); | |
| bad: else if (ret == EPKG_END) | |
| bad: break; | |
| bad: } | |
| bad: | |
| bad: j->solved = true; | |
| bad: | |
| bad: return (EPKG_OK); | |
| bad: } | |
| ERROR-RECOV: found sync '}' at line 408 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 408 | |
| parse error | |
| = File "libpkg/pkg_jobs.c", line 401, column 34, charpos = 10171 | |
| around = '{', whole content = HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| badcount: 15 | |
| bad: } | |
| bad: | |
| bad: static void | |
| bad: remove_from_deps(struct pkg_jobs *j, const char *origin) | |
| bad: { | |
| bad: struct pkg *pkg, *tmp; | |
| bad: struct pkg_dep *d; | |
| bad: | |
| BAD:!!!!! HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| bad: HASH_FIND_STR(pkg->deps, origin, d); | |
| bad: if (d != NULL) { | |
| bad: HASH_DEL(pkg->deps, d); | |
| bad: pkg_dep_free(d); | |
| bad: } | |
| bad: } | |
| bad: } | |
| ERROR-RECOV: found sync '}' at line 465 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 465 | |
| parse error | |
| = File "libpkg/pkg_jobs.c", line 420, column 34, charpos = 10510 | |
| around = '{', whole content = HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| badcount: 57 | |
| bad: } | |
| bad: | |
| bad: static int | |
| bad: order_pool(struct pkg_jobs *j, bool force) | |
| bad: { | |
| bad: struct pkg *pkg, *tmp; | |
| bad: char *origin; | |
| bad: unsigned int nb; | |
| bad: struct sbuf *errb; | |
| bad: struct pkg_dep *d, *dtmp; | |
| bad: | |
| bad: nb = HASH_COUNT(j->bulk); | |
| BAD:!!!!! HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| bad: pkg_get(pkg, PKG_ORIGIN, &origin); | |
| bad: if (HASH_COUNT(pkg->deps) == 0) { | |
| bad: HASH_DEL(j->bulk, pkg); | |
| bad: HASH_ADD_KEYPTR(hh, j->jobs, origin, strlen(origin), pkg); | |
| bad: remove_from_deps(j, origin); | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: if (nb == HASH_COUNT(j->bulk)) { | |
| bad: errb = sbuf_new_auto(); | |
| bad: HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| bad: pkg_get(pkg, PKG_ORIGIN, &origin); | |
| bad: sbuf_printf(errb, "%s: ", origin); | |
| bad: HASH_ITER(hh, pkg->deps, d, dtmp) { | |
| bad: if (d->hh.next != NULL) | |
| bad: sbuf_printf(errb, "%s, ", pkg_dep_get(d, PKG_DEP_ORIGIN)); | |
| bad: else | |
| bad: sbuf_printf(errb, "%s\n", pkg_dep_get(d, PKG_DEP_ORIGIN)); | |
| bad: } | |
| bad: if (force) { | |
| bad: HASH_DEL(j->bulk, pkg); | |
| bad: HASH_ADD_KEYPTR(hh, j->jobs, origin, strlen(origin), pkg); | |
| bad: remove_from_rdeps(j, origin); | |
| bad: } | |
| bad: | |
| bad: } | |
| bad: sbuf_finish(errb); | |
| bad: if (force) { | |
| bad: pkg_emit_notice("Warning while trying to install/upgrade packages, " | |
| bad: "as there are unresolved dependencies, " | |
| bad: "but installation is forced:\n%s", | |
| bad: sbuf_data(errb)); | |
| bad: sbuf_delete(errb); | |
| bad: return (EPKG_END); | |
| bad: } | |
| bad: else { | |
| bad: pkg_emit_error("Error while trying to install/upgrade packages, " | |
| bad: "as there are unresolved dependencies:\n%s", sbuf_data(errb)); | |
| bad: sbuf_delete(errb); | |
| bad: return (EPKG_FATAL); | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: return (EPKG_OK); | |
| bad: } | |
| ERROR-RECOV: found sync '}' at line 908 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 908 | |
| parsing pass3: try again | |
| (ONCE) CPP-MACRO: found known macro = NO_PKGS_MATCHING_STR | |
| ERROR-RECOV: found sync '}' at line 908 | |
| parsing pass4: try again | |
| ERROR-RECOV: found sync '}' at line 908 | |
| parse error | |
| = File "libpkg/pkg_jobs.c", line 869, column 34, charpos = 20943 | |
| around = '{', whole content = HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| badcount: 106 | |
| bad: "No packages matching '%s' available in the repositories" | |
| bad: | |
| bad: static int | |
| bad: jobs_solve_install(struct pkg_jobs *j) | |
| bad: { | |
| bad: struct job_pattern *jp = NULL; | |
| bad: struct pkg *pkg, *tmp, *p; | |
| bad: struct pkg_dep *d, *dtmp; | |
| bad: struct pkgdb_it *it; | |
| bad: const char *origin; | |
| bad: int ret; | |
| bad: | |
| bad: if ((j->flags & PKG_FLAG_SKIP_INSTALL) == 0 && | |
| bad: (j->flags & PKG_FLAG_PKG_VERSION_TEST) == PKG_FLAG_PKG_VERSION_TEST) | |
| bad: if (new_pkg_version(j)) { | |
| bad: pkg_emit_newpkgversion(); | |
| bad: goto order; | |
| bad: } | |
| bad: | |
| bad: ret = EPKG_OK; | |
| bad: LL_FOREACH(j->patterns, jp) { | |
| bad: if ((j->flags & PKG_FLAG_RECURSIVE) == PKG_FLAG_RECURSIVE) { | |
| bad: it = pkgdb_query(j->db, jp->pattern, jp->match); | |
| bad: if (it == NULL) | |
| bad: return (EPKG_FATAL); | |
| bad: | |
| bad: pkg = NULL; | |
| bad: while (pkgdb_it_next(it, &pkg, | |
| bad: PKG_LOAD_BASIC|PKG_LOAD_RDEPS) == EPKG_OK) { | |
| bad: d = NULL; | |
| bad: pkg_get(pkg, PKG_ORIGIN, &origin); | |
| bad: if (get_remote_pkg(j, origin, MATCH_EXACT, | |
| bad: true) != EPKG_OK) { | |
| bad: ret = EPKG_FATAL; | |
| bad: pkg_emit_error(NO_PKGS_MATCHING_STR, | |
| bad: origin); | |
| bad: } | |
| bad: | |
| bad: while (pkg_rdeps(pkg, &d) == EPKG_OK) { | |
| bad: const char *dep_origin; | |
| bad: dep_origin = pkg_dep_origin(d); | |
| bad: | |
| bad: if (get_remote_pkg(j, dep_origin, | |
| bad: MATCH_EXACT, false) == EPKG_OK) | |
| bad: continue; | |
| bad: ret = EPKG_FATAL; | |
| bad: pkg_emit_error(NO_PKGS_MATCHING_STR, | |
| bad: dep_origin); | |
| bad: } | |
| bad: } | |
| bad: pkgdb_it_free(it); | |
| bad: } else { | |
| bad: if (get_remote_pkg(j, jp->pattern, jp->match, | |
| bad: true) == EPKG_FATAL) { | |
| bad: ret = EPKG_FATAL; | |
| bad: pkg_emit_error(NO_PKGS_MATCHING_STR, | |
| bad: jp->pattern); | |
| bad: } | |
| bad: } | |
| bad: } | |
| bad: if (ret != EPKG_OK) | |
| bad: return (ret); | |
| bad: | |
| bad: if (HASH_COUNT(j->bulk) == 0) | |
| bad: return (EPKG_OK); | |
| bad: | |
| bad: /* remove everything seen from deps */ | |
| BAD:!!!!! HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| bad: d = NULL; | |
| bad: HASH_ITER(hh, pkg->deps, d, dtmp) { | |
| bad: HASH_FIND_STR(j->seen, pkg_dep_get(d, PKG_DEP_ORIGIN), p); | |
| bad: if (p != NULL) { | |
| bad: HASH_DEL(pkg->deps, d); | |
| bad: pkg_dep_free(d); | |
| bad: } | |
| bad: } | |
| bad: if (pkg->direct) { | |
| bad: if ((j->flags & PKG_FLAG_AUTOMATIC) == PKG_FLAG_AUTOMATIC) | |
| bad: pkg_set(pkg, PKG_AUTOMATIC, (int64_t)true); | |
| bad: else | |
| bad: pkg_set(pkg, PKG_AUTOMATIC, (int64_t)false); | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: order: | |
| bad: HASH_FREE(j->seen, pkg, pkg_free); | |
| bad: | |
| bad: /* now order the pool */ | |
| bad: while (HASH_COUNT(j->bulk) > 0) { | |
| bad: /* | |
| bad: * XXX: create specific flag that allows to install or upgrade | |
| bad: * a package even if it misses some dependencies, PKG_FORCE | |
| bad: * should not logically apply to this situation, as it is | |
| bad: * designed only for reinstalling packages, but not for | |
| bad: * installing packages with missing dependencies... | |
| bad: */ | |
| bad: ret = order_pool(j, false); | |
| bad: if (ret == EPKG_FATAL) | |
| bad: return (EPKG_FATAL); | |
| bad: else if (ret == EPKG_END) | |
| bad: break; | |
| bad: } | |
| bad: | |
| bad: j->solved = true; | |
| bad: | |
| bad: return (EPKG_OK); | |
| bad: } | |
| (ONCE) CPP-MACRO: found foreach: LL_FOREACH_SAFE | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| bulk: present in 10 parsing errors | |
| example: | |
| /* remove everything seen from deps */ | |
| HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| d = NULL; | |
| j: present in 10 parsing errors | |
| example: | |
| /* remove everything seen from deps */ | |
| HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| d = NULL; | |
| HASH_ITER: present in 8 parsing errors | |
| example: | |
| /* remove everything seen from deps */ | |
| HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| d = NULL; | |
| hh: present in 8 parsing errors | |
| example: | |
| /* remove everything seen from deps */ | |
| HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| d = NULL; | |
| pkg: present in 7 parsing errors | |
| example: | |
| /* remove everything seen from deps */ | |
| HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| d = NULL; | |
| tmp: present in 7 parsing errors | |
| example: | |
| /* remove everything seen from deps */ | |
| HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| d = NULL; | |
| HASH_COUNT: present in 2 parsing errors | |
| example: | |
| nb = HASH_COUNT(j->bulk); | |
| HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| pkg_get(pkg, PKG_ORIGIN, &origin); | |
| d: present in 2 parsing errors | |
| example: | |
| struct pkg_dep *d; | |
| HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| HASH_FIND_STR(pkg->deps, origin, d); | |
| nb: present in 2 parsing errors | |
| example: | |
| nb = HASH_COUNT(j->bulk); | |
| HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| pkg_get(pkg, PKG_ORIGIN, &origin); | |
| pkg_dep: present in 2 parsing errors | |
| example: | |
| struct pkg_dep *d; | |
| HASH_ITER(hh, j->bulk, pkg, tmp) { | |
| HASH_FIND_STR(pkg->deps, origin, d); | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0% | |
| nb good = 982, nb passed = 0 =========> 0.000000% passed | |
| nb good = 982, nb bad = 386 =========> 71.783626% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_manifest.c | |
| (ONCE) CPP-MACRO: found string-macro PRId64 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) UT_hash_handle on line 122 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_script on line 372 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 548 | |
| (ONCE) CPP-TYPEDEF: promoting:(21) SHA256_CTX on line 1069 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 1131, nb passed = 0 =========> 0.000000% passed | |
| nb good = 1131, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_old.c | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 351, nb passed = 0 =========> 0.000000% passed | |
| nb good = 351, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_ports.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-TYPEDEF: promoting:(2) UT_hash_handle on line 53 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 71 | |
| (ONCE) CPP-TYPEDEF: promoting:(15) StringList on line 76 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) va_list on line 136 | |
| (ONCE) CPP-MACRO: found foreach: LL_FOREACH | |
| passed:__unused | |
| passed:__unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 1023, nb passed = 2 =========> 0.195503% passed | |
| nb good = 1023, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_printf.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 163 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) va_list on line 2787 | |
| passed:__unused | |
| passed:__unused | |
| passed:__unused | |
| passed:__unused | |
| passed:restrict | |
| passed:restrict | |
| passed:restrict restrict | |
| passed:restrict restrict | |
| passed:restrict | |
| passed:restrict | |
| passed:restrict restrict | |
| passed:restrict restrict | |
| passed:restrict | |
| passed:restrict | |
| passed:restrict restrict | |
| passed:restrict restrict | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 3099, nb passed = 16 =========> 0.516296% passed | |
| nb good = 3099, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_repo.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 158 | |
| (ONCE) SEMANTIC:parameter name omitted, but I continue | |
| (ONCE) CPP-TYPEDEF: promoting:(21) FTS on line 161 | |
| (ONCE) CPP-MACRO: found foreach: LL_FOREACH_SAFE | |
| (ONCE) CPP-TYPEDEF: promoting:(21) FTSENT on line 344 | |
| (ONCE) CPP-TYPEDEF: promoting:(14) pem_password_cb on line 586 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 672, nb passed = 0 =========> 0.000000% passed | |
| nb good = 672, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_status.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 41 | |
| (ONCE) CPP-TYPEDEF: promoting:(21) sqlite3 on line 50 | |
| (ONCE) CPP-TYPEDEF: promoting:(21) sqlite3_stmt on line 51 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 121, nb passed = 0 =========> 0.000000% passed | |
| nb good = 121, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkg_version.c | |
| passed:restrict | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 357, nb passed = 1 =========> 0.280112% passed | |
| nb good = 357, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkgdb.c | |
| (ONCE) CPP-MACRO: found known macro = __unused | |
| (ONCE) CPP-MACRO: found string-macro PRId64 | |
| (ONCE) CPP-TYPEDEF: promoting:(5) sqlite3_context on line 78 | |
| (ONCE) CPP-TYPEDEF: promoting:(5) sqlite3_value on line 78 | |
| (ONCE) CPP-TYPEDEF: promoting:(14) sqlite3_stmt on line 81 | |
| (ONCE) CPP-TYPEDEF: promoting:(5) sqlite3 on line 82 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 83 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_attr on line 99 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) sql_prstmt on line 2239 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) va_list on line 2448 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkgdb_field on line 3457 | |
| passed:__unused | |
| passed:__unused | |
| passed:__unused | |
| passed:__unused | |
| passed:__unused | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 4089, nb passed = 5 =========> 0.122279% passed | |
| nb good = 4089, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/pkgdb_repo.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) sql_prstmt on line 87 | |
| (ONCE) CPP-TYPEDEF: promoting:(14) sqlite3_context on line 188 | |
| (ONCE) CPP-TYPEDEF: promoting:(14) sqlite3_value on line 188 | |
| (ONCE) CPP-TYPEDEF: promoting:(21) sqlite3 on line 191 | |
| (ONCE) CPP-TYPEDEF: promoting:(23) sqlite3_stmt on line 216 | |
| PB MAYBE: dangerous typedef inference, maybe not a typedef: sqlite3_stmt | |
| (ONCE) CPP-TYPEDEF: promoting:(2) va_list on line 264 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 314 | |
| TYPEDEF CONFLICT:int64_t | |
| transforming some ident in typedef | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 914, nb passed = 0 =========> 0.000000% passed | |
| nb good = 914, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/plugins.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_plugin_callback on line 52 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) UT_hash_handle on line 53 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 59 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_plugin_key on line 155 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 594, nb passed = 0 =========> 0.000000% passed | |
| nb good = 594, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/rcscripts.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_rc_attr on line 45 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 164, nb passed = 0 =========> 0.000000% passed | |
| nb good = 164, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/rsa.c | |
| (ONCE) CPP-TYPEDEF: promoting:(13) RSA on line 60 | |
| (ONCE) CPP-TYPEDEF: promoting:(23) BIO on line 87 | |
| PB MAYBE: dangerous typedef inference, maybe not a typedef: BIO | |
| (ONCE) CPP-TYPEDEF: promoting:(14) pem_password_cb on line 208 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 235, nb passed = 0 =========> 0.000000% passed | |
| nb good = 235, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/scripts.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) pkg_script on line 46 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 58 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 195, nb passed = 0 =========> 0.000000% passed | |
| nb good = 195, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/ssh.c | |
| (ONCE) CPP-MACRO: found string-macro PKGVERSION | |
| (ONCE) CPP-MACRO: found string-macro PRIdMAX | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 145, nb passed = 0 =========> 0.000000% passed | |
| nb good = 145, nb bad = 0 =========> 100.000000% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/update.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) UT_hash_handle on line 57 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 58 | |
| ERROR-RECOV: found sync '}' at line 413 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 413 | |
| parse error | |
| = File "libpkg/update.c", line 359, column 29, charpos = 9233 | |
| around = '{', whole content = HASH_ITER(hh, sc, s, stmp) { | |
| badcount: 191 | |
| bad: } | |
| bad: | |
| bad: static int | |
| bad: repo_archive_extract_file(int fd, const char *file, const char *dest, struct pkg_repo *repo, int dest_fd) | |
| bad: { | |
| bad: struct archive *a = NULL; | |
| bad: struct archive_entry *ae = NULL; | |
| bad: struct sig_cert *sc = NULL; | |
| bad: struct sig_cert *s = NULL, *stmp = NULL; | |
| bad: struct fingerprint *trusted = NULL; | |
| bad: struct fingerprint *revoked = NULL; | |
| bad: struct fingerprint *f = NULL; | |
| bad: unsigned char *sig = NULL; | |
| bad: int siglen = 0, ret, rc = EPKG_OK; | |
| bad: char key[MAXPATHLEN], path[MAXPATHLEN]; | |
| bad: char hash[SHA256_DIGEST_LENGTH * 2 + 1]; | |
| bad: int nbgood = 0; | |
| bad: | |
| bad: pkg_debug(1, "PkgRepo: extracting repo %", pkg_repo_name(repo)); | |
| bad: | |
| bad: a = archive_read_new(); | |
| bad: archive_read_support_filter_all(a); | |
| bad: archive_read_support_format_tar(a); | |
| bad: | |
| bad: /* Seek to the begin of file */ | |
| bad: (void)lseek(fd, 0, SEEK_SET); | |
| bad: archive_read_open_fd(a, fd, 4096); | |
| bad: | |
| bad: while (archive_read_next_header(a, &ae) == ARCHIVE_OK) { | |
| bad: if (strcmp(archive_entry_pathname(ae), file) == 0) { | |
| bad: if (dest_fd == -1) { | |
| bad: archive_entry_set_pathname(ae, dest); | |
| bad: /* | |
| bad: * The repo should be owned by root and not writable | |
| bad: */ | |
| bad: archive_entry_set_uid(ae, 0); | |
| bad: archive_entry_set_gid(ae, 0); | |
| bad: archive_entry_set_perm(ae, 0644); | |
| bad: | |
| bad: if (archive_read_extract(a, ae, EXTRACT_ARCHIVE_FLAGS) != 0) { | |
| bad: pkg_emit_errno("archive_read_extract", "extract error"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: } else { | |
| bad: if (archive_read_data_into_fd(a, dest_fd) != 0) { | |
| bad: pkg_emit_errno("archive_read_extract", "extract error"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: (void)lseek(dest_fd, 0, SEEK_SET); | |
| bad: } | |
| bad: } | |
| bad: if (pkg_repo_signature_type(repo) == SIG_PUBKEY && | |
| bad: strcmp(archive_entry_pathname(ae), "signature") == 0) { | |
| bad: siglen = archive_entry_size(ae); | |
| bad: sig = malloc(siglen); | |
| bad: archive_read_data(a, sig, siglen); | |
| bad: } | |
| bad: | |
| bad: if (pkg_repo_signature_type(repo) == SIG_FINGERPRINT) { | |
| bad: if (has_ext(archive_entry_pathname(ae), ".sig")) { | |
| bad: snprintf(key, MAXPATHLEN, "%.*s", | |
| bad: (int) strlen(archive_entry_pathname(ae)) - 4, | |
| bad: archive_entry_pathname(ae)); | |
| bad: HASH_FIND_STR(sc, key, s); | |
| bad: if (s == NULL) { | |
| bad: s = calloc(1, sizeof(struct sig_cert)); | |
| bad: strlcpy(s->name, key, MAXPATHLEN); | |
| bad: HASH_ADD_STR(sc, name, s); | |
| bad: } | |
| bad: s->siglen = archive_entry_size(ae); | |
| bad: s->sig = malloc(s->siglen); | |
| bad: archive_read_data(a, s->sig, s->siglen); | |
| bad: } | |
| bad: if (has_ext(archive_entry_pathname(ae), ".pub")) { | |
| bad: snprintf(key, MAXPATHLEN, "%.*s", | |
| bad: (int) strlen(archive_entry_pathname(ae)) - 4, | |
| bad: archive_entry_pathname(ae)); | |
| bad: HASH_FIND_STR(sc, key, s); | |
| bad: if (s == NULL) { | |
| bad: s = calloc(1, sizeof(struct sig_cert)); | |
| bad: strlcpy(s->name, key, MAXPATHLEN); | |
| bad: HASH_ADD_STR(sc, name, s); | |
| bad: } | |
| bad: s->certlen = archive_entry_size(ae); | |
| bad: s->cert = malloc(s->certlen); | |
| bad: archive_read_data(a, s->cert, s->certlen); | |
| bad: } | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: if (pkg_repo_signature_type(repo) == SIG_PUBKEY) { | |
| bad: if (sig == NULL) { | |
| bad: pkg_emit_error("No signature found in the repository. " | |
| bad: "Can not validate against %s key.", pkg_repo_key(repo)); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: ret = rsa_verify(dest, pkg_repo_key(repo), | |
| bad: sig, siglen - 1, dest_fd); | |
| bad: if (ret != EPKG_OK) { | |
| bad: pkg_emit_error("Invalid signature, " | |
| bad: "removing repository."); | |
| bad: free(sig); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: free(sig); | |
| bad: } else if (pkg_repo_signature_type(repo) == SIG_FINGERPRINT) { | |
| bad: if (HASH_COUNT(sc) == 0) { | |
| bad: pkg_emit_error("No signature found"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: | |
| bad: /* load fingerprints */ | |
| bad: snprintf(path, MAXPATHLEN, "%s/trusted", pkg_repo_fingerprints(repo)); | |
| bad: if ((load_fingerprints(path, &trusted)) != EPKG_OK) { | |
| bad: pkg_emit_error("Error loading trusted certificates"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: | |
| bad: if (HASH_COUNT(trusted) == 0) { | |
| bad: pkg_emit_error("No trusted certificates"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: | |
| bad: snprintf(path, MAXPATHLEN, "%s/revoked", pkg_repo_fingerprints(repo)); | |
| bad: if ((load_fingerprints(path, &revoked)) != EPKG_OK) { | |
| bad: pkg_emit_error("Error loading revoked certificates"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: | |
| BAD:!!!!! HASH_ITER(hh, sc, s, stmp) { | |
| bad: if (s->sig == NULL || s->cert == NULL) { | |
| bad: pkg_emit_error("Number of signatures and certificates " | |
| bad: "mismatch"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: s->trusted = false; | |
| bad: sha256_buf(s->cert, s->certlen, hash); | |
| bad: HASH_FIND_STR(revoked, hash, f); | |
| bad: if (f != NULL) { | |
| bad: pkg_emit_error("At least one of the " | |
| bad: " certificates has been revoked"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: | |
| bad: HASH_FIND_STR(trusted, hash, f); | |
| bad: if (f != NULL) { | |
| bad: nbgood++; | |
| bad: s->trusted = true; | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: if (nbgood == 0) { | |
| bad: pkg_emit_error("No trusted certificate found"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: | |
| bad: nbgood = 0; | |
| bad: | |
| bad: HASH_ITER(hh, sc, s, stmp) { | |
| bad: ret = rsa_verify_cert(dest, s->cert, s->certlen, s->sig, s->siglen, dest_fd); | |
| bad: if (ret == EPKG_OK && s->trusted) | |
| bad: nbgood++; | |
| bad: } | |
| bad: | |
| bad: if (nbgood == 0) { | |
| bad: pkg_emit_error("No trusted certificate has been used " | |
| bad: "to sign the repository"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: cleanup: | |
| bad: if (rc != EPKG_OK && dest != NULL) | |
| bad: unlink(dest); | |
| bad: | |
| bad: if (a != NULL) | |
| bad: archive_read_free(a); | |
| bad: | |
| bad: return rc; | |
| bad: } | |
| (ONCE) CPP-TYPEDEF: promoting:(14) sqlite3 on line 468 | |
| (ONCE) CPP-TYPEDEF: promoting:(23) sqlite3_stmt on line 470 | |
| PB MAYBE: dangerous typedef inference, maybe not a typedef: sqlite3_stmt | |
| ERROR-RECOV: found sync '}' at line 760 | |
| parsing pass2: try again | |
| ERROR-RECOV: found sync '}' at line 760 | |
| parse error | |
| = File "libpkg/update.c", line 701, column 37, charpos = 17289 | |
| around = '{', whole content = HASH_ITER(hh, ldel, item, tmp_item) { | |
| badcount: 185 | |
| bad: } | |
| bad: | |
| bad: static int | |
| bad: pkg_update_incremental(const char *name, struct pkg_repo *repo, time_t *mtime) | |
| bad: { | |
| bad: FILE *fmanifest = NULL, *fdigests = NULL; | |
| bad: sqlite3 *sqlite = NULL; | |
| bad: struct pkg *pkg = NULL; | |
| bad: int rc = EPKG_FATAL; | |
| bad: const char *origin, *digest, *offset, *length; | |
| bad: struct pkgdb_it *it = NULL; | |
| bad: char *linebuf = NULL, *p; | |
| bad: int updated = 0, removed = 0, added = 0, processed = 0; | |
| bad: long num_offset, num_length; | |
| bad: time_t local_t = *mtime; | |
| bad: struct pkg_increment_task_item *ldel = NULL, *ladd = NULL, | |
| bad: *item, *tmp_item; | |
| bad: struct pkg_manifest_key *keys = NULL; | |
| bad: size_t linecap = 0; | |
| bad: ssize_t linelen; | |
| bad: char *map = MAP_FAILED; | |
| bad: size_t len = 0; | |
| bad: | |
| bad: pkg_debug(1, "Pkgrepo, begin incremental update of '%s'", name); | |
| bad: if ((rc = pkgdb_repo_open(name, false, &sqlite)) != EPKG_OK) { | |
| bad: return (EPKG_FATAL); | |
| bad: } | |
| bad: | |
| bad: if ((rc = pkgdb_repo_init(sqlite)) != EPKG_OK) { | |
| bad: goto cleanup; | |
| bad: } | |
| bad: | |
| bad: if ((rc = pkg_register_repo(repo, sqlite)) != EPKG_OK) | |
| bad: goto cleanup; | |
| bad: | |
| bad: it = pkgdb_repo_origins(sqlite); | |
| bad: if (it == NULL) { | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: | |
| bad: while (pkgdb_it_next(it, &pkg, PKG_LOAD_BASIC) == EPKG_OK) { | |
| bad: pkg_get(pkg, PKG_ORIGIN, &origin, PKG_DIGEST, &digest); | |
| bad: pkg_update_increment_item_new(&ldel, origin, digest, 4, 0); | |
| bad: } | |
| bad: | |
| bad: fdigests = repo_fetch_remote_extract_tmp(repo, | |
| bad: repo_digests_archive, "txz", &local_t, | |
| bad: &rc, repo_digests_file); | |
| bad: if (fdigests == NULL) | |
| bad: goto cleanup; | |
| bad: local_t = *mtime; | |
| bad: fmanifest = repo_fetch_remote_extract_tmp(repo, | |
| bad: repo_packagesite_archive, "txz", &local_t, | |
| bad: &rc, repo_packagesite_file); | |
| bad: if (fmanifest == NULL) | |
| bad: goto cleanup; | |
| bad: *mtime = local_t; | |
| bad: fseek(fmanifest, 0, SEEK_END); | |
| bad: len = ftell(fmanifest); | |
| bad: | |
| bad: pkg_debug(1, "Pkgrepo, reading new packagesite.yaml for '%s'", name); | |
| bad: /* load the while digests */ | |
| bad: while ((linelen = getline(&linebuf, &linecap, fdigests)) > 0) { | |
| bad: p = linebuf; | |
| bad: origin = strsep(&p, ":"); | |
| bad: digest = strsep(&p, ":"); | |
| bad: offset = strsep(&p, ":"); | |
| bad: /* files offset */ | |
| bad: strsep(&p, ":"); | |
| bad: length = strsep(&p, ":"); | |
| bad: | |
| bad: if (origin == NULL || digest == NULL || | |
| bad: offset == NULL) { | |
| bad: pkg_emit_error("invalid digest file format"); | |
| bad: assert(0); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: errno = 0; | |
| bad: num_offset = (long)strtoul(offset, NULL, 10); | |
| bad: if (errno != 0) { | |
| bad: pkg_emit_errno("strtoul", "digest format error"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: if (length != NULL) { | |
| bad: errno = 0; | |
| bad: num_length = (long)strtoul(length, NULL, 10); | |
| bad: if (errno != 0) { | |
| bad: pkg_emit_errno("strtoul", "digest format error"); | |
| bad: rc = EPKG_FATAL; | |
| bad: goto cleanup; | |
| bad: } | |
| bad: } | |
| bad: else { | |
| bad: num_length = 0; | |
| bad: } | |
| bad: processed++; | |
| bad: HASH_FIND_STR(ldel, origin, item); | |
| bad: if (item == NULL) { | |
| bad: added++; | |
| bad: pkg_update_increment_item_new(&ladd, origin, digest, num_offset, num_length); | |
| bad: } else { | |
| bad: if (strcmp(digest, item->digest) == 0) { | |
| bad: free(item->origin); | |
| bad: free(item->digest); | |
| bad: HASH_DEL(ldel, item); | |
| bad: free(item); | |
| bad: item = NULL; | |
| bad: } else { | |
| bad: free(item->origin); | |
| bad: free(item->digest); | |
| bad: HASH_DEL(ldel, item); | |
| bad: free(item); | |
| bad: item = NULL; | |
| bad: pkg_update_increment_item_new(&ladd, origin, digest, num_offset, num_length); | |
| bad: updated++; | |
| bad: } | |
| bad: } | |
| bad: } | |
| bad: | |
| bad: rc = EPKG_OK; | |
| bad: | |
| bad: pkg_debug(1, "Pkgrepo, removing old entries for '%s'", name); | |
| bad: removed = HASH_COUNT(ldel); | |
| BAD:!!!!! HASH_ITER(hh, ldel, item, tmp_item) { | |
| bad: if (rc == EPKG_OK) { | |
| bad: rc = pkgdb_repo_remove_package(item->origin); | |
| bad: } | |
| bad: free(item->origin); | |
| bad: free(item->digest); | |
| bad: HASH_DEL(ldel, item); | |
| bad: free(item); | |
| bad: } | |
| bad: | |
| bad: pkg_debug(1, "Pkgrepo, pushing new entries for '%s'", name); | |
| bad: pkg = NULL; | |
| bad: | |
| bad: if (len > 0 && len < SSIZE_MAX) { | |
| bad: map = mmap(NULL, len, PROT_READ, MAP_SHARED, fileno(fmanifest), 0); | |
| bad: fclose(fmanifest); | |
| bad: } else { | |
| bad: if (len == 0) | |
| bad: pkg_emit_error("Empty catalog"); | |
| bad: else | |
| bad: pkg_emit_error("Catalog too large"); | |
| bad: return (EPKG_FATAL); | |
| bad: } | |
| bad: | |
| bad: HASH_ITER(hh, ladd, item, tmp_item) { | |
| bad: if (rc == EPKG_OK) { | |
| bad: if (item->length != 0) { | |
| bad: rc = pkg_add_from_manifest(map + item->offset, item->origin, | |
| bad: item->length, item->digest, | |
| bad: sqlite, &keys, &pkg); | |
| bad: } | |
| bad: else { | |
| bad: rc = pkg_add_from_manifest(map + item->offset, item->origin, | |
| bad: len - item->offset, item->digest, sqlite, &keys, &pkg); | |
| bad: } | |
| bad: } | |
| bad: free(item->origin); | |
| bad: free(item->digest); | |
| bad: HASH_DEL(ladd, item); | |
| bad: free(item); | |
| bad: } | |
| bad: pkg_manifest_keys_free(keys); | |
| bad: pkg_emit_incremental_update(updated, removed, added, processed); | |
| bad: | |
| bad: cleanup: | |
| bad: if (pkg != NULL) | |
| bad: pkg_free(pkg); | |
| bad: if (it != NULL) | |
| bad: pkgdb_it_free(it); | |
| bad: if (map == MAP_FAILED && fmanifest) | |
| bad: fclose(fmanifest); | |
| bad: if (fdigests) | |
| bad: fclose(fdigests); | |
| bad: if (map != MAP_FAILED) | |
| bad: munmap(map, len); | |
| bad: | |
| bad: pkgdb_repo_close(sqlite, rc == EPKG_OK); | |
| bad: | |
| bad: return (rc); | |
| bad: } | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| HASH_ITER: present in 2 parsing errors | |
| example: | |
| pkg_debug(1, "Pkgrepo, removing old entries for '%s'", name); | |
| removed = HASH_COUNT(ldel); | |
| HASH_ITER(hh, ldel, item, tmp_item) { | |
| if (rc == EPKG_OK) { | |
| hh: present in 2 parsing errors | |
| example: | |
| pkg_debug(1, "Pkgrepo, removing old entries for '%s'", name); | |
| removed = HASH_COUNT(ldel); | |
| HASH_ITER(hh, ldel, item, tmp_item) { | |
| if (rc == EPKG_OK) { | |
| ldel: present in 2 parsing errors | |
| example: | |
| pkg_debug(1, "Pkgrepo, removing old entries for '%s'", name); | |
| removed = HASH_COUNT(ldel); | |
| HASH_ITER(hh, ldel, item, tmp_item) { | |
| if (rc == EPKG_OK) { | |
| HASH_COUNT: present in 1 parsing errors | |
| example: | |
| pkg_debug(1, "Pkgrepo, removing old entries for '%s'", name); | |
| removed = HASH_COUNT(ldel); | |
| HASH_ITER(hh, ldel, item, tmp_item) { | |
| if (rc == EPKG_OK) { | |
| item: present in 1 parsing errors | |
| example: | |
| pkg_debug(1, "Pkgrepo, removing old entries for '%s'", name); | |
| removed = HASH_COUNT(ldel); | |
| HASH_ITER(hh, ldel, item, tmp_item) { | |
| if (rc == EPKG_OK) { | |
| name: present in 1 parsing errors | |
| example: | |
| pkg_debug(1, "Pkgrepo, removing old entries for '%s'", name); | |
| removed = HASH_COUNT(ldel); | |
| HASH_ITER(hh, ldel, item, tmp_item) { | |
| if (rc == EPKG_OK) { | |
| pkg_debug: present in 1 parsing errors | |
| example: | |
| pkg_debug(1, "Pkgrepo, removing old entries for '%s'", name); | |
| removed = HASH_COUNT(ldel); | |
| HASH_ITER(hh, ldel, item, tmp_item) { | |
| if (rc == EPKG_OK) { | |
| removed: present in 1 parsing errors | |
| example: | |
| pkg_debug(1, "Pkgrepo, removing old entries for '%s'", name); | |
| removed = HASH_COUNT(ldel); | |
| HASH_ITER(hh, ldel, item, tmp_item) { | |
| if (rc == EPKG_OK) { | |
| s: present in 1 parsing errors | |
| example: | |
| } | |
| HASH_ITER(hh, sc, s, stmp) { | |
| if (s->sig == NULL || s->cert == NULL) { | |
| sc: present in 1 parsing errors | |
| example: | |
| } | |
| HASH_ITER(hh, sc, s, stmp) { | |
| if (s->sig == NULL || s->cert == NULL) { | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 0; pbs = 1; timeout = 0; =========> 0% | |
| nb good = 483, nb passed = 0 =========> 0.000000% passed | |
| nb good = 483, nb bad = 376 =========> 56.228172% good | |
| init_defs_builtins: /usr/local/share/coccinelle/standard.h | |
| PARSING: libpkg/utils.c | |
| (ONCE) CPP-TYPEDEF: promoting:(2) MD5_CTX on line 302 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) SHA256_CTX on line 370 | |
| (ONCE) CPP-TYPEDEF: promoting:(2) bool on line 449 | |
| ----------------------------------------------------------------------- | |
| maybe 10 most problematic tokens | |
| ----------------------------------------------------------------------- | |
| ----------------------------------------------------------------------- | |
| NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100% | |
| nb good = 625, nb passed = 0 =========> 0.000000% passed | |
| nb good = 625, nb bad = 0 =========> 100.000000% good |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment