diff options
author | Sam James <sam@gentoo.org> | 2024-11-17 03:40:39 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-11-17 03:49:22 +0000 |
commit | 6f5808d30720303d8c68327f406189e8071652f6 (patch) | |
tree | fadd19f4359e3758ae4706f900329f4909554629 /net-wireless | |
parent | net-wireless/airtraf: fix variable order (diff) | |
download | gentoo-6f5808d30720303d8c68327f406189e8071652f6.tar.gz gentoo-6f5808d30720303d8c68327f406189e8071652f6.tar.bz2 gentoo-6f5808d30720303d8c68327f406189e8071652f6.zip |
net-wireless/airtraf: EAPI 8, opaque ncurses + C23 + Wformat-security fixes
Closes: https://bugs.gentoo.org/932138
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-wireless')
4 files changed, 377 insertions, 0 deletions
diff --git a/net-wireless/airtraf/airtraf-1.1-r5.ebuild b/net-wireless/airtraf/airtraf-1.1-r5.ebuild new file mode 100644 index 000000000000..23df4f0c0448 --- /dev/null +++ b/net-wireless/airtraf/airtraf-1.1-r5.ebuild @@ -0,0 +1,58 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="AirTraf 802.11b Wireless traffic sniffer" +HOMEPAGE="http://www.elixar.com/" +SRC_URI="http://www.elixar.com/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" + +RDEPEND=" + net-libs/libpcap + sys-libs/ncurses:= +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${P}-sniffd.patch + "${FILESDIR}"/${P}-off-by-one.patch + "${FILESDIR}"/${P}-fprintf-format.patch + "${FILESDIR}"/${P}-fno-common.patch + "${FILESDIR}"/${P}-c23.patch + "${FILESDIR}"/${P}-ncurses-opaque.patch + "${FILESDIR}"/${P}-wformat-security.patch +) + +src_prepare() { + default + + sed -i \ + -e '/^LIBS/s|=.*|= $(shell $(PKG_CONFIG) --libs panel)|' \ + src/libncurses/Makefile || die + sed -i \ + -e 's|-lpanel -lncurses|$(shell $(PKG_CONFIG) --libs ncurses panel)|' \ + src/sniffd/Makefile || die + tc-export PKG_CONFIG +} + +src_compile() { + # parallel make (bug #297331) + emake -C src -j1 \ + CC="$(tc-getCC)" \ + CXX="$(tc-getCXX)" \ + CFLAGS="${CFLAGS}" \ + CXXFLAGS="${CXXFLAGS}" \ + LDFLAGS="${LDFLAGS}" +} + +src_install() { + dobin src/airtraf + dodoc Authors COMPATIBILITY docs/airtraf_doc.html +} diff --git a/net-wireless/airtraf/files/airtraf-1.1-c23.patch b/net-wireless/airtraf/files/airtraf-1.1-c23.patch new file mode 100644 index 000000000000..5c797aa61780 --- /dev/null +++ b/net-wireless/airtraf/files/airtraf-1.1-c23.patch @@ -0,0 +1,24 @@ +--- a/src/libncurses/deskman.c ++++ b/src/libncurses/deskman.c +@@ -123,7 +123,7 @@ void colorwin(WINDOW * win) + free(blankpad); + } + +-void coloreol() ++void coloreol(WINDOW * win) + { + char *blankpad; + int y, x; +--- a/src/libncurses/deskman.h ++++ b/src/libncurses/deskman.h +@@ -50,6 +50,6 @@ void show_paused_win(WINDOW ** win, PANEL ** panel, char * message, char *messag + void infobox(char *text, char *prompt); + void standardcolors(int color); + void refresh_screen(void); +-void show_sort_statwin(); ++void show_sort_statwin(WINDOW **statwin, PANEL **panel); + + #endif +-- +2.47.0 + diff --git a/net-wireless/airtraf/files/airtraf-1.1-ncurses-opaque.patch b/net-wireless/airtraf/files/airtraf-1.1-ncurses-opaque.patch new file mode 100644 index 000000000000..540b7b2772eb --- /dev/null +++ b/net-wireless/airtraf/files/airtraf-1.1-ncurses-opaque.patch @@ -0,0 +1,94 @@ +https://bugs.gentoo.org/932138 +--- a/src/libncurses/deskman.c ++++ b/src/libncurses/deskman.c +@@ -110,12 +110,12 @@ void colorwin(WINDOW * win) + + strcpy(blankpad, ""); + +- for (ctr = 0; ctr <= win->_maxx; ctr++) { ++ for (ctr = 0; ctr <= getmaxx(win); ctr++) { + strcat(blankpad, " "); + } + + scrollok(win, 0); +- for (ctr = 0; ctr <= win->_maxy; ctr++) { ++ for (ctr = 0; ctr <= getmaxy(win); ctr++) { + wmove(win, ctr, 0); + wprintw(win, "%s", blankpad); + } +--- a/src/sniffd/gui_channel_scan.c ++++ b/src/sniffd/gui_channel_scan.c +@@ -339,7 +339,7 @@ void make_status_window(WINDOW ** statuswin, PANEL ** statuspanel) + void fill_line_blank(WINDOW * win, int line) + { + int i; +- for (i = 0; i < win->_maxx; i++) ++ for (i = 0; i < getmaxx(win); i++) + mvwprintw(win, line, i, " "); + } + +--- a/src/sniffd/gui_tcp_analysis_scan.c ++++ b/src/sniffd/gui_tcp_analysis_scan.c +@@ -463,7 +463,7 @@ void print_tcp_nodelist_row(WINDOW *win, int row, bss_node_t *node, int id, int + void print_tcp_nodelist_results(WINDOW * win, int * selected_node, int offset) + { + int i; +- int max_view = win->_maxy - 6; ++ int max_view = getmaxy(win) - 6; + int last_item = 0; + int selected = 0; + +@@ -476,7 +476,7 @@ void print_tcp_nodelist_results(WINDOW * win, int * selected_node, int offset) + wattrset(win, STDATTR); + + if (ap->num < 2){ +- mvwprintw(win, 4, (win->_maxx - 26) /2, "No Detected Wireless Nodes!"); ++ mvwprintw(win, 4, (getmaxx(win) - 26) /2, "No Detected Wireless Nodes!"); + return; + } + +@@ -485,15 +485,15 @@ void print_tcp_nodelist_results(WINDOW * win, int * selected_node, int offset) + if (*selected_node == 0){ + *selected_node = 1; + } +- mvwprintw(win, 4, (win->_maxx - 26) /2, " "); ++ mvwprintw(win, 4, (getmaxx(win) - 26) /2, " "); + + if ((offset + max_view) < ap->num){ + last_item = offset + max_view; +- mvwprintw(win, win->_maxy - 1, 4, ">> More >>"); ++ mvwprintw(win, getmaxy(win) - 1, 4, ">> More >>"); + } + else{ + last_item = ap->num; +- mvwprintw(win, win->_maxy - 1, 4, "-- End --"); ++ mvwprintw(win, getmaxy(win) - 1, 4, "-- End --"); + } + for (i = offset; i < last_item; i++){ + if (node == NULL) break; +@@ -542,7 +542,7 @@ void scrollbreakdownwin(int direction, int select_node, int * offset) + + void scrollnodelistwin(WINDOW *win, int direction, int * select_node, int * list_pos) + { +- int max_view = win->_maxy - 6; ++ int max_view = getmaxy(win) - 6; + + bss_t * ap = get_detailed_snapshot()->bss_list_top; + +@@ -581,11 +581,11 @@ void reset_active_win(WINDOW *win, int toggle) + { + if (toggle){ + wattrset(win, ACTIVEATTR); +- mvwprintw(win, win->_maxy, win->_maxx - 10, " ACTIVE "); ++ mvwprintw(win, getmaxy(win), getmaxx(win) - 10, " ACTIVE "); + } + else{ + wattrset(win, BOXATTR); +- wmove(win, win->_maxy, win->_maxx - 10); ++ wmove(win, getmaxy(win), getmaxx(win) - 10); + whline(win, ACS_HLINE, 8); + } + } +-- +2.47.0 + diff --git a/net-wireless/airtraf/files/airtraf-1.1-wformat-security.patch b/net-wireless/airtraf/files/airtraf-1.1-wformat-security.patch new file mode 100644 index 000000000000..edd531258e66 --- /dev/null +++ b/net-wireless/airtraf/files/airtraf-1.1-wformat-security.patch @@ -0,0 +1,201 @@ +--- a/src/libncurses/deskman.c ++++ b/src/libncurses/deskman.c +@@ -136,7 +136,7 @@ void coloreol(WINDOW * win) + for (i = x; i <= COLS - 1; i++) + strcat(blankpad, " "); + +- printw(blankpad); ++ printw("%s", blankpad); + free(blankpad); + } + +@@ -284,8 +284,8 @@ void indicate(char *message) + char sp_buf[10]; + attrset(STATUSBARATTR); + sprintf(sp_buf, "%%%dc", COLS); +- mvprintw(LINES - 1, 0, sp_buf, ' '); +- mvprintw(LINES - 1, 1, message); ++ mvprintw(LINES - 1, 0, "%s%d", sp_buf, ' '); ++ mvprintw(LINES - 1, 1, "%s", message); + refresh(); + } + +@@ -336,9 +336,9 @@ void infobox(char *text, char *prompt) + colorwin(win); + box(win, ACS_VLINE, ACS_HLINE); + wattrset(win, STDATTR); +- mvwprintw(win, 1, 2, text); ++ mvwprintw(win, 1, 2, "%s", text); + wattrset(win, HIGHATTR); +- mvwprintw(win, 2, 2, prompt); ++ mvwprintw(win, 2, 2, "%s", prompt); + update_panels(); + doupdate(); + wgetch(win); +--- a/src/sniffd/gui_main.c ++++ b/src/sniffd/gui_main.c +@@ -248,8 +248,8 @@ void print_selected_ap_results(WINDOW *win, PANEL *panel, struct access_point *a + mvwprintw(win, 3, 10, " "); + mvwprintw(win, 4, 10, " "); + mvwprintw(win, 6, 13, " "); +- mvwprintw(win, 3, 10, ap->ssid); +- mvwprintw(win, 4, 10, hexdump((__u8*)&ap->bssid,6)); ++ mvwprintw(win, 3, 10, "%s", ap->ssid); ++ mvwprintw(win, 4, 10, "%s", hexdump((__u8*)&ap->bssid,6)); + mvwprintw(win, 5, 10, "%s", ap->wep_status ? "encrypted " : "opensystem"); + mvwprintw(win, 6, 13, "%02d", ap->channel); + } +@@ -305,7 +305,7 @@ void print_system_results(WINDOW *win, PANEL *panel, struct SETTINGS *mySettings + else if (mySettings->card_type == WLANNG) + mvwprintw(win, 3, 19, "Wlan-ng "); + +- mvwprintw(win, 4, 19, mySettings->interface); ++ mvwprintw(win, 4, 19, "%s", mySettings->interface); + + if (mySettings->capture_mode != CAPTURE_MODE_PLAYBACK) + mvwprintw(win, 5, 19, "Real-Time "); +@@ -327,7 +327,7 @@ void print_system_results(WINDOW *win, PANEL *panel, struct SETTINGS *mySettings + else + mvwprintw(win, 8, 19, "OFF"); + +- mvwprintw(win, 10, 12, uptime); ++ mvwprintw(win, 10, 12, "%s", uptime); + + update_panels(); + doupdate(); +@@ -373,7 +373,7 @@ void showcapturesetting(WINDOW *win, struct SETTINGS *mySettings) + { + wattrset(win, HIGHATTR); + mvwprintw(win, 1, 20, " "); +- mvwprintw(win, 1, 20, mySettings->capture_file); ++ mvwprintw(win, 1, 20, "%s", mySettings->capture_file); + mvwprintw(win, 2, 20, "%s", mySettings->capture_overwrite ? "YES" : " NO"); + mvwprintw(win, 3, 20, "%-5.1f", mySettings->capture_interval); + } +--- a/src/sniffd/gui_channel_scan.c ++++ b/src/sniffd/gui_channel_scan.c +@@ -286,8 +286,8 @@ void print_breakdown_results(WINDOW * win, int offset) + if (!strncmp(ap->ssid," ",32)) + mvwprintw(win, position+3, 11, "<cloaked>"); + else +- mvwprintw(win, position+3, 11, ap->ssid); +- mvwprintw(win, position+3, 39, hexdump((__u8*)&ap->bssid,6)); ++ mvwprintw(win, position+3, 11, "%s", ap->ssid); ++ mvwprintw(win, position+3, 39, "%s", hexdump((__u8*)&ap->bssid,6)); + mvwprintw(win, position+3, 53, "%s", ap->wep_status ? "crypt" : "open "); + mvwprintw(win, position+3, 59, "%5d", ap->mgmt_count); + mvwprintw(win, position+3, 65, "%4d", ap->ctrl_count); +@@ -351,12 +351,12 @@ void print_status_msg(WINDOW * statuswin, int *location, char * msg) + scrollstatuswin(statuswin, SCROLLUP); + wmove(statuswin, 12, 0); + fill_line_blank(statuswin, 12); +- mvwprintw(statuswin, 12, 2, msg); ++ mvwprintw(statuswin, 12, 2, "%s", msg); + } + else{ + wmove(statuswin, *location, 0); + fill_line_blank(statuswin, *location); +- mvwprintw(statuswin, *location, 2, msg); ++ mvwprintw(statuswin, *location, 2, "%s", msg); + } + *location = *location + 1; + update_panels(); +--- a/src/sniffd/gui_detailed_scan.c ++++ b/src/sniffd/gui_detailed_scan.c +@@ -131,8 +131,8 @@ void printdetails(WINDOW * win) + + wattrset(win, HIGHATTR); + if (info != NULL){ +- mvwprintw(win, 2, 10, hexdump((__u8*)&info->bssid,6)); +- mvwprintw(win, 2, 33, info->ssid); ++ mvwprintw(win, 2, 10, "%s", hexdump((__u8*)&info->bssid,6)); ++ mvwprintw(win, 2, 33, "%s", info->ssid); + mvwprintw(win, 2, 61, "%s", info->wep_status ? "encrypted " : "opensystem"); + mvwprintw(win, 2, 85, "%d", info->channel); + +--- a/src/sniffd/gui_gen_protocol_scan.c ++++ b/src/sniffd/gui_gen_protocol_scan.c +@@ -150,8 +150,8 @@ void print_proto_activity_overview_results(WINDOW * win) + + wattrset(win, HIGHATTR); + /** access point info **/ +- mvwprintw(win, 4, 10, ap->ssid); +- mvwprintw(win, 5, 10, hexdump((__u8*)&ap->bssid,6)); ++ mvwprintw(win, 4, 10, "%s", ap->ssid); ++ mvwprintw(win, 5, 10, "%s", hexdump((__u8*)&ap->bssid,6)); + mvwprintw(win, 6, 10, "%s", ap->wep_status ? "encrypted " : "opensystem"); + mvwprintw(win, 7, 13, "%02d", ap->channel); + +--- a/src/sniffd/gui_tcp_analysis_scan.c ++++ b/src/sniffd/gui_tcp_analysis_scan.c +@@ -164,8 +164,8 @@ void print_tcp_activity_overview_results(WINDOW * win, int selected, int view) + + wattrset(win, HIGHATTR); + /** access point info **/ +- mvwprintw(win, 4, 10, ap->ssid); +- mvwprintw(win, 5, 10, hexdump((__u8*)&ap->bssid,6)); ++ mvwprintw(win, 4, 10, "%s", ap->ssid); ++ mvwprintw(win, 5, 10, "%s", hexdump((__u8*)&ap->bssid,6)); + mvwprintw(win, 6, 10, "%s", ap->wep_status ? "encrypted " : "opensystem"); + mvwprintw(win, 7, 13, "%02d", ap->channel); + mvwprintw(win, 8, 18, "%3d", ap->num-1); +--- a/src/sniffd/gui_tcp_analysis_scan.c ++++ b/src/sniffd/gui_tcp_analysis_scan.c +@@ -437,7 +437,7 @@ void print_tcp_nodelist_row(WINDOW *win, int row, bss_node_t *node, int id, int + mvwprintw(win, row, 2, ">"); + wattrset(win, STDATTR); + mvwprintw(win, row, 4, "%02d", id); +- mvwprintw(win, row, 10, hexdump((__u8*)&node->mac_addr,6)); ++ mvwprintw(win, row, 10, "%s", hexdump((__u8*)&node->mac_addr,6)); + mvwprintw(win, row, 30, " "); + mvwprintw(win, row, 30, "%s", inet_ntoa(node->ip_addr)); + mvwprintw(win, row, 48, "%6d", node->tcp_connections); +@@ -447,7 +447,7 @@ void print_tcp_nodelist_row(WINDOW *win, int row, bss_node_t *node, int id, int + wattrset(win, HIGHATTR); + mvwprintw(win, row, 2, " "); + mvwprintw(win, row, 4, "%02d", id); +- mvwprintw(win, row, 10, hexdump((__u8*)&node->mac_addr,6)); ++ mvwprintw(win, row, 10, "%s", hexdump((__u8*)&node->mac_addr,6)); + mvwprintw(win, row, 30, " "); + mvwprintw(win, row, 30, "%s", inet_ntoa(node->ip_addr)); + mvwprintw(win, row, 48, "%6d", node->tcp_connections); +--- a/src/sniffd/mon_ids.c ++++ b/src/sniffd/mon_ids.c +@@ -76,9 +76,9 @@ void print_ids_statrow(WINDOW * win, node_stat_t * node, int seq_num) + int diagnosis = 0; + + mvwprintw(win, seq_num, 2, "%2d: ", seq_num); +- mvwprintw(win, seq_num, 6, hexdump((__u8*)&node->node_mac, 6)); ++ mvwprintw(win, seq_num, 6, "%s", hexdump((__u8*)&node->node_mac, 6)); + mvwprintw(win, seq_num, 18, " -> "); +- mvwprintw(win, seq_num, 22, hexdump((__u8*)&node->dest_mac, 6)); ++ mvwprintw(win, seq_num, 22, "%s", hexdump((__u8*)&node->dest_mac, 6)); + mvwprintw(win, seq_num, 25 * COLS / 80, "%6d", node->probe_request); + mvwprintw(win, seq_num, 30 * COLS / 80, "%6d", node->assoc_request); + mvwprintw(win, seq_num, 35 * COLS / 80, "%6d", node->reassoc_request); +@@ -93,10 +93,10 @@ void print_ids_statrow(WINDOW * win, node_stat_t * node, int seq_num) + node->deauth_status); + diagnosis = node->assoc_status + node->reassoc_status + node->auth_status; + if (diagnosis == 0){ +- mvwprintw(win, seq_num, 70 * COLS/ 80, " Normal "); ++ mvwprintw(win, seq_num, 70 * COLS/ 80, "%s", " Normal "); + } + else{ +- mvwprintw(win, seq_num, 70 * COLS/ 80, "Suspicious"); ++ mvwprintw(win, seq_num, 70 * COLS/ 80, "%s", "Suspicious"); + } + } + +@@ -115,10 +115,10 @@ void print_ids_details(WINDOW * win, ids_t *info, int page_num) + end_loc = MAX_STAT_ROW - 1; + } + if (end_loc < info->node_count){ +- mvwprintw(win, LINES * 0.6, 2, " >> More >> "); ++ mvwprintw(win, LINES * 0.6, 2, "%s", " >> More >> "); + } + else{ +- mvwprintw(win, LINES * 0.6, 2, " << END! >> "); ++ mvwprintw(win, LINES * 0.6, 2, "%s", " << END! >> "); + } + wattrset(win, HIGHATTR); + for (curr_loc = start_loc; curr_loc < end_loc; curr_loc++){ |