Skip to content

unclear fix-permissions setuid, setgid #638

Open
@TiemenSch

Description

For me, the last part of fix-permissions is a tad unclear. The how and why isn't documented.

for d in $@; do
  find "$d" \
    ! \( \
      -group $NB_GID \
      -a -perm -g+rwX  \
    \) \
    -exec chgrp $NB_GID {} \; \
    -exec chmod g+rwX {} \;
  # setuid,setgid *on directories only*
  find "$d" \
    \( \
        -type d \
        -a ! -perm -6000  \
    \) \
    -exec chmod +6000 {} \;
done

Also, the commit in which it was added is a bit unclear for me.
2df9c49#diff-9916251299bdb9a776a7153e7caad86c

As the first block is using the non-numeric approach, would it be possible to change the second one to do so, too?

Would that be something along the lines of:

for d in $@; do
  find "$d" \
    ! \( \
      -group $NB_GID \
      -a -perm -g+rwX  \
    \) \
    -exec chgrp $NB_GID {} \; \
    -exec chmod g+rwX {} \;
  # setuid,setgid *on directories only*
  find "$d" \
    \( \
        -type d \
        -a ! -perm -g+s  \
    \) \
    -exec chmod +g+s {} \;
done

?

This may just be me being too new to the permissions management in Linux.

Metadata

Assignees

No one assigned

    Labels

    tag:DocumentationRelated to user, developer, and maintainer documentationtype:QuestionA question about the use of the docker stack images

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions