Skip to content

Commit a8a437a

Browse files
committed
Fix token permission helper on Windows
1 parent f3d40e8 commit a8a437a

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/auth/token_store.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,15 @@ fn keyring_disabled() -> bool {
158158
.is_some_and(|value| matches!(value.as_str(), "1" | "true" | "TRUE" | "yes" | "YES"))
159159
}
160160

161+
#[cfg(unix)]
161162
fn set_private_permissions(path: &std::path::Path) -> Result<()> {
162-
#[cfg(unix)]
163-
{
164-
use std::os::unix::fs::PermissionsExt;
165-
std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o600))?;
166-
}
163+
use std::os::unix::fs::PermissionsExt;
164+
std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o600))?;
165+
Ok(())
166+
}
167+
168+
#[cfg(not(unix))]
169+
fn set_private_permissions(_path: &std::path::Path) -> Result<()> {
167170
Ok(())
168171
}
169172

0 commit comments

Comments
 (0)