mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
Fix file permissions for developer key and auth cookie (#3024)
* fix permissions * include read for group
This commit is contained in:
@@ -31,7 +31,7 @@ pub async fn write_developer_key(
|
|||||||
secret_key: secret.to_bytes(),
|
secret_key: secret.to_bytes(),
|
||||||
public_key: Some(PublicKeyBytes(VerifyingKey::from(secret).to_bytes())),
|
public_key: Some(PublicKeyBytes(VerifyingKey::from(secret).to_bytes())),
|
||||||
};
|
};
|
||||||
let mut file = create_file_mod(path, 0o046).await?;
|
let mut file = create_file_mod(path, 0o640).await?;
|
||||||
file.write_all(
|
file.write_all(
|
||||||
keypair_bytes
|
keypair_bytes
|
||||||
.to_pkcs8_pem(base64ct::LineEnding::default())
|
.to_pkcs8_pem(base64ct::LineEnding::default())
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ pub trait AuthContext: SignatureAuthContext {
|
|||||||
const LOCAL_AUTH_COOKIE_OWNERSHIP: &str;
|
const LOCAL_AUTH_COOKIE_OWNERSHIP: &str;
|
||||||
fn init_auth_cookie() -> impl Future<Output = Result<(), Error>> + Send {
|
fn init_auth_cookie() -> impl Future<Output = Result<(), Error>> + Send {
|
||||||
async {
|
async {
|
||||||
let mut file = create_file_mod(Self::LOCAL_AUTH_COOKIE_PATH, 0o046).await?;
|
let mut file = create_file_mod(Self::LOCAL_AUTH_COOKIE_PATH, 0o640).await?;
|
||||||
file.write_all(BASE64.encode(random::<[u8; 32]>()).as_bytes())
|
file.write_all(BASE64.encode(random::<[u8; 32]>()).as_bytes())
|
||||||
.await?;
|
.await?;
|
||||||
file.sync_all().await?;
|
file.sync_all().await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user