Best way to fix a directory's permissions?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Best way to fix a directory's permissions?

Mike Coddington
Last night I screwed up my /tmp directory's permissions. I fixed it by
looking at another machine's permissions and editing the directory with
chmod(1). Is there a tool in OpenBSD which would work better than this?
I'm fortunate enough to have more than one machine running OpenBSD, but
if I didn't this could have been more of a problem for me.

Any good tricks the list would like to share? Is there a canonical
source for where permissions/ownership is listed? I tried searching MARC
but as you might imagine there are a lot of results that come back for
this sort of thing.

--
Put your Nose to the Grindstone!
                -- Amalgamated Plastic Surgeons and Toolmakers, Ltd.

Reply | Threaded
Open this post in threaded view
|

Re: Best way to fix a directory's permissions?

Edgar Pettijohn III-2

On Feb 8, 2019 12:02 PM, Mike Coddington <[hidden email]> wrote:

>
> Last night I screwed up my /tmp directory's permissions. I fixed it by
> looking at another machine's permissions and editing the directory with
> chmod(1). Is there a tool in OpenBSD which would work better than this?
> I'm fortunate enough to have more than one machine running OpenBSD, but
> if I didn't this could have been more of a problem for me.
>
> Any good tricks the list would like to share? Is there a canonical
> source for where permissions/ownership is listed? I tried searching MARC
> but as you might imagine there are a lot of results that come back for
> this sort of thing.
>
> --
> Put your Nose to the Grindstone!
>                 -- Amalgamated Plastic Surgeons and Toolmakers, Ltd.
>

mtree(8)

Never used it but I think it's what you want.

Reply | Threaded
Open this post in threaded view
|

Re: Best way to fix a directory's permissions?

William Ahern-2
In reply to this post by Mike Coddington
On Fri, Feb 08, 2019 at 12:02:50PM -0600, Mike Coddington wrote:

> Last night I screwed up my /tmp directory's permissions. I fixed it by
> looking at another machine's permissions and editing the directory with
> chmod(1). Is there a tool in OpenBSD which would work better than this?
> I'm fortunate enough to have more than one machine running OpenBSD, but
> if I didn't this could have been more of a problem for me.
>
> Any good tricks the list would like to share? Is there a canonical
> source for where permissions/ownership is listed? I tried searching MARC
> but as you might imagine there are a lot of results that come back for
> this sort of thing.

This should tell you when permissions are wrong

  doas mtree -f /etc/mtree/4.4BSD.dist -p / -e

The -u option can be used to fix any issues, but I'm not very familiar with
mtree so I'd be hesitant to use it to modify anything; I'd just fix it
manually.

Reply | Threaded
Open this post in threaded view
|

Re: Best way to fix a directory's permissions?

Mike Coddington
In reply to this post by Mike Coddington
On Fri, Feb 08, 2019 at 01:45:59PM -0600, Edgar Pettijohn wrote:
>
> mtree(8)
>
> Never used it but I think it's what you want.

I just gave it a shot and it works perfectly. Thanks, Edgar and William!

--
Put your Nose to the Grindstone!
                -- Amalgamated Plastic Surgeons and Toolmakers, Ltd.