Source File Permissions

Joel Sherrill joel at rtems.org
Sun Apr 29 21:08:18 UTC 2018


On Sun, Apr 29, 2018, 3:32 PM Christian Mauderer <list at c-mauderer.de> wrote:

> Am 28.04.2018 um 21:45 schrieb Gedare Bloom:
> > On Thu, Apr 26, 2018 at 7:52 PM, Joel Sherrill <joel at rtems.org> wrote:
> >> Hi
> >>
> >> Teaching the class this week, i have noticed that randomly some
> >> files are executable. I was going to change this but then realized
> >> that we should all agree on what the permissions on the files and
> >> directories in the tree(s) should be.
> >>
> >> I lean to either:
> >>
> >> + 664 for files and 775 for directories
> >>
> >> But could be talked into tighter permissions for group and world.
> >> Whatever we do, it should be consistent and added to the Coding
> >> Conventions.
> >>
> >
> > Your proposal is sensible to me.
>
> Hello Joel,
>
> I wouldn't really have a problem with these. But I think the more usual
> ones would be 644 and 755.
>
> If I create a new file using `touch somefile` in a directory with 775, I
> still get a 644 file (at least on my Linux machine - I'm not sure
> whether it is configuration dependant). I think that we will get a lot
> of patches with "wrong" permissions if we use 664 and 775. So maybe it
> would be good to have some reasons for using these wider group permissions.
>

The command you are thinking of is umask to set your default file
permissions.


> The only setup that I could think of where such rights might could be
> useful is one where one user updates the code while some other user (for
> example a build bot) has to run a bootstrap to build the tree. But I'm
> quite sure that even for that case, there are some better solutions
> (e.g. one working tree that only pushes to a build bot tree).
>

If all commits go through a git or patch tester server, i would assume that
we are getting the permissions set by the patch submitter.

I suspect (no investigation) that we could have a git check that ensures
specific permissions based on the file extension.

>
> Any special reasons, use cases or experiences where the 664 and 775
> would be superior to 644 and 755?
>

No. I just remember historically using those on real multi-user devel
machines so everyone on a team could share source.

I think we all agree it should be standardized. That's a good step.

I will look at git, GNU recommendations and a few packages to see what they
do. Then make a proposal which might include ways to try to keep this
standardized.

>
> Best regards
>
> Christian Mauderer
>
> >
> >> Thoughts
> >>
> >> _______________________________________________
> >> devel mailing list
> >> devel at rtems.org
> >> http://lists.rtems.org/mailman/listinfo/devel
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20180429/237be656/attachment.html>


More information about the devel mailing list