Skip to content

Commit 0384a01

Browse files
committed
Add warning if config is vulnerable to exploitation
Fixes #309
1 parent 7e6dd6f commit 0384a01

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ And is incredibly fault tolerant and user-protective.
4040
### Installation
4141
---
4242

43-
**Be careful running this with elevated privileges. Code execution can be achieved with write permissions on the config file.**
43+
> **Warning**
44+
> Be careful running this with elevated privileges. Code execution can be achieved with write permissions on the config file.
4445
4546
#### Method 1: [`pip3`](https://pypi.org/project/shallow-backup/)
4647

@@ -163,7 +164,8 @@ Editing the file in a text editor will give you more control and be faster.
163164
164165
#### Conditional Backup and Reinstallation
165166
166-
> **Warning: This feature allows code execution (by design).** If untrusted users can write to your config, they can achieve code execution next time you invoke `shallow-backup` _backup_ or _reinstall_ functions. Starting in `v5.2`, the config file will have default permissions of `644`, and a warning will be printed if others can write to the config.
167+
> **Warning**
168+
> This feature allows code execution (by design). If untrusted users can write to your config, they can achieve code execution next time you invoke `shallow-backup` _backup_ or _reinstall_ functions. Starting in `v5.2`, the config file will have default permissions of `644`, and a warning will be printed if others can write to the config.
167169
168170
Every key under dotfiles has two optional subkeys: `backup_condition` and `reinstall_condition`. Both of these accept expressions that will be evaluated with `bash`. An empty string (`""`) is the default value, and is considered to be `True`. If the return value of the expression is `0`, this is considered `True`. Otherwise, it is `False`. This lets you do simple things like preventing backup with:
169171

tests/testing_utility_functions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import shutil
33
import sys
4-
import tempfile
54
sys.path.insert(0, "../shallow_backup")
65
from shallow_backup.config import safe_create_config
76

0 commit comments

Comments
 (0)