[augeas-devel] sudoers and requiretty

Chris dmagick at gmail.com
Thu Dec 8 22:35:52 UTC 2011


On 08/12/11 20:06, Michael Chapman wrote:
> On Thu, 8 Dec 2011, Chris wrote:
>> If I use an empty string it works:
>>
>> # augtool
>> augtool> set /files/etc/sudoers/Defaults[type=':nrpe']/type :nrpe
>> augtool> set
>> /files/etc/sudoers/Defaults[type=':nrpe']/requiretty/negate ""
>> augtool> save
>> Saved 1 file(s)
>
> Hi Chris,
>
> The "requiretty" tree node can also be created with an explicitly null
> value:
>
> augtool> clear /files/etc/sudoers/Defaults[type=':nrpe']/requiretty/negate
>
> At the moment Augeas doesn't treat an empty string and a null value any
> differently, though it's probably a good idea if you try to keep them
> separate.
>
> This "clear" command should be able to be used directly in your Puppet
> manifest.

That worked, thanks!

Any idea when that change happened? (I've been looking, but I haven't 
been able to find it).

We've got an older version on centos5 machines (so old augtool doesn't 
have a --version option) and the old syntax was working:

# augtool --version
augtool: unrecognized option `--version'

# rpm -qi augeas
Name        : augeas                       Relocations: (not relocatable)
Version     : 0.5.0                             Vendor: (none)

# augtool
augtool> set /files/etc/sudoers/Defaults[type=':nrpe']/type :nrpe
augtool> set /files/etc/sudoers/Defaults[type=':nrpe']/requiretty/negate !
augtool> save
Saved 1 file(s)
augtool>

# grep requiretty /etc/sudoers
Defaults    requiretty
# changed in order to be able to use sudo without a tty. See requiretty 
above.
Defaults:nrpe !requiretty

-- 
Postgresql & php tutorials
http://www.designmagick.com/




More information about the augeas-devel mailing list