47 lines
2.5 KiB
Diff
47 lines
2.5 KiB
Diff
diff --git a/src/bin/login.rs b/src/bin/login.rs
|
|
index 6e1fda6..e0878c9 100644
|
|
--- a/src/bin/login.rs
|
|
+++ b/src/bin/login.rs
|
|
@@ -193,2 +193,7 @@ pub fn main() {
|
|
- let before_ns_fd =
|
|
- apply_login_schemes(user, &DEFAULT_SCHEMES).unwrap_or_exit(1);
|
|
+ let before_ns_fd = match apply_login_schemes(user, &DEFAULT_SCHEMES) {
|
|
+ Ok(fd) => fd,
|
|
+ Err(err) => {
|
|
+ eprintln!("login: apply_login_schemes failed: {}", err);
|
|
+ std::process::exit(1);
|
|
+ }
|
|
+ };
|
|
@@ -201,2 +206,8 @@ pub fn main() {
|
|
- drop_privileges(user).unwrap_or_exit(1);
|
|
- spawn_shell(user).unwrap_or_exit(1);
|
|
+ if let Err(err) = drop_privileges(user) {
|
|
+ eprintln!("login: drop_privileges failed: {}", err);
|
|
+ std::process::exit(1);
|
|
+ }
|
|
+ if let Err(err) = spawn_shell(user) {
|
|
+ eprintln!("login: spawn_shell failed: {}", err);
|
|
+ std::process::exit(1);
|
|
+ }
|
|
@@ -225,2 +236,7 @@ pub fn main() {
|
|
- let before_ns_fd =
|
|
- apply_login_schemes(user, &DEFAULT_SCHEMES).unwrap_or_exit(1);
|
|
+ let before_ns_fd = match apply_login_schemes(user, &DEFAULT_SCHEMES) {
|
|
+ Ok(fd) => fd,
|
|
+ Err(err) => {
|
|
+ eprintln!("login: apply_login_schemes failed: {}", err);
|
|
+ std::process::exit(1);
|
|
+ }
|
|
+ };
|
|
@@ -233,2 +249,8 @@ pub fn main() {
|
|
- drop_privileges(user).unwrap_or_exit(1);
|
|
- spawn_shell(user).unwrap_or_exit(1);
|
|
+ if let Err(err) = drop_privileges(user) {
|
|
+ eprintln!("login: drop_privileges failed: {}", err);
|
|
+ std::process::exit(1);
|
|
+ }
|
|
+ if let Err(err) = spawn_shell(user) {
|
|
+ eprintln!("login: spawn_shell failed: {}", err);
|
|
+ std::process::exit(1);
|
|
+ }
|