mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-03 06:38:52 +00:00
feat: panic if envision runs as root
This commit is contained in:
parent
9c2bec1cdb
commit
d734a7edc8
1 changed files with 4 additions and 0 deletions
|
@ -11,6 +11,7 @@ use relm4::{
|
||||||
gtk::{self, gdk, gio, glib, prelude::*},
|
gtk::{self, gdk, gio, glib, prelude::*},
|
||||||
MessageBroker, RelmApp,
|
MessageBroker, RelmApp,
|
||||||
};
|
};
|
||||||
|
use std::env;
|
||||||
use steam_linux_runtime_injector::restore_runtime_entrypoint;
|
use steam_linux_runtime_injector::restore_runtime_entrypoint;
|
||||||
use ui::app::{App, AppInit};
|
use ui::app::{App, AppInit};
|
||||||
|
|
||||||
|
@ -69,6 +70,9 @@ fn restore_steam_xr_files() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
|
if env::var("USER").unwrap_or_else(|_| env::var("USERNAME").unwrap_or_default()) == "root" {
|
||||||
|
panic!("{APP_NAME} cannot run as root");
|
||||||
|
}
|
||||||
restore_steam_xr_files();
|
restore_steam_xr_files();
|
||||||
|
|
||||||
// Prepare i18n
|
// Prepare i18n
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue