public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Stefan Reiter <s.reiter@proxmox.com>
Subject: Re: [pbs-devel] [PATCH v2 proxmox-backup 2/2] d/postinst: always fixup termproxy user id and for all users
Date: Tue, 1 Sep 2020 15:21:21 +0200	[thread overview]
Message-ID: <7470c3f8-ab4c-67e3-42ac-bc0d969e6169@proxmox.com> (raw)
In-Reply-To: <20200901122728.12566-2-s.reiter@proxmox.com>

On 01.09.20 14:27, Stefan Reiter wrote:
> Anyone with a PAM account and Sys.Console access could have started a
> termproxy session, adapt the regex.
> 
> Always run the sed expression to make sure eventually all occurences of
> the broken syntax are fixed.
> 
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
> 
> v2: new patch
> 
> This one is definitely necessary though, as otherwise broken entries will just
> remain forever. This way they'll at least be fixed up eventually at some
> upgrade (and for all users, not just root@pam).
> 
>  debian/postinst | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/debian/postinst b/debian/postinst
> index 9ab78798..bc414ccb 100644
> --- a/debian/postinst
> +++ b/debian/postinst
> @@ -15,12 +15,8 @@ case "$1" in
>  	fi
>  	deb-systemd-invoke $_dh_action proxmox-backup.service proxmox-backup-proxy.service >/dev/null || true
>  
> -	if test -n "$2"; then
> -		if dpkg --compare-versions "$2" 'le' '0.8.10-1'; then
> -			echo "Fixing up termproxy user id in task log..."
> -			flock -w 30 /var/log/proxmox-backup/tasks/active.lock sed -i 's/:termproxy::root: /:termproxy::root@pam: /' /var/log/proxmox-backup/tasks/active
> -		fi
> -	fi
> +	echo "Fixing up termproxy user id in task log..."
> +	flock -w 30 /var/log/proxmox-backup/tasks/active.lock sed -i 's/:termproxy::\([^@]\+\): /:termproxy::\1@pam: /' /var/log/proxmox-backup/tasks/active

I mean, guard it at least with a grep, so that this log and the flock only gets called
when required..

And anyway, this is a beta, why adding already that much legacy handling code
here? I mean if the old fixup worked, OK, that wasn't much, but this is gets
ugly fast, quite inclined to NAK it altogether...

Why not just document (i.e., post it as reply in the forum) the sed command, and
refer to it if a user runs into this?
Much simpler and avoids adding cruft already now.





      reply	other threads:[~2020-09-01 13:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 12:27 [pbs-devel] [PATCH v2 proxmox-backup 1/2] upid: add workaround for parsing broken termproxy userids Stefan Reiter
2020-09-01 12:27 ` [pbs-devel] [PATCH v2 proxmox-backup 2/2] d/postinst: always fixup termproxy user id and for all users Stefan Reiter
2020-09-01 13:21   ` Thomas Lamprecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7470c3f8-ab4c-67e3-42ac-bc0d969e6169@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=s.reiter@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal