Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Dotter doesn't elevate if it can't read a directory #103

Open
Amir-Ahmad opened this issue Jun 27, 2022 · 1 comment
Open

[BUG] Dotter doesn't elevate if it can't read a directory #103

Amir-Ahmad opened this issue Jun 27, 2022 · 1 comment

Comments

@Amir-Ahmad
Copy link

Amir-Ahmad commented Jun 27, 2022

Environment

  • OS: Fedora 35
  • Dotter version: 0.12.13

Description

When specifying a target directory that dotter can't read, dotter fails to create symlinks or templates, even when owner is specified as root.

Reproduction

#Global.toml
[system.files.test]
owner = "root"
target = "/tmp/nonreadable/test"
type = "template"

#local.toml
packages = ["system"]

Create directory user can't read.

sudo mkdir /tmp/nonreadable
sudo chmod 700 /tmp/nonreadable

Expected behavior

I expected dotter to elevate before checking the state of the file/dir as I had specified the "owner" field. Or perhaps elevate if it gets a permission denied.

Actual behavior

Dotter fails with a permission denied.

$ ▶ dotter -v
[ INFO] [+] template "test" -> "/tmp/nonreadable/test"
[ERROR] Failed to create template "test" -> "/tmp/nonreadable/test"
Caused by:
    detect templated file's current state
    get state of target
    read contents of file that isn't symbolic or directory
    Permission denied (os error 13)
@stratosgear
Copy link

I verify that this still fails for me on latest Arch and at dotter 0.12.15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants