#50230 dsctl stop gives traceback when lacking privileges
Closed: wontfix 5 years ago by firstyear. Opened 5 years ago by mhonek.

Issue Description

Issuing dsctl <inst-name> stop without privileges gives a traceback due to exception.

Package Version and Platform

389-ds-base-1.4.1.1-20190204git22d493a64.fc28.x86_64
python3-lib389-1.4.1.1-20190204git22d493a64.fc28.noarch

Actual results

[vagrant@localhost 389-console]$ dsctl w stop
Traceback (most recent call last):
  File "/usr/sbin/dsctl", line 101, in <module>
    insts = inst.list(serverid=args.instance)
  File "/usr/lib/python3.6/site-packages/lib389/__init__.py", line 818, in list
    search_dir(instances, pattern, serverid)
  File "/usr/lib/python3.6/site-packages/lib389/__init__.py", line 748, in search_dir
    instances.append(_parse_configfile(instance, serverid))
  File "/usr/lib/python3.6/site-packages/lib389/__init__.py", line 651, in _parse_configfile
    raise IOError('invalid file name or rights: %s' % filename)
OSError: invalid file name or rights: /etc/sysconfig/dirsrv-w
[vagrant@localhost 389-console]$ sudo dsctl w stop
Instance "w" has been stopped

I was pretty sure there was an exceptional handler installed, but perhaps that's only for the function action.

I'd suggest we put in a similar catch/wrap on the dirsrv open in this case. src/lib389/cli/dsctl is pretty short, and the handler is switched based on if args.verbose.

Metadata Update from @firstyear:
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None

5 years ago
{william@ldapkdc 12:10} ~/development/389ds I0> /usr/sbin/dsctl localhost stop
No such instance 'localhost'
This may be a permission issue - are you running as root or dirsrv?.
{william@ldapkdc 12:11} ~/development/389ds I0> /usr/sbin/dscreate from-file /tmp/ds-setup.inf --containerized

Starting installation...
Error: Not running as user root or dirsrv, may not have permission to continue

https://pagure.io/389-ds-base/pull-request/50248

Metadata Update from @firstyear:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

5 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/3289

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

3 years ago

Login to comment on this ticket.

Metadata