libreoffice-online/common/Seccomp.hpp
Ashod Nakashian 3158d4c31c wsd: always use signal-safe calls
The async-signal-safe functions to get thread-id
and thread-name, which cache the results, are
faster, cleaner, and signal-safe. No reason why
we shouldn't always use them.

Especially since it appears the logic was
inverted in Log::prefix, such that the signal
un-safe calls were made during signal-handling,
and the safe ones were called otherwise!

Instead of passing the signal-safe flag to
Log::prefix, we pass the buffer size, for
improved security.

Furthermore, reduce header dependencies
and reduce clutter.

Change-Id: I697689b2f0a290b6d8cce4babc3ac1e576141da6
2018-10-16 20:12:23 -04:00

30 lines
879 B
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SECCOMP_HPP
#define INCLUDED_SECCOMP_HPP
#include <string>
#include <vector>
namespace Seccomp {
enum Type { KIT, WSD };
/// Lock-down a process hard - @returns true on success.
bool lockdown(Type type);
};
namespace Rlimit {
/// Handles setconfig command with limit_... subcommands.
/// Returns true iff it handled the command, regardless of success/failure.
bool handleSetrlimitCommand(const std::vector<std::string>& tokens);
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */