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

augtool hangs while loading with lens set to "dist/X.lns" #522

Closed
jayvdb opened this issue Nov 4, 2017 · 1 comment
Closed

augtool hangs while loading with lens set to "dist/X.lns" #522

jayvdb opened this issue Nov 4, 2017 · 1 comment

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Nov 4, 2017

The following hangs when dist is used in the lens name

$ augtool  --noload --noautoload
augtool> print /augeas/load
augtool> set /augeas/load/Fstab/lens "foo/Fstab.lns"
augtool> set /augeas/load/Fstab/incl "/etc/fstab"
augtool> load
error: Lens not found
Can not find lens foo/Fstab.lns
augtool> load
error: Lens not found
Can not find lens foo/Fstab.lns
augtool> set /augeas/load/Fstab/lens "foo2/Fstab.lns"
augtool> load
error: Lens not found
Can not find lens foo2/Fstab.lns
augtool> set /augeas/load/Fstab/lens "dist/Fstab.lns"
augtool> load
Terminated

It is recursively reading /usr/share/augeas/lenses/dist/fstab.aug

This is on Fedora, which packages the lens into /usr/share/augeas/lenses/dist/ , but that looks identical to https://github.com/hercules-team/augeas/blob/master/augeas.spec.in#L111

lutter added a commit to lutter/augeas that referenced this issue Nov 8, 2017
If a module name contains a '/', it can happen that we find the
module (like 'dist/Fstab.lns'), load it and then later can't find it under
the invalid module name containing the slash, leading to an endless loop of
loding the same module over and over again.

We avoid this by making sure there is no '/' in the module name before
looking for the module file. Other forms of invalid module names should not
cause similar problems as we will simply fail to find the corresponding
file.

Fixes hercules-team#522
@lutter
Copy link
Member

lutter commented Nov 8, 2017

Thanks for the bug report .. quite the doozy !

lutter added a commit to lutter/augeas that referenced this issue Nov 11, 2017
If a module name contains a '/', it can happen that we find the
module (like 'dist/Fstab.lns'), load it and then later can't find it under
the invalid module name containing the slash, leading to an endless loop of
loding the same module over and over again.

We avoid this by making sure there is no '/' in the module name before
looking for the module file. Other forms of invalid module names should not
cause similar problems as we will simply fail to find the corresponding
file.

Fixes hercules-team#522
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