[Pkg-salt-team] Bug#944970: Bug#944970: salt: Modules access internal dpkg databases

Benjamin Drung benjamin.drung at cloud.ionos.com
Fri Oct 16 16:05:22 BST 2020


forwarded 944970 https://github.com/saltstack/salt/issues/52605
thanks

Am Sonntag, den 17.11.2019, 22:52 +0100 schrieb Guillem Jover:
> This package contains modules («salt/modules/dpkg.py» and
> «salt/modules/alternatives.py»), which directly access the dpkg
> internal database, instead of using one of the public interfaces
> provided by dpkg.
> 
> In «salt/modules/dpkg.py» module, the function
> _get_pkg_install_time()
> should be switched to use something like:
> 
>   «dpkg-query --showformat '${Package} ${db-fsys:Last-Modified}\n' --
> show $pkg»
> 
> to get the mtime from .list files.
> 
> The function _get_pkg_ds_avail(), should be switched to use something
> like:
> 
>   «dpkg-query --print-avail»
> 
> to get the available database dump.
> 
> In the «salt/modules/alternatives.py», the show_link() function
> should
> be switched to something like:
> 
>   «update-alternatives --query $name»
> 
> 
> This is a problem for several reasons, because even though the layout
> and
> format of the dpkg database is administrator friendly, and it is
> expected
> that those might need to mess with it, in case of emergency, this
> “interface” does not extend to other programs besides the dpkg suite
> of
> tools. The admindir can also be configured differently at dpkg build
> or
> run-time. And finally, the contents and its format, will be changing
> in
> the near future.

Thanks for this bug report with the detailed replacement commands. That
helped changing the salt code. I submitted two merge request upstream:

dpkg_lowpkg: https://github.com/saltstack/salt/pull/58735
alternatives: https://github.com/saltstack/salt/pull/58745

I will give upstream some time to review before applying these patches
to the Debian package.

-- 
Benjamin Drung

DevOps Engineer and Debian & Ubuntu Developer
Platform Integration (IONOS Cloud)

1&1 IONOS SE | Greifswalder Str. 207 | 10405 Berlin | Germany
E-mail: benjamin.drung at cloud.ionos.com | Web: www.ionos.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 24498

Vorstand: Dr. Christian Böing, Hüseyin Dogan, Dr. Martin Endreß, Hans-
Henning Kettler, Arthur Mai, Matthias Steinberg, Achim Weiß
Aufsichtsratsvorsitzender: Markus Kadelke


Member of United Internet



More information about the pkg-salt-team mailing list