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

doas interprets arguments meant for the target program as doas args #5

Closed
nickpelone opened this issue Aug 14, 2016 · 5 comments
Closed

Comments

@nickpelone
Copy link

Example doas.conf:

permit nopass nick as root cmd ls args -l

Then, running ls as root:

nick@nick-lenovo:[~/abs/doas]:$ doas ls -l
doas: invalid option -- 'l'
usage: doas [-ns] [-a style] [-C config] [-u user] command [args]

Side note: appreciate your efforts to bring this tool to Linux!

@nickpelone nickpelone changed the title doas interprets flags meant for the target program as doas flags doas interprets arguments meant for the target program as doas args Aug 14, 2016
@slicer69
Copy link
Owner

When running a command which requires arguments, try running "doas -- ls". The -- indicates an end to doas's argument list and makes sure any arguments given after the "--" are for the target program.

@nickpelone
Copy link
Author

That's a breakage with upstream...
(as tested with OpenBSD 5.9)

Don't mean to be irritating, just pointing it out. Sorry it took me so long to respond, been very busy past week or so!

nick@testmachine:[~]:$ uname -a
OpenBSD testmachine.my.domain 5.9 GENERIC#1761 amd64
nick@testmachine:[~]:$ cat /etc/doas.conf
permit nopass nick as root cmd ls args -l
nick@testmachine:[~]:$ doas ls
doas: Operation not permitted
nick@testmachine:[~]:$ doas ls -l
total 368220
-rw-------  1 nick  nick        268 Aug 25 16:45 .Xauthority
-rw-r--r--  1 nick  nick         87 Feb 26 03:07 .Xdefaults
drwxr-xr-x  3 nick  nick        512 Aug  2 07:39 .bundle
drwx------  3 nick  nick        512 Jun 24 12:25 .cache
drwx------  2 nick  nick        512 Jun 24 12:26 .config
-rw-r--r--  1 nick  nick        773 Feb 26 03:07 .cshrc
-rw-r--r--  1 nick  nick        103 Feb 26 03:07 .cvsrc
drwxr-xr-x  4 nick  nick        512 Aug  2 07:39 .gem
-rw-r--r--  1 nick  nick         61 Aug  2 07:31 .gitconfig
drwx------  3 nick  nick        512 Jun 24 12:26 .local
-rw-r--r--  1 nick  nick        359 Feb 26 03:07 .login
-rw-r--r--  1 nick  nick        175 Feb 26 03:07 .mailrc
drwx------  4 nick  nick        512 Jun 24 12:25 .mozilla
-rw-r--r--  1 nick  nick        588 Jun 24 08:04 .profile
drwx------  2 nick  nick        512 Jun 24 08:02 .ssh
drwxr-xr-x  3 nick  nick        512 Aug  3 08:20 .vim
-rw-------  1 nick  nick       6184 Aug 25 16:46 .viminfo
-rw-r--r--  1 nick  nick       1331 Jun 24 08:02 .vimrc
-rw-------  1 nick  nick          0 Jun 24 11:34 .xsession-errors
drwxr-xr-x  2 nick  nick        512 Jun 24 12:25 Desktop
-rw-r--r--  1 nick  nick  188405432 Jun 27 07:33 install59.fs
-rw-r--r--  1 nick  nick         21 Jun 24 08:07 test.pf.conf

@slicer69
Copy link
Owner

I just tired the "ls -l" example given on FreeBSD using the doas port and it worked exactly the same way the OpenBSD version did in the example given above. I cannot duplicate the difference in behaviour.

@Duncaen
Copy link
Contributor

Duncaen commented Aug 26, 2016

You need to prefix the optstring with + in glibc to get posix correct option parsing as opendoas does it.

@slicer69
Copy link
Owner

I have updated the documentation to make it clearer that -- should be used on systems where the dash is ambiguous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants