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

[FEATURE] Don't ask for an elevation if nothing has changed #66

Open
vessd opened this issue May 22, 2021 · 3 comments
Open

[FEATURE] Don't ask for an elevation if nothing has changed #66

vessd opened this issue May 22, 2021 · 3 comments

Comments

@vessd
Copy link

vessd commented May 22, 2021

Is your feature request related to a problem? Please describe.
I have several files in /etc with root ownership. Every time I deploy to update a configuration based on a template, dotter prompts me for elevation, even if the files in /etc have not changed.

Describe the solution you'd like
Prompt for elevation only if the files that require them have changed.

@SuperCuber
Copy link
Owner

Seems like this is the source of the issue:

TemplateComparison::OnlyCacheExists | TemplateComparison::Identical => {

The Identical variant should not run perform_template_deploy.

@vessd , can you confirm that this only happens when the file is a template, and not when it's a symlink?

@vessd
Copy link
Author

vessd commented May 22, 2021

can you confirm that this only happens when the file is a template, and not when it's a symlink?

No, it looks like it's still asking for it

[ WARN] Elevating permissions (Setting owner of "/etc/environment" to Name("root")...)

Hmm, in general I think it shouldn't be allowed to specify the owner for links, since it can't be done correctly.
I mean, now I don't need root privileges to edit the /etc/environment file, since root only owns the link.

@SuperCuber
Copy link
Owner

No, it looks like it's still asking for it

OK, I'll check it in both symlink and template cases when I get to doing this.

Hmm, in general I think it shouldn't be allowed to specify the owner for links, since it can't be done correctly.

This is a good point, but I think I'll keep the ability to do this both for backwards compatibility and because there's not much reason to lock someone out of doing it if they "know what they are doing". A quote that comes to mind is "a system that prevents the user from doing stupid things also prevents the user from doing smart things".

I think it could be useful to have a warning for this though - maybe as a warn! in the create_symlink function, or even simpler - somewhere in the wiki.

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

No branches or pull requests

2 participants