Skip to content

Commit e47e748

Browse files
fix(lib-inject): set execute permissions on package files [backport 2.0] (#7542)
Backport 73c4368 from #7528 to 2.0. Resolves: #7454 ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) - [x] If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. - [x] This PR doesn't touch any of that. Co-authored-by: Munir Abdinur <[email protected]>
1 parent 8b24cde commit e47e748

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/lib-injection.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ jobs:
9090
docker-compose run lib_inject find /datadog-init/ddtrace_pkgs -maxdepth 0 -empty | wc -l && if [ $? -ne 0 ]; then exit 1; fi
9191
# Ensure files are not world writeable
9292
docker-compose run lib_inject find /datadog-init/ddtrace_pkgs ! -perm /o+w | wc -l && if [ $? -ne 0 ]; then exit 1; fi
93-
# Ensure non-datadog users have read permissions to files stored in /datadog-lib/ddtrace_pkgs
94-
docker-compose run lib_inject find /datadog-init/ddtrace_pkgs ! -perm -a=r | wc -l && if [ $? -ne 0 ]; then exit 1; fi
93+
# Ensure all users have read and execute permissions to files stored in /datadog-lib/ddtrace_pkgs
94+
docker-compose run lib_inject find /datadog-init/ddtrace_pkgs ! -perm u=rwx,o=rx | wc -l && if [ $? -ne 0 ]; then exit 1; fi
9595
- name: Test the app
9696
run: |
9797
curl http://localhost:18080

lib-injection/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ ARG UID=10000
2929
RUN addgroup -g 10000 -S datadog && \
3030
adduser -u ${UID} -S datadog -G datadog
3131
RUN chown -R datadog:datadog /datadog-init/ddtrace_pkgs
32-
RUN chmod -R o-w /datadog-init/ddtrace_pkgs
33-
RUN chmod -R g-w /datadog-init/ddtrace_pkgs
32+
RUN chmod -R 755 /datadog-init/ddtrace_pkgs
3433
USER ${UID}
3534
WORKDIR /datadog-init
3635
ADD sitecustomize.py /datadog-init/sitecustomize.py
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
lib injection: Fix permissions error raised when non-root users copy single step instrumentation files.

0 commit comments

Comments
 (0)