Re: sudoedit for doas?

2018-03-01 Thread frantisek holop
Paul de Weerd, 01 Mar 2018 15:06:
> Hi Nick, others,
> | what is the reason for your obsession with sudoedit or visudo or
> | anything other than just editing the $%&^& file, saving your change and
> | testing them on another terminal window?  Like is done on almost every
> | other config file in a Unix environment?
> | 
> | There is no pfconfedit, daily.localedit, virc.conf, dhcpd.confedit, and
> | we do just fine without it.
> 
> crontab -e! :-)

disklabel -E (not -e ;p)
fdisk -e

:}

-- 



Re: sudoedit for doas?

2018-03-01 Thread Michael Price
There is also this thing added in 1975 called groups. By 1979 it was fairly
trivial to create a group, add users, chown and chmod files you wanted the
group to edit, and then have a beer.

This lets groups of people edit sets of files using whatever editor they
want all without ever having root.

Still works.

Michael

On Thu, Mar 1, 2018 at 9:18 AM Paul de Weerd  wrote:

> Hi Nick, others,
>
> On Thu, Mar 01, 2018 at 08:15:57AM -0500, Nick Holland wrote:
> | On 03/01/18 06:50, Solène Rapenne wrote:
> | > What you said mimics visudo (to edit sudo configuration file), not
> | > sudoedit which is documented in sudo(8) :
> | >
> | > 1.Temporary copies are made of the files to be edited with the owner
> | >set to the invoking user.
> | > 2.The editor specified by the policy is run to edit the temporary
> | >files. The sudoers policy uses the SUDO_EDITOR, VISUAL and EDITOR
> | >environment variables (in that order).  If none of SUDO_EDITOR,
> | >VISUAL or EDITOR are set, the first program listed in the editor
> | >sudoers(5) option is used.
> | > 3.If they have been modified, the temporary files are copied back to
> | >their original location and the temporary versions are removed.
> |
> | what is the reason for your obsession with sudoedit or visudo or
> | anything other than just editing the $%&^& file, saving your change and
> | testing them on another terminal window?  Like is done on almost every
> | other config file in a Unix environment?
> |
> | There is no pfconfedit, daily.localedit, virc.conf, dhcpd.confedit, and
> | we do just fine without it.
>
> crontab -e! :-)
>
> Anywho .. sudoedit has its place: you can grant users the right to
> edit specific files, and the editing itself is done without
> privileges.  And, miraculously, there's already a tool for doing
> exactly that availble just one pkg_add away!
>
> Really people, there's no shame in installing packages.  The porters
> and package builders put *A LOT* of effort in generating these.  If
> you need their functionality because it's not in base - go ahead and
> use the fruit of their hard labour!  Some functionality is *NOT* in
> base for a reason.
>
> Paul 'WEiRD' de Weerd
>
> --
> >[<++>-]<+++.>+++[<-->-]<.>+++[<+
> +++>-]<.>++[<>-]<+.--.[-]
>  http://www.weirdnet.nl/
>
>


Re: sudoedit for doas?

2018-03-01 Thread Paul de Weerd
Hi Nick, others,

On Thu, Mar 01, 2018 at 08:15:57AM -0500, Nick Holland wrote:
| On 03/01/18 06:50, Solène Rapenne wrote:
| > What you said mimics visudo (to edit sudo configuration file), not
| > sudoedit which is documented in sudo(8) :
| > 
| > 1.Temporary copies are made of the files to be edited with the owner
| >set to the invoking user.
| > 2.The editor specified by the policy is run to edit the temporary
| >files. The sudoers policy uses the SUDO_EDITOR, VISUAL and EDITOR
| >environment variables (in that order).  If none of SUDO_EDITOR,
| >VISUAL or EDITOR are set, the first program listed in the editor
| >sudoers(5) option is used.
| > 3.If they have been modified, the temporary files are copied back to
| >their original location and the temporary versions are removed.
| 
| what is the reason for your obsession with sudoedit or visudo or
| anything other than just editing the $%&^& file, saving your change and
| testing them on another terminal window?  Like is done on almost every
| other config file in a Unix environment?
| 
| There is no pfconfedit, daily.localedit, virc.conf, dhcpd.confedit, and
| we do just fine without it.

crontab -e! :-)

Anywho .. sudoedit has its place: you can grant users the right to
edit specific files, and the editing itself is done without
privileges.  And, miraculously, there's already a tool for doing
exactly that availble just one pkg_add away!

Really people, there's no shame in installing packages.  The porters
and package builders put *A LOT* of effort in generating these.  If
you need their functionality because it's not in base - go ahead and
use the fruit of their hard labour!  Some functionality is *NOT* in
base for a reason.

Paul 'WEiRD' de Weerd

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: sudoedit for doas?

2018-03-01 Thread Martijn van Duren

On 03/01/18 11:41, tomr wrote:



On 02/28/18 17:50, Hess THR wrote:

Hello,

hmm, I went through the relevant man pages:

https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/doas.1
https://man.openbsd.org/doas.conf.5

but I cannot find a sudoedit alternative for the "doas".

Are there any?


Use `doas -C` in a wrapper script that:

- checks for a lock / creates a lock
- copies /etc/doas.conf somewhere
- edits it with your editor of choice
- checks it (with -C)
- copies it back into place
- removes the lock

t


sudoedit != visudo



Re: sudoedit for doas?

2018-03-01 Thread Nick Holland
On 03/01/18 06:50, Solène Rapenne wrote:
> What you said mimics visudo (to edit sudo configuration file), not
> sudoedit which is documented in sudo(8) :
> 
> 1.Temporary copies are made of the files to be edited with the owner
>set to the invoking user.
> 2.The editor specified by the policy is run to edit the temporary
>files. The sudoers policy uses the SUDO_EDITOR, VISUAL and EDITOR
>environment variables (in that order).  If none of SUDO_EDITOR,
>VISUAL or EDITOR are set, the first program listed in the editor
>sudoers(5) option is used.
> 3.If they have been modified, the temporary files are copied back to
>their original location and the temporary versions are removed.

what is the reason for your obsession with sudoedit or visudo or
anything other than just editing the $%&^& file, saving your change and
testing them on another terminal window?  Like is done on almost every
other config file in a Unix environment?

There is no pfconfedit, daily.localedit, virc.conf, dhcpd.confedit, and
we do just fine without it.

If you are so obsessed with doing things the sudo way, just use sudo
(from packages) as has been already said.  Otherwise, just edit
doas.conf, test, and have a great day!

Nick.



Re: sudoedit for doas?

2018-03-01 Thread Solène Rapenne

Le 2018-03-01 11:41, tomr a écrit :

On 02/28/18 17:50, Hess THR wrote:

Hello,

hmm, I went through the relevant man pages:

https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/doas.1
https://man.openbsd.org/doas.conf.5

but I cannot find a sudoedit alternative for the "doas".

Are there any?


Use `doas -C` in a wrapper script that:

- checks for a lock / creates a lock
- copies /etc/doas.conf somewhere
- edits it with your editor of choice
- checks it (with -C)
- copies it back into place
- removes the lock

t


Hello,

What you said mimics visudo (to edit sudo configuration file), not
sudoedit which is documented in sudo(8) :

1.Temporary copies are made of the files to be edited with the owner
  set to the invoking user.
2.The editor specified by the policy is run to edit the temporary
  files. The sudoers policy uses the SUDO_EDITOR, VISUAL and EDITOR
  environment variables (in that order).  If none of SUDO_EDITOR,
  VISUAL or EDITOR are set, the first program listed in the editor
  sudoers(5) option is used.
3.If they have been modified, the temporary files are copied back to
  their original location and the temporary versions are removed.



Re: sudoedit for doas?

2018-03-01 Thread tomr


On 02/28/18 17:50, Hess THR wrote:
> Hello, 
> 
> hmm, I went through the relevant man pages: 
> 
> https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/doas.1
> https://man.openbsd.org/doas.conf.5
> 
> but I cannot find a sudoedit alternative for the "doas". 
> 
> Are there any? 

Use `doas -C` in a wrapper script that:

- checks for a lock / creates a lock
- copies /etc/doas.conf somewhere
- edits it with your editor of choice
- checks it (with -C)
- copies it back into place
- removes the lock

t



Re: sudoedit for doas?

2018-03-01 Thread Paul de Weerd
On Thu, Mar 01, 2018 at 08:39:51AM +0100, mich...@hekeler.com wrote:
| ‎What is a sudoedit alternative? 
| I mean: what should it do?

Install sudo and use that.  It's in the portstree so you can use it.

Paul 'WEiRD' de Weerd

| 
|   Originalnachricht  
| Von: Hess THR
| Gesendet: Mittwoch, 28. Februar 2018 07:51
| An: misc@OpenBSD.org; t...@openbsd.org
| Betreff: sudoedit for doas?
| 
| Hello, 
| 
| hmm, I went through the relevant man pages: 
| 
| https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/doas.1
| https://man.openbsd.org/doas.conf.5
| 
| but I cannot find a sudoedit alternative for the "doas". 
| 
| Are there any? 
| 
| Many thanks. 
| 

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: sudoedit for doas?

2018-02-28 Thread jungle boogie

Thus said Michael on Thu, 01 Mar 2018 08:39:51 +0100

‎What is a sudoedit alternative?
I mean: what should it do?



You can edit the file with a text editor, like vim.

Worth reading:
https://undeadly.org/cgi?action=article=20160913101323



Re: sudoedit for doas?

2018-02-28 Thread michael
‎What is a sudoedit alternative? 
I mean: what should it do?




  Originalnachricht  
Von: Hess THR
Gesendet: Mittwoch, 28. Februar 2018 07:51
An: misc@OpenBSD.org; t...@openbsd.org
Betreff: sudoedit for doas?

Hello, 

hmm, I went through the relevant man pages: 

https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/doas.1
https://man.openbsd.org/doas.conf.5

but I cannot find a sudoedit alternative for the "doas". 

Are there any? 

Many thanks. 



Re: sudoedit for doas?

2018-02-27 Thread Niels Kobschaetzki

> On 28. Feb 2018, at 07:50, Hess THR  wrote:
> 
> Hello, 
> 
> hmm, I went through the relevant man pages: 
> 
> https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/doas.1
> https://man.openbsd.org/doas.conf.5
> 
> but I cannot find a sudoedit alternative for the "doas". 
> 
> Are there any? 

No

Niels



sudoedit for doas?

2018-02-27 Thread Hess THR
Hello, 

hmm, I went through the relevant man pages: 

https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/doas.1
https://man.openbsd.org/doas.conf.5

but I cannot find a sudoedit alternative for the "doas". 

Are there any? 

Many thanks.