Hi.

I would like to confirm, do you see the same problem or am I doing
something wrong here. I never used augeas before, so this is freshly
writen test code:

--->8---
import augeas

aug = augeas.Augeas()

custom_path = "/etc/ssh/sshd_config"

aug.set(f"/files{custom_path}", "")

value = aug.get(f"/files{custom_path}/PermitRootLogin")
print("Current value:", value)


def print_config(path):
    for entry in aug.match("/*"):
        key = entry.split("/")[-1]
        value = aug.get(entry)
        print(f"{key} {value}")


print_config("/files{}".format(custom_path))
---8<---

Executing looks as follows:

$ python3 a.py
Current value: prohibit-password
Traceback (most recent call last):
  File "/home/mkucharski/code/python/augeas/a.py", line 20, in <module>
    print_config("/files{}".format(custom_path))
  File "/home/mkucharski/code/python/augeas/a.py", line 14, in print_config
    for entry in aug.match("/*"):
                 ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/augeas/__init__.py", line 543, 
in match
    lib.free(array[i])
    ^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/cffi/api.py", line 912, in 
__getattr__
    make_accessor(name)
  File "/usr/local/lib/python3.11/site-packages/cffi/api.py", line 908, in 
make_accessor
    accessors[name](name)
  File "/usr/local/lib/python3.11/site-packages/cffi/api.py", line 838, in 
accessor_function
    value = backendlib.load_function(BType, name)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: function/symbol 'free' not found in library 'libaugeas.so.1.0': 
Unable to resolve symbol

Do you see the same?

$ sysctl -n kern.version
OpenBSD 7.6-beta (GENERIC.MP) #310: Wed Sep  4 11:59:45 MDT 2024
    dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP

$ pkg_info -qI python3
python3-3.11p3

$ ls -1 /var/db/pkg/ | grep -i augeas
augeas-1.14.1
py3-augeas-1.1.0p1

$ ls -1 /var/db/pkg/ | grep -i ffi-
libffi-3.4.6
py3-cffi-1.16.0p0

-- 
Regards,
 Mikolaj

Reply via email to