@@ -396,9 +396,6 @@ fn child_process_main( |
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | | - // Execute the session command |
| 400 | | - eprintln!("[SESSION] Executing: {} {:?}", cmd_path, cmd_args); |
| 401 | | - |
| 402 | 399 | // execve replaces the process image |
| 403 | 400 | match nix::unistd::execve(&cmd_cstr, &argv, env_vars) { |
| 404 | 401 | Ok(_) => unreachable!(), // execve doesn't return on success |
@@ -419,31 +416,24 @@ fn pam_authenticate_and_open_session( |
| 419 | 416 | ) -> Result<()> { |
| 420 | 417 | // Set environment variables BEFORE creating PAM client |
| 421 | 418 | // pam_systemd reads these to determine session type and VT |
| 422 | | - eprintln!("[PAM] Setting environment for pam_systemd: type={}, vt={}", session_type, vt); |
| 423 | 419 | std::env::set_var("XDG_SESSION_TYPE", session_type); |
| 424 | 420 | std::env::set_var("XDG_VTNR", vt.to_string()); |
| 425 | 421 | std::env::set_var("XDG_SEAT", "seat0"); |
| 426 | 422 | std::env::set_var("XDG_SESSION_CLASS", "user"); |
| 427 | 423 | |
| 428 | | - eprintln!("[PAM] Creating PAM client for user {}", username); |
| 429 | | - |
| 430 | 424 | let mut client = Client::with_password(PAM_SERVICE_NAME) |
| 431 | 425 | .map_err(|e| anyhow!("Failed to create PAM client: {:?}", e))?; |
| 432 | 426 | |
| 433 | 427 | client.conversation_mut().set_credentials(username, password); |
| 434 | 428 | |
| 435 | | - eprintln!("[PAM] Authenticating..."); |
| 436 | 429 | client |
| 437 | 430 | .authenticate() |
| 438 | 431 | .map_err(|e| anyhow!("PAM authentication failed: {:?}", e))?; |
| 439 | 432 | |
| 440 | | - eprintln!("[PAM] Opening session..."); |
| 441 | 433 | client |
| 442 | 434 | .open_session() |
| 443 | 435 | .map_err(|e| anyhow!("PAM open_session failed: {:?}", e))?; |
| 444 | 436 | |
| 445 | | - eprintln!("[PAM] Session opened successfully"); |
| 446 | | - |
| 447 | 437 | // Keep the client alive - don't let it drop and close the session |
| 448 | 438 | // The session will be closed when the process exits |
| 449 | 439 | std::mem::forget(client); |