Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Changes made to $HOME/.ssh/config file through augtool are not saved.
Version-Release number of selected component (if applicable):
augeas-1.1.0-3.el7.x86_64
How reproducible:
Always
Steps to Reproduce:
1. rm -f /home/jfilak/.ssh/config
2. augtool -r / -s set home/jfilak/.ssh/config/Host[0] github.com
3. cat /home/jfilak/.ssh/config
Actual results:
cat: /home/jfilak/.ssh/config: No such file or directory
Expected results:
Host github.com
Additional info:
The problem is in filter_matches() function[1]. The function uses fnmatch(,,FNM_PATHNAME)[2][3] to check whether a tree path is a file. FNM_PATHNAME requires to have the exactly matching slashes[4] and this is problematic when a lens filter uses a construction like this 'incl (Sys.getenv("HOME") . "/.ssh/config")'[5]. On my system $HOME variable holds "/home/jfilak/", so the include is expanded to "/home/jfilak//.ssh/config".
A fnmatch("/home/jfilak//.ssh/config", "/home/jfilak/.ssh/config", FNM_PATHNAME) call returns no match, therefore /files/home/jfilak/.ssh/config/Host[0] path has no matching file and the changes are not saved.
1: https://github.com/hercules-team/augeas/blob/master/src/transform.c#L254
2: https://github.com/hercules-team/augeas/blob/master/src/transform.c#L257
3: https://github.com/hercules-team/augeas/blob/master/src/transform.c#L42
4: http://linux.die.net/man/3/fnmatch
5: https://github.com/hercules-team/augeas/blob/master/lenses/ssh.aug#L79
Can reproduce with augeas-1.1.0-3.el7.x86_64
1. set $HOME end with '/'
$ echo $HOME
/home/mockbuild
$ export HOME=/home/mockbuild/
2. execute augtool command
$ rm -f /home/mockbuild/.ssh/config
$ augtool -r / -s set home/mockbuild/.ssh/config/Host[0] github.com
$ cat /home/mockbuild/.ssh/config
cat: /home/mockbuild/.ssh/config: No such file or directory
This request was resolved in Red Hat Enterprise Linux 7.0.
Contact your manager or support representative in case you have further questions about the request.
Description of problem: Changes made to $HOME/.ssh/config file through augtool are not saved. Version-Release number of selected component (if applicable): augeas-1.1.0-3.el7.x86_64 How reproducible: Always Steps to Reproduce: 1. rm -f /home/jfilak/.ssh/config 2. augtool -r / -s set home/jfilak/.ssh/config/Host[0] github.com 3. cat /home/jfilak/.ssh/config Actual results: cat: /home/jfilak/.ssh/config: No such file or directory Expected results: Host github.com Additional info: The problem is in filter_matches() function[1]. The function uses fnmatch(,,FNM_PATHNAME)[2][3] to check whether a tree path is a file. FNM_PATHNAME requires to have the exactly matching slashes[4] and this is problematic when a lens filter uses a construction like this 'incl (Sys.getenv("HOME") . "/.ssh/config")'[5]. On my system $HOME variable holds "/home/jfilak/", so the include is expanded to "/home/jfilak//.ssh/config". A fnmatch("/home/jfilak//.ssh/config", "/home/jfilak/.ssh/config", FNM_PATHNAME) call returns no match, therefore /files/home/jfilak/.ssh/config/Host[0] path has no matching file and the changes are not saved. 1: https://github.com/hercules-team/augeas/blob/master/src/transform.c#L254 2: https://github.com/hercules-team/augeas/blob/master/src/transform.c#L257 3: https://github.com/hercules-team/augeas/blob/master/src/transform.c#L42 4: http://linux.die.net/man/3/fnmatch 5: https://github.com/hercules-team/augeas/blob/master/lenses/ssh.aug#L79