-
Notifications
You must be signed in to change notification settings - Fork 25
Set does not support negating a node in /etc/sudoers #81
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
Comments
@robertlich Thank you for filing this issue. Is it possible you're running with system |
I don't _ think _ so, we don't have augtool installed elsewhere on the system that I could find. |
We were able to reproduce this using puppet-agent 8.11.0 and the above manifest. The augeas provider rejects It seems possible to special case - raise(_('missing string argument %{narg} for %{cmd}') % { narg: narg, cmd: cmd }) unless argline[-1]
+ if !argline[-1] && cmd == 'set' && line.end_with?('/negate')
+ Puppet.debug(_('negating %{arg}') % {arg: args.last[-1]})
+ elsif !argline[-1]
+ raise(_('missing string argument %{narg} for %{cmd}') % { narg: narg, cmd: cmd })
+ end
However, puppet doesn't correct cases where only
Also can negate be used in other places besides |
Describe the Bug
Running this block to configure my sudo_accounts
Results in an error that I am missing the second argument for set.
Expected Behavior
Using the same augtool executable to run:
set /files/etc/sudoers/spec[3]/host_group/command/negate
Will result in the command on that line being negated.
In this particular example it turns:
%wheel ALL=(ALL) NOPASSWD : ALL , ELEVATING
=>
%wheel ALL=(ALL) NOPASSWD : ALL , !ELEVATING
Notably if I were to try to just use:
"set spec[user = '%wheel']/host_group/command[2] !ELEVATING",
in the puppet code above, that also fails. So I'm left with no options for set to negate a command in the sudoers file, which doesn't match the actual behaviour of augtool.
I am able to get around this by using:
"clear spec[user = '%wheel']/host_group/command[2]/negate"
But that's a little unintuitive.
Steps to Reproduce
I have provided the steps to reproduce as part of the above.
Environment
The text was updated successfully, but these errors were encountered: