diff --git a/src/action/base/create_user.rs b/src/action/base/create_user.rs index 3d63984b6..4c9edb123 100644 --- a/src/action/base/create_user.rs +++ b/src/action/base/create_user.rs @@ -324,6 +324,14 @@ async fn create_user_macos(name: &str, uid: u32, gid: u32) -> Result<(), ActionE "/sbin/nologin", ]) .await?; + execute_dscl_retry_on_specific_errors(&[ + ".", + "-create", + &format!("/Users/{name}"), + "RealName", + name, + ]) + .await?; execute_dscl_retry_on_specific_errors(&[ ".", "-create", @@ -343,15 +351,6 @@ async fn create_user_macos(name: &str, uid: u32, gid: u32) -> Result<(), ActionE Err(e) })?; - execute_dscl_retry_on_specific_errors(&[ - ".", - "-create", - &format!("/Users/{name}"), - "RealName", - name, - ]) - .await?; - Ok(()) }