Skip to content

Commit 9abd01f

Browse files
authored
Merge pull request ceph#63099 from phlogistonjohn/jjm-dash-node-chown
dashboard: ensure nodeenv downloaded content is owned by current user
2 parents d9c429f + 24dbfb5 commit 9abd01f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/pybind/mgr/dashboard/frontend/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ else(WITH_SYSTEM_NPM)
6565
COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${mgr-dashboard-nodeenv-dir}
6666
COMMAND ${mgr-dashboard-nodeenv-dir}/bin/pip install nodeenv
6767
COMMAND ${mgr-dashboard-nodeenv-dir}/bin/nodeenv --verbose ${node_mirror_opt} -p --node=20.13.1
68+
# ensure that the files that nodeenv unpacks from tarballs are owned by
69+
# the current user. This can be an issue due to the node tarball using
70+
# uid 1000 and running the unpack in a id-mapped namespace (container)
71+
# that lets tar set the uid to a "bad" uid outside the namespace
72+
COMMAND bash -c "chown -R $$(id -u):$$(id -g) ${mgr-dashboard-nodeenv-dir}/src"
6873
COMMAND mkdir ${mgr-dashboard-nodeenv-dir}/.npm
6974
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
7075
COMMENT "dashboard nodeenv is being installed")

0 commit comments

Comments
 (0)