1 Star 0 Fork 34

李宁杰/wireshark

forked from src-openEuler/wireshark 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
wireshark-0002-Customize-permission-denied-error.patch 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
starlet_dx 提交于 2024-04-24 11:00 . Upgrade to 4.2.4
diff --git a/capture/capture_sync.c b/capture/capture_sync.c
index af08b32..2e0fcb7 100644
--- a/capture/capture_sync.c
+++ b/capture/capture_sync.c
@@ -1825,8 +1832,16 @@ sync_pipe_input_cb(GIOChannel *pipe_io, capture_session *cap_session)
if (!ws_strtoi32(buffer, NULL, &exec_errno)) {
ws_warning("Invalid errno: %s", buffer);
}
- primary_msg = ws_strdup_printf("Couldn't run dumpcap in child process: %s",
+ if (exec_errno == EPERM || exec_errno == EACCES) {
+ const char *securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root.";
+ primary_msg = ws_strdup_printf("Couldn't run dumpcap in child process: %s%s",
+ g_strerror(exec_errno), securitymsg);
+ }
+ else {
+ primary_msg = ws_strdup_printf("Couldn't run dumpcap in child process: %s",
g_strerror(exec_errno));
+ }
+
cap_session->error(cap_session, primary_msg, NULL);
/* the capture child will close the sync_pipe, nothing to do for now */
/* (an error message doesn't mean we have to stop capturing) */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/li_ning_jie/wireshark.git
[email protected]:li_ning_jie/wireshark.git
li_ning_jie
wireshark
wireshark
master

搜索帮助