mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] scripts/lib/ptxd_make: fix image root permission, don't leak user's umask
@ 2017-03-08 11:23 Marc Kleine-Budde
  2017-03-10  9:42 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Kleine-Budde @ 2017-03-08 11:23 UTC (permalink / raw)
  To: ptxdist; +Cc: Marc Kleine-Budde

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 scripts/lib/ptxd_make_image_genimage.sh         | 2 +-
 scripts/lib/ptxd_make_image_prepare_work_dir.sh | 2 +-
 scripts/lib/ptxd_make_xpkg_prepare.sh           | 5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/ptxd_make_image_genimage.sh b/scripts/lib/ptxd_make_image_genimage.sh
index 2112875e4f4d..b4a8e9de222e 100644
--- a/scripts/lib/ptxd_make_image_genimage.sh
+++ b/scripts/lib/ptxd_make_image_genimage.sh
@@ -56,7 +56,7 @@ ptxd_make_image_genimage_impl() {
     ptxd_make_image_genimage_config "${1}" &&
 
     rm -rf "${pkg_dir}" &&
-    mkdir -p "${pkg_dir}" &&
+    install -m 755 -d "${pkg_dir}" &&
     for file in ${image_files}; do
 	ptxd_make_extract_archive "${file}" "${pkg_dir}"
     done &&
diff --git a/scripts/lib/ptxd_make_image_prepare_work_dir.sh b/scripts/lib/ptxd_make_image_prepare_work_dir.sh
index 2b8f10a81a1d..84a6ca8dbcae 100644
--- a/scripts/lib/ptxd_make_image_prepare_work_dir.sh
+++ b/scripts/lib/ptxd_make_image_prepare_work_dir.sh
@@ -51,7 +51,7 @@ ${list[*]}
     fi
 
     rm -rf "${work_dir}" &&
-    mkdir -p "${work_dir}" &&
+    install -m 755 -d "${work_dir}" &&
 
     ARCH="${PTXDIST_IPKG_ARCH_STRING}" \
     SRC="" \
diff --git a/scripts/lib/ptxd_make_xpkg_prepare.sh b/scripts/lib/ptxd_make_xpkg_prepare.sh
index 5619373045d3..f473375e7f78 100644
--- a/scripts/lib/ptxd_make_xpkg_prepare.sh
+++ b/scripts/lib/ptxd_make_xpkg_prepare.sh
@@ -58,7 +58,7 @@ ptxd_make_xpkg_prepare() {
 	"${pkg_xpkg_cmds}" \
 	"${pkg_xpkg_perms}" \
 	"${pkg_xpkg_install_deps}" &&
-    mkdir -p -- "${pkg_xpkg_control_dir}" &&
+    install -m 755 -d -- "${pkg_xpkg_control_dir}" &&
     touch "${pkg_xpkg_perms}" &&
     touch "${pkg_xpkg_cmds}" || return
 
@@ -82,7 +82,8 @@ install_init:	@DEPENDS@ -> ${dep}"
 	VERSION="${pkg_xpkg_version}" \
 	DEPENDS="${dep}" \
 	ptxd_replace_magic "${PTXDIST_TOPDIR}/config/xpkg/ipkg.control" > \
-	"${pkg_xpkg_control}" || return
+	"${pkg_xpkg_control}" &&
+	chmod 644 "${pkg_xpkg_control}" || return
 
     local script
     for script in preinst postinst prerm postrm; do
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [PATCH] scripts/lib/ptxd_make: fix image root permission, don't leak user's umask
  2017-03-08 11:23 [ptxdist] [PATCH] scripts/lib/ptxd_make: fix image root permission, don't leak user's umask Marc Kleine-Budde
@ 2017-03-10  9:42 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2017-03-10  9:42 UTC (permalink / raw)
  To: ptxdist

On Wed, Mar 08, 2017 at 12:23:05PM +0100, Marc Kleine-Budde wrote:
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Thanks, applied,

Michael

> ---
>  scripts/lib/ptxd_make_image_genimage.sh         | 2 +-
>  scripts/lib/ptxd_make_image_prepare_work_dir.sh | 2 +-
>  scripts/lib/ptxd_make_xpkg_prepare.sh           | 5 +++--
>  3 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/lib/ptxd_make_image_genimage.sh b/scripts/lib/ptxd_make_image_genimage.sh
> index 2112875e4f4d..b4a8e9de222e 100644
> --- a/scripts/lib/ptxd_make_image_genimage.sh
> +++ b/scripts/lib/ptxd_make_image_genimage.sh
> @@ -56,7 +56,7 @@ ptxd_make_image_genimage_impl() {
>      ptxd_make_image_genimage_config "${1}" &&
>  
>      rm -rf "${pkg_dir}" &&
> -    mkdir -p "${pkg_dir}" &&
> +    install -m 755 -d "${pkg_dir}" &&
>      for file in ${image_files}; do
>  	ptxd_make_extract_archive "${file}" "${pkg_dir}"
>      done &&
> diff --git a/scripts/lib/ptxd_make_image_prepare_work_dir.sh b/scripts/lib/ptxd_make_image_prepare_work_dir.sh
> index 2b8f10a81a1d..84a6ca8dbcae 100644
> --- a/scripts/lib/ptxd_make_image_prepare_work_dir.sh
> +++ b/scripts/lib/ptxd_make_image_prepare_work_dir.sh
> @@ -51,7 +51,7 @@ ${list[*]}
>      fi
>  
>      rm -rf "${work_dir}" &&
> -    mkdir -p "${work_dir}" &&
> +    install -m 755 -d "${work_dir}" &&
>  
>      ARCH="${PTXDIST_IPKG_ARCH_STRING}" \
>      SRC="" \
> diff --git a/scripts/lib/ptxd_make_xpkg_prepare.sh b/scripts/lib/ptxd_make_xpkg_prepare.sh
> index 5619373045d3..f473375e7f78 100644
> --- a/scripts/lib/ptxd_make_xpkg_prepare.sh
> +++ b/scripts/lib/ptxd_make_xpkg_prepare.sh
> @@ -58,7 +58,7 @@ ptxd_make_xpkg_prepare() {
>  	"${pkg_xpkg_cmds}" \
>  	"${pkg_xpkg_perms}" \
>  	"${pkg_xpkg_install_deps}" &&
> -    mkdir -p -- "${pkg_xpkg_control_dir}" &&
> +    install -m 755 -d -- "${pkg_xpkg_control_dir}" &&
>      touch "${pkg_xpkg_perms}" &&
>      touch "${pkg_xpkg_cmds}" || return
>  
> @@ -82,7 +82,8 @@ install_init:	@DEPENDS@ -> ${dep}"
>  	VERSION="${pkg_xpkg_version}" \
>  	DEPENDS="${dep}" \
>  	ptxd_replace_magic "${PTXDIST_TOPDIR}/config/xpkg/ipkg.control" > \
> -	"${pkg_xpkg_control}" || return
> +	"${pkg_xpkg_control}" &&
> +	chmod 644 "${pkg_xpkg_control}" || return
>  
>      local script
>      for script in preinst postinst prerm postrm; do
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-10  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-08 11:23 [ptxdist] [PATCH] scripts/lib/ptxd_make: fix image root permission, don't leak user's umask Marc Kleine-Budde
2017-03-10  9:42 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox