Skip to content

Commit d93bbed

Browse files
authored
Remove write permission for others in tar installed images (#221)
1 parent e67413b commit d93bbed

File tree

11 files changed

+40
-21
lines changed

11 files changed

+40
-21
lines changed

release/community-stable/archlinux/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ RUN \
6060
&& rm -f /tmp/powershell-linux.tar.gz \
6161
# Create the pwsh symbolic link that points to powershell
6262
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
63-
# Give all user execute permissions
64-
&& chmod a+x ${PS_INSTALL_FOLDER}/pwsh \
63+
# Give all user execute permissions and remove write permissions for others
64+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
6565
# intialize powershell module cache
6666
&& pwsh \
6767
-NoLogo \

release/community-stable/blackarch/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ RUN \
7575
&& rm -f /tmp/powershell-linux.tar.gz \
7676
# Create the pwsh symbolic link that points to powershell
7777
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
78-
# Give all user execute permissions
79-
&& chmod a+x ${PS_INSTALL_FOLDER}/pwsh \
78+
# Give all user execute permissions and remove write permissions for others
79+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
8080
# intialize powershell module cache
8181
&& pwsh \
8282
-NoLogo \

release/community-stable/parrot/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ RUN \
6969
&& apt-get install -y /tmp/powershell.deb \
7070
# remove powershell package
7171
&& rm -f /tmp/powershell.deb \
72-
# Give all user execute permissions
73-
&& chmod a+x ${PS_INSTALL_FOLDER}/pwsh \
72+
# Give all user execute permissions and remove write permissions for others
73+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
7474
# intialize powershell module cache
7575
&& pwsh \
7676
-NoLogo \

release/community-stable/photon/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ RUN \
7979
&& locale-gen.sh \
8080
# create the pwsh symbolic link that points to powershell
8181
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
82-
# Give all user execute permissions
83-
&& chmod a+x ${PS_INSTALL_FOLDER}/pwsh \
82+
# Give all user execute permissions and remove write permissions for others
83+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
8484
# intialize powershell module cache
8585
&& pwsh \
8686
-NoLogo \

release/preview/alpine/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ RUN apk add --no-cache \
7070
\
7171
# Create the pwsh-preview symbolic link that points to powershell
7272
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \
73-
# Give all user execute permissions
74-
&& chmod a+x ${PS_INSTALL_FOLDER}/pwsh \
73+
# Give all user execute permissions and remove write permissions for others
74+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
7575
# intialize powershell module cache
7676
&& pwsh \
7777
-NoLogo \

release/preview/opensuse423/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ RUN zypper --non-interactive update --skip-interactive \
6464
# Create the pwsh symbolic link that points to powershell
6565
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
6666
&& ln -sf ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \
67-
# Give all user execute permissions
68-
&& chmod a+x ${PS_INSTALL_FOLDER}/pwsh \
67+
# Give all user execute permissions and remove write permissions for others
68+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
6969
# clean package manager cache
7070
&& zypper clean -a \
7171
# remove package manager log file

release/servicing/alpine/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ RUN apk add --no-cache \
6767
\
6868
# Create the pwsh symbolic link that points to powershell
6969
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
70-
# Give all user execute permissions
71-
&& chmod a+x ${PS_INSTALL_FOLDER}/pwsh \
70+
# Give all user execute permissions and remove write permissions for others
71+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
7272
# intialize powershell module cache
7373
&& pwsh \
7474
-NoLogo \

release/servicing/opensuse423/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ RUN zypper --non-interactive update --skip-interactive \
6363
&& localedef --charmap=UTF-8 --inputfile=en_US $LANG \
6464
# Create the pwsh symbolic link that points to powershell
6565
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
66-
# Give all user execute permissions
67-
&& chmod a+x ${PS_INSTALL_FOLDER}/pwsh \
66+
# Give all user execute permissions and remove write permissions for others
67+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
6868
# clean package manager cache
6969
&& zypper clean -a \
7070
# remove package manager log file

release/stable/alpine/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ RUN apk add --no-cache \
6767
\
6868
# Create the pwsh symbolic link that points to powershell
6969
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
70-
# Give all user execute permissions
71-
&& chmod a+x ${PS_INSTALL_FOLDER}/pwsh \
70+
# Give all user execute permissions and remove write permissions for others
71+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
7272
# intialize powershell module cache
7373
&& pwsh \
7474
-NoLogo \

release/stable/opensuse423/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ RUN zypper --non-interactive update --skip-interactive \
6363
&& localedef --charmap=UTF-8 --inputfile=en_US $LANG \
6464
# Create the pwsh symbolic link that points to powershell
6565
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
66-
# Give all user execute permissions
67-
&& chmod a+x ${PS_INSTALL_FOLDER}/pwsh \
66+
# Give all user execute permissions and remove write permissions for others
67+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
6868
# clean package manager cache
6969
&& zypper clean -a \
7070
# remove package manager log file

0 commit comments

Comments
 (0)