Index: ognibuild/Cargo.toml
===================================================================
--- ognibuild.orig/Cargo.toml
+++ ognibuild/Cargo.toml
@@ -288,7 +288,7 @@ optional = true
 version = "2.5.7"
 
 [dependencies.whoami]
-version = "2.1"
+version = "1.5"
 default-features = false
 
 [dependencies.xmltree]
Index: ognibuild/src/session/plain.rs
===================================================================
--- ognibuild.orig/src/session/plain.rs
+++ ognibuild/src/session/plain.rs
@@ -26,16 +26,9 @@ impl PlainSession {
 
     fn prepend_user<'a>(&'a self, user: Option<&'a str>, mut args: Vec<&'a str>) -> Vec<&'a str> {
         if let Some(user) = user {
-            match whoami::username() {
-                Ok(current_user) => {
-                    if user != current_user {
-                        args = vec!["sudo", "-u", user].into_iter().chain(args).collect();
-                    }
-                }
-                Err(e) => {
-                    log::warn!("Failed to get current username: {}, assuming user switch is needed", e);
-                    args = vec!["sudo", "-u", user].into_iter().chain(args).collect();
-                }
+            let current_user = whoami::username();
+            if user != current_user {
+                args = vec!["sudo", "-u", user].into_iter().chain(args).collect();
             }
         }
         args
@@ -242,7 +235,7 @@ mod tests {
     fn test_prepend_user() {
         let session = PlainSession::new();
         let args = vec!["ls"];
-        let current_user = whoami::username().expect("Failed to get current username");
+        let current_user = whoami::username();
         let args = session.prepend_user(Some("root"), args);
         // If we're already root, don't prepend sudo
         if current_user == "root" {
@@ -264,7 +257,7 @@ mod tests {
     fn test_prepend_user_current_user() {
         let session = PlainSession::new();
         let args = vec!["ls"];
-        let username = whoami::username().expect("Failed to get current username");
+        let username = whoami::username();
         let args = session.prepend_user(Some(username.as_str()), args);
         assert_eq!(args, vec!["ls"]);
     }
Index: ognibuild/src/session/unshare.rs
===================================================================
--- ognibuild.orig/src/session/unshare.rs
+++ ognibuild/src/session/unshare.rs
@@ -186,12 +186,7 @@ impl UnshareSession {
     /// Verify that the current user has an account in the session
     pub fn ensure_current_user(&self) -> Result<(), crate::session::Error> {
         // Ensure that the current user has an entry in /etc/passwd
-        let user = whoami::username().map_err(|e| {
-            crate::session::Error::SetupFailure(
-                "Failed to get current username".to_string(),
-                e.to_string(),
-            )
-        })?;
+        let user = whoami::username();
         let uid = nix::unistd::getuid().to_string();
         let gid = nix::unistd::getgid().to_string();
 
