vlaci / openconnect-sso

Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication to Cisco SSL-VPNs
GNU General Public License v3.0
299 stars 131 forks source link

Error when `config.toml` is read only #118

Open rhoriguchi opened 1 year ago

rhoriguchi commented 1 year ago

The application throws an error if the config file is read only but will continue to work as intended. Issue arises on NixOS when you create a file through a home-manager config.

...
[error    ] Could not save configuration file [openconnect_sso.config] path=PosixPath('/home/rhoriguchi/.config/openconnect-sso/config.toml')
Traceback (most recent call last):
  File "/nix/store/7p11n5rz2hv6m4v91ay9mdslmy6q01dg-python3.10-openconnect-sso-0.8.0/lib/python3.10/site-packages/openconnect_sso/config.py", line 41, in save
    config_path.touch()
  File "/nix/store/zdba9frlxj2ba8ca095win3nphsiiqhb-python3-3.10.8/lib/python3.10/pathlib.py", line 1168, in touch
    self._accessor.touch(self, mode, exist_ok)
  File "/nix/store/zdba9frlxj2ba8ca095win3nphsiiqhb-python3-3.10.8/lib/python3.10/pathlib.py", line 331, in touch
    fd = os.open(path, flags, mode)
PermissionError: [Errno 13] Permission denied: '/home/rhoriguchi/.config/openconnect-sso/config.toml'
...