[Merge] ~mitchburton/ubuntu/+source/landscape-client:ubuntu/lunar-devel into ubuntu/+source/landscape-client:ubuntu/lunar-devel
Andreas Hasenack
mp+437634 at code.launchpad.net
Thu Feb 23 20:43:38 UTC 2023
Diff comments:
> diff --git a/debian/landscape-client.postrm b/debian/landscape-client.postrm
> index a436e39..10f79b8 100644
> --- a/debian/landscape-client.postrm
> +++ b/debian/landscape-client.postrm
> @@ -28,6 +29,8 @@ case "$1" in
> rm -f "${LOG_DIR}/package-reporter.log"*
> rm -f "${LOG_DIR}/package-changer.log"*
>
> + rm -f "${GPG_DIR}/landscape-server"*.asc
I understand this is using globbing because of the random suffix that the landscape-server gpg key filename gets, but isn't there a risk here that we could be deleting another gpg key that isn't strictly ours? Perhaps someone is hosting LDS on premises, and named the key that signs their local repository `landscape-server-mycompany.asc`?
> +
> rm -rf "${DATA_DIR}/client"
> rm -rf "${DATA_DIR}/.gnupg"
>
> diff --git a/landscape/client/manager/aptsources.py b/landscape/client/manager/aptsources.py
> index 649569b..866c6ba 100644
> --- a/landscape/client/manager/aptsources.py
> +++ b/landscape/client/manager/aptsources.py
> @@ -83,16 +85,12 @@ class AptSources(ManagerPlugin):
> "-----END PGP PUBLIC KEY BLOCK-----"]}
> """
> deferred = succeed(None)
> + prefix = 'landscape-server-'
> for key in message["gpg-keys"]:
> - fd, path = tempfile.mkstemp()
> - os.close(fd)
> - with open(path, "w") as key_file:
> + filename = prefix + str(uuid.uuid4()) + '.asc'
Why a random name for the landscape-server gpg key file?
> + key_path = os.path.join(self.TRUSTED_GPG_D, filename)
> + with open(key_path, "w") as key_file:
> key_file.write(key)
> - deferred.addCallback(
> - lambda ignore, path=path:
> - self._run_process("/usr/bin/apt-key", ["add", path]))
> - deferred.addCallback(self._handle_process_error)
> - deferred.addBoth(self._remove_and_continue, path)
> deferred.addErrback(self._handle_process_failure)
> deferred.addCallback(self._handle_sources, message["sources"])
> return self.call_with_operation_result(message, lambda: deferred)
--
https://code.launchpad.net/~mitchburton/ubuntu/+source/landscape-client/+git/landscape-client/+merge/437634
Your team Ubuntu Sponsors Team is requested to review the proposed merge of ~mitchburton/ubuntu/+source/landscape-client:ubuntu/lunar-devel into ubuntu/+source/landscape-client:ubuntu/lunar-devel.
More information about the Ubuntu-sponsors
mailing list