mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 11:22:26 +00:00
main: Set the umask to 0077
This ensures that all created filed are only read/write for the current user. Fixes: #1240 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
c1d15de7fc
commit
3497eeff49
@ -359,6 +359,9 @@ fn start_vmm(cmd_arguments: ArgMatches) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// Ensure all created files (.e.g sockets) are only accessible by this user
|
||||||
|
let _ = unsafe { libc::umask(0o077) };
|
||||||
|
|
||||||
let pid = unsafe { libc::getpid() };
|
let pid = unsafe { libc::getpid() };
|
||||||
let uid = unsafe { libc::getuid() };
|
let uid = unsafe { libc::getuid() };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user