secondlife / secondlife/viewer

File execution permissions throughout the codebase is inconsistent

Open
#5,224 1 comment 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #5226 by @Hecklezz — merged
bug stale triage
Dominant language
C++
Stars
299
Forks
146
Avg merge
1d 9h
Merged PRs (30d)
88

Description

Environment

Unrelated to the operations of the viewer itself

Description

PR with permission changes: https://github.com/secondlife/viewer/pull/5226

Some amount of source files, text files, and other non-executable file type files in the codebase have their permissions set to have execute rights. This is typically undesirable and non-standard, as only scripts such as .sh files and .py files with a script shebang at the start should have execute permissions.
There is also some scripts that should have execution permissions but don't (some .sh scripts and some .py files with a script shebang).

Reproduction steps

Command to find files that shouldn't have execution permissions but do-

git ls-files --format '%(objectmode) %(path)' \
| grep -v '^100644' \
| grep -v '\.sh$' \
| cut -d' ' -f2- \
| while read -r f; do
    head -n1 "$f" 2>/dev/null | grep -q '^#!' || echo "$f"
  done

Command to find files that should have execution permissions that don't (this could take a little while)-

git ls-files --format '%(objectmode) %(path)' \
| grep -v '^100755' \
| cut -d' ' -f2- \
| while IFS= read -r f; do
    case "$f" in
      *.sh) echo "$f"; continue;;
    esac
    head -n1 "$f" 2>/dev/null | grep -q '^#!' && echo "$f"
  done


This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting /reward 100 (replace 100 with the amount).
🕵️‍♂️ If someone starts working on this issue to earn the rewards, they can comment /try to let everyone know!
🙌 And when they open the PR, they can comment /claim #5224 either in the PR description or in a PR's comment.

🪙 Also, everyone can tip any user commenting /tip 20 @Hecklezz (replace 20 with the amount, and @Hecklezz with the user to tip).

📖 If you want to learn more, check out our documentation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two git ls-files permission checks in the issue body and review the changes in merged PR #5226. Verify that non-executable files without a shebang no longer have execute permissions, while .sh files and shebang scripts do; the issue is already addressed by that merged pull request.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, shell
Domain
tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.