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

[Bug]: Pseudo-Loading options_ios.yml is causing issues #302

Open
1 task done
distahl opened this issue Sep 24, 2024 · 0 comments
Open
1 task done

[Bug]: Pseudo-Loading options_ios.yml is causing issues #302

distahl opened this issue Sep 24, 2024 · 0 comments
Labels

Comments

@distahl
Copy link

distahl commented Sep 24, 2024

Contact Details

No response

What happened?

I maybe have a special use case here, but I'm calling this script/module a bit different.

The execution order is like this:

  1. User "A" executes some kind of proxy script
  2. Proxy Script, internally, changes to a User "B"
  3. Proxy Script, with User "B" permissions, finally executes ciscoconfparse

Imagine the above like some sort of sudo.
But this then results in the follwing error:

   File "venv/lib/python3.12/site-packages/ciscoconfparse/ciscoconfparse.py", line 4076, in __init__
     _ = yaml.load(open('./options_ios.yml'), Loader=yaml.SafeLoader)
         │    │                                      │    └ <class 'yaml.loader.SafeLoader'>
         │    │                                      └ <module 'yaml' from 'venv/lib/python3.12/site-packages/yaml/__init__.py'>
         │    └ <function load at 0x7f1e1c4fa840>
         └ <module 'yaml' from 'venv/lib/python3.12/site-packages/yaml/__init__.py'>
 PermissionError: [Errno 13] Permission denied: './options_ios.yml'

And this error is caused by the fact, that CWD is still the one of User "A", in which User "B" has no read permissions at all.
So checking for ./options_ios.yml in CWD might be not ideal. Can you maybe change this to something more reliable?

Additional Info:

  • Python Version: 3.12

CiscoConfParse Version

1.9.51

What Operating System are you using?

Linux - Debian, Ubuntu, CentOS, RHEL or others

What Python version(s) have this problem?

Other (please specify)

Show us how to reproduce the problem. Please tell us if the problem is specific to certain inputs or situations.

-

Python tracebacks

See bug description.

Relevant log output

No response

Code of Conduct

@distahl distahl added the bug label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant