Sometimes an RSA Key file could be read only.
We currently failed because we also wanted to write. Added an extra check if the file exists already and is not 0 in size. If it does already exists and is larger then 0, then open in read only mode.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/dani-garcia/vaultwarden/pull/4744
**Author:** [@BlackDex](https://github.com/BlackDex)
**Created:** 7/14/2024
**Status:** ✅ Merged
**Merged:** 7/17/2024
**Merged by:** [@dani-garcia](https://github.com/dani-garcia)
**Base:** `main` ← **Head:** `fix-rsa-key-read-only`
---
### 📝 Commits (3)
- [`798c2f2`](https://github.com/dani-garcia/vaultwarden/commit/798c2f274bc14b329d202957f250c88c7967c728) Fix for RSA Keys which are read only
- [`5c1dec9`](https://github.com/dani-garcia/vaultwarden/commit/5c1dec98966ad3be9dc29e3d4dace86c4bfd782b) Updated code to work atomically
- [`5fbeaae`](https://github.com/dani-garcia/vaultwarden/commit/5fbeaae072dc698db65b67312d66ed2b3e6904ec) Fix spelling
### 📊 Changes
**2 files changed** (+29 additions, -22 deletions)
<details>
<summary>View changed files</summary>
📝 `src/auth.rs` (+25 -17)
📝 `src/main.rs` (+4 -5)
</details>
### 📄 Description
Sometimes an RSA Key file could be read only.
We currently failed because we also wanted to write. Added an extra check if the file exists already and is not 0 in size. If it does already exists and is larger then 0, then open in read only mode.
Fixes #4644
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/4744
Author: @BlackDex
Created: 7/14/2024
Status: ✅ Merged
Merged: 7/17/2024
Merged by: @dani-garcia
Base:
main← Head:fix-rsa-key-read-only📝 Commits (3)
798c2f2Fix for RSA Keys which are read only5c1dec9Updated code to work atomically5fbeaaeFix spelling📊 Changes
2 files changed (+29 additions, -22 deletions)
View changed files
📝
src/auth.rs(+25 -17)📝
src/main.rs(+4 -5)📄 Description
Sometimes an RSA Key file could be read only.
We currently failed because we also wanted to write. Added an extra check if the file exists already and is not 0 in size. If it does already exists and is larger then 0, then open in read only mode.
Fixes #4644
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.