logYesNo(nsjconf->disable_no_new_privs), nsjconf->max_cpus);
for (const auto& p : nsjconf->mountpts) {
- LOG_I("%s: %s", p.isSymlink ? "Symlink" : "Mount point", mnt::describeMountPt(p));
+ LOG_I("%s: %s", p.isSymlink ? "Symlink" : "Mount point",
+ mnt::describeMountPt(p).c_str());
}
for (const auto& uid : nsjconf->uids) {
LOG_I("Uid map: inside_uid:%lu outside_uid:%lu count:%zu newuidmap:%s",
char dst[PATH_MAX];
snprintf(dst, sizeof(dst), "%s/%s", newroot, mpt->dst.c_str());
- LOG_D("Mounting '%s'", describeMountPt(*mpt));
+ LOG_D("Mounting '%s'", describeMountPt(*mpt).c_str());
char srcpath[PATH_MAX];
if (!mpt->src.empty()) {
"mount('%s') src:'%s' dst:'%s' failed. "
"Try fixing this problem by applying 'chmod o+x' to the '%s' "
"directory and its ancestors",
- describeMountPt(*mpt), srcpath, dst, srcpath);
+ describeMountPt(*mpt).c_str(), srcpath, dst, srcpath);
} else {
- PLOG_W("mount('%s') src:'%s' dst:'%s' failed", describeMountPt(*mpt),
- srcpath, dst);
+ PLOG_W("mount('%s') src:'%s' dst:'%s' failed",
+ describeMountPt(*mpt).c_str(), srcpath, dst);
if (strcmp(mpt->fs_type.c_str(), "proc") == 0) {
PLOG_W(
"procfs can only be mounted if the original /proc doesn't have "
return true;
}
-const char* describeMountPt(const mount_t& mpt) {
- static __thread char mount_pt_descr[4096];
+const std::string describeMountPt(const mount_t& mpt) {
+ char mount_pt_descr[256];
snprintf(mount_pt_descr, sizeof(mount_pt_descr),
"src:'%s' dst:'%s' type:'%s' flags:%s options:'%s' isDir:%s", mpt.src.c_str(),
bool addMountPtTail(nsjconf_t* nsjconf, const char* src, const char* dst, const char* fstype,
const char* options, uintptr_t flags, isDir_t isDir, bool mandatory, const char* src_env,
const char* dst_env, const char* src_content, size_t src_content_len, bool is_symlink);
-const char* describeMountPt(const mount_t& mpt);
+const std::string describeMountPt(const mount_t& mpt);
} // namespace mnt
}
}
if (cnt >= nsjconf->max_conns_per_ip) {
- LOG_W("Rejecting connection from '%s', max_conns_per_ip limit reached: %u", connstr.c_str(),
- nsjconf->max_conns_per_ip);
+ LOG_W("Rejecting connection from '%s', max_conns_per_ip limit reached: %u",
+ connstr.c_str(), nsjconf->max_conns_per_ip);
return false;
}
if (WIFSIGNALED(status)) {
LOG_I(
"PID: %d (%s) terminated with signal: %s (%d), (PIDs left: %d)",
- si.si_pid, remote_txt.c_str(), util::sigName(WTERMSIG(status)).c_str(),
- WTERMSIG(status), countProc(nsjconf) - 1);
+ si.si_pid, remote_txt.c_str(),
+ util::sigName(WTERMSIG(status)).c_str(), WTERMSIG(status),
+ countProc(nsjconf) - 1);
removeProc(nsjconf, si.si_pid);
rv = 100 + WTERMSIG(status);
}