[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] Fix install.sh for systemd


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Olaf Hering <olaf@xxxxxxxxx>
  • Date: Fri, 12 May 2023 13:18:19 +0200
  • Arc-authentication-results: i=1; strato.com; arc=none; dkim=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1683890313; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=tigSnCt6TQ+e8MtVlCi7/8cx0Lj8IuTBbKJnyQt5R9A=; b=LVpkvAGQjOlKwXktpKmA7wDt7CqCtc4Uq9Xz9KTS57bpP8kdH0yRtlJJQjxB3NXxP6 C7/xkL8zP2BpknsFVleJF390C7VaC3VUA+CzNTiF+hu2nHSZFN1+mNnT+WanF9Q4d6hm VmMyvrupmmexpRy2cLub6kk2KWu2Q9EfWdqpnZGfHTGDVADb+bPoojo2f6pS+8fZuU6O of7TfnubFVyONlq9tKtQB6hmJfBwC9aZSIE3cfrEsd7NLr9x+djzVnsgy0AOriWXbgQS p9uhYBmLuadbn+jLC+sle6EHT5HYFVTPOnLPEE4XAPdUuu6+Bb3WSfqaFrrIy9FQAW16 TwAQ==
  • Arc-seal: i=1; a=rsa-sha256; t=1683890313; cv=none; d=strato.com; s=strato-dkim-0002; b=FRe3TEsviGbwhVJHmGWu8+4MSEgkw3T0lAC2syXgRI1nGIqq4IFHA7nDWfp5zn0XGQ O5BzPCqdZVs6nyvvGOKjM66fhLQwN7GZw1Q3YU+q+4VzeKeaUrwTYAvqaJvSjcbxVH6e 32/MhSugwJcx6icbAoSRkuTrHxdLc0PgaayPeO9YHmh6gb/JtQLy+FAUvDrmFe7kzDua 6pBVen1s7R0KHbZ8oKMiTCt8h5lOjeRl35dS9R7HqLsJ2G5jrZPjPSaCNfCpBTnAelGO 7CHdcp0xUYOMj79BBgnN4ET/xNQcmoDwXioMoelkK4Yu2IBCNcAnxZz/IkM2x0u6ZmgG v6XQ==
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Jason Andryuk <jandryuk@xxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Fri, 12 May 2023 11:19:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Tue, 9 May 2023 13:47:11 +0100 Andrew Cooper <andrew.cooper3@xxxxxxxxxx>:

> Why is this 700, and the others just using regular perms?
> Also, doesn't it want quoting like the other examples too?

It is not clear why there is a single mkdir -m 0700 in the tree.
Most likely it will not give any extra security.

The scripts source hotplug.sh, which defines a variable XEN_RUN_DIR.
I think it is better to use the shell variable instead of hardcoded paths.

Regarding quoting: there are many paths used without quoting.
For the beauty an additional (huge) change could be done to quote
everything. Not sure if it is worth the effort...

I will post a v3 with this relative change:

--- a/tools/hotplug/FreeBSD/rc.d/xencommons.in
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons.in
@@ -34,7 +34,7 @@ xen_startcmd()
        local time=0
        local timeout=30
 
-       mkdir -p "@XEN_RUN_DIR@"
+       mkdir -p "${XEN_RUN_DIR}"
        xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} ${XENSTORED})
        if test -z "$xenstored_pid"; then
                printf "Starting xenservices: xenstored, xenconsoled."
--- a/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
+++ b/tools/hotplug/FreeBSD/rc.d/xendriverdomain.in
@@ -27,7 +27,7 @@ xendriverdomain_start()
 {
        printf "Starting xenservices: xl devd."
 
-       mkdir -p "@XEN_RUN_DIR@"
+       mkdir -p "${XEN_RUN_DIR}"
        PATH="${bindir}:${sbindir}:$PATH" ${sbindir}/xl devd --pidfile 
${XLDEVD_PIDFILE} ${XLDEVD_ARGS}
 
        printf "\n"
--- a/tools/hotplug/Linux/init.d/xendriverdomain.in
+++ b/tools/hotplug/Linux/init.d/xendriverdomain.in
@@ -49,7 +49,7 @@ fi
 
 do_start () {
        echo Starting xl devd...
-       mkdir -m700 -p @XEN_RUN_DIR@
+       mkdir -p "${XEN_RUN_DIR}"
        ${sbindir}/xl devd --pidfile=$XLDEVD_PIDFILE $XLDEVD_ARGS
 }
 do_stop () {
--- a/tools/hotplug/NetBSD/rc.d/xendriverdomain.in
+++ b/tools/hotplug/NetBSD/rc.d/xendriverdomain.in
@@ -23,7 +23,7 @@ XLDEVD_PIDFILE="@XEN_RUN_DIR@/xldevd.pid"
 
 xendriverdomain_precmd()
 {
-       mkdir -p "@XEN_RUN_DIR@"
+       mkdir -p "${XEN_RUN_DIR}"
 }
 
 xendriverdomain_startcmd()

Attachment: pgpEbDcfC0R8R.pgp
Description: Digitale Signatur von OpenPGP


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.