1 Star 0 Fork 2

trackers-love/test-git

forked from wanglujun/test-git 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
limits.c 721 Bytes
一键复制 编辑 原始数据 按行查看 历史
wanglujun 提交于 2024-05-11 17:34 . add three file
/*
* Disable core dumps to avoid dropping a core with user password in it.
* Not all operating systems disable core dumps for setuid processes.
*/
void
disable_coredump(void)
{
struct rlimit rl = { 0, 0 };
debug_decl(disable_coredump, SUDO_DEBUG_UTIL)
if (getrlimit(RLIMIT_CORE, &corelimit) == -1)
sudo_warn("getrlimit(RLIMIT_CORE)");
if (setrlimit(RLIMIT_CORE, &rl) == -1)
sudo_warn("setrlimit(RLIMIT_CORE)");
#ifdef __linux__
/* On Linux, also set PR_SET_DUMPABLE to zero (reset by execve). */
if ((dumpflag = prctl(PR_GET_DUMPABLE, 0, 0, 0, 0)) == -1)
dumpflag = 0;
(void) prctl(PR_SET_DUMPABLE, 0, 0, 0, 0);
#endif /* __linux__ */
coredump_disabled = true;
debug_return;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/trackers-love/test-git.git
[email protected]:trackers-love/test-git.git
trackers-love
test-git
test-git
master

搜索帮助