Bug#932644: reconfigure writes to /usr/lib/locale/locale-archive

2019-07-24 Thread Aurelien Jarno
On 2019-07-24 12:38, Marc Haber wrote:
> On Mon, Jul 22, 2019 at 07:20:42PM +0200, Aurelien Jarno wrote:
> > On 2019-07-21 17:11, Marc Haber wrote:
> > > Package: locales
> > > Version: 2.28-10
> > > Severity: minor
> > > 
> > > Hi,
> > > 
> > > reconfiguring the locales package updates the file
> > > /usr/lib/locale/locale-archive.
> > 
> > This is indeed where the libc looks for the compiled locales.
> 
> And it wouldn't follow a symlink to /var/lib/locale/locale-archive,
> where variable data would belong?

As said in my previous mail, those are not variable data, I do not see
the point of moving them to /var. They are only modified when the 
locales postinst script is run.

> > > I am not sure whether this is allowed by policy, hence severity: minor.
> > 
> > I do not find anything that prevents that in the policy. In addition
> > many other packages are also writing files to /usr when they are
> > configured (for example __pycache__ files or the various kernel
> > modules.* files used by depmod, udev hwdb.bin, etc.).
> 
> But they only do that on package installation. And: "look, how bad the
> neighbor is" is hardly an excuse. I happened to stumble upon that in
> locales, and it's the first time that I actually noticed that.

They do that exactly in the same situation than the locales postinst, ie
when the package is (re)configured. There is nothing in the policy
forbidding that. We can open a bug against the policy to confirm or
infirm that.

> > > Maybe this file would better be in /var.
> > 
> > /var is for files whose content is expected to continually change during
> > normal operation of the system. This is not the case of the
> > locale-archive file which doesn't change until the next reconfiguration
> > of the package. As such it doesn't prevent for example mounting the / or
> > /usr partition read-only once apt or dpkg have finished their work.
> 
> You're of course entitled to your opinion and I respect the decision.
> 
> Just assume:
> 
> - ansible/puppet/salt etc has a /etc/locale.gen which for some reason
>   doesn't have the current set of comments
> - a handler calls dpkg-reconfigure locales to handle the change in
>   /etc/locale.gen
> - locales rewrites /etc/locale.gen with the current set of comments
> - ansible/puppet/salt runs again, notices that /etc/locale.gen is not as
>   it should be according to its opinion
> - repeat starting with step 1

Looks like that is for the wrong bug report...

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net



Bug#932644: reconfigure writes to /usr/lib/locale/locale-archive

2019-07-24 Thread Marc Haber
On Mon, Jul 22, 2019 at 07:20:42PM +0200, Aurelien Jarno wrote:
> On 2019-07-21 17:11, Marc Haber wrote:
> > Package: locales
> > Version: 2.28-10
> > Severity: minor
> > 
> > Hi,
> > 
> > reconfiguring the locales package updates the file
> > /usr/lib/locale/locale-archive.
> 
> This is indeed where the libc looks for the compiled locales.

And it wouldn't follow a symlink to /var/lib/locale/locale-archive,
where variable data would belong?

> > I am not sure whether this is allowed by policy, hence severity: minor.
> 
> I do not find anything that prevents that in the policy. In addition
> many other packages are also writing files to /usr when they are
> configured (for example __pycache__ files or the various kernel
> modules.* files used by depmod, udev hwdb.bin, etc.).

But they only do that on package installation. And: "look, how bad the
neighbor is" is hardly an excuse. I happened to stumble upon that in
locales, and it's the first time that I actually noticed that.

> > Maybe this file would better be in /var.
> 
> /var is for files whose content is expected to continually change during
> normal operation of the system. This is not the case of the
> locale-archive file which doesn't change until the next reconfiguration
> of the package. As such it doesn't prevent for example mounting the / or
> /usr partition read-only once apt or dpkg have finished their work.

You're of course entitled to your opinion and I respect the decision.

Just assume:

- ansible/puppet/salt etc has a /etc/locale.gen which for some reason
  doesn't have the current set of comments
- a handler calls dpkg-reconfigure locales to handle the change in
  /etc/locale.gen
- locales rewrites /etc/locale.gen with the current set of comments
- ansible/puppet/salt runs again, notices that /etc/locale.gen is not as
  it should be according to its opinion
- repeat starting with step 1

locales' current behavior forces people to have the /etc/locale.gen file
with current comments in the configuraiton management code, and possible
to have this "current" differently according to whether we have
oldoldstable, oldstable, stable, testing od unstable. This is
unnecessary work and might cause unnecessary issues.

Please reconsider.

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



Bug#932644: reconfigure writes to /usr/lib/locale/locale-archive

2019-07-22 Thread Aurelien Jarno
On 2019-07-21 17:11, Marc Haber wrote:
> Package: locales
> Version: 2.28-10
> Severity: minor
> 
> Hi,
> 
> reconfiguring the locales package updates the file
> /usr/lib/locale/locale-archive.

This is indeed where the libc looks for the compiled locales.

> I am not sure whether this is allowed by policy, hence severity: minor.

I do not find anything that prevents that in the policy. In addition
many other packages are also writing files to /usr when they are
configured (for example __pycache__ files or the various kernel
modules.* files used by depmod, udev hwdb.bin, etc.).

> Maybe this file would better be in /var.

/var is for files whose content is expected to continually change during
normal operation of the system. This is not the case of the
locale-archive file which doesn't change until the next reconfiguration
of the package. As such it doesn't prevent for example mounting the / or
/usr partition read-only once apt or dpkg have finished their work.

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net



Bug#932644: reconfigure writes to /usr/lib/locale/locale-archive

2019-07-21 Thread Marc Haber
Package: locales
Version: 2.28-10
Severity: minor

Hi,

reconfiguring the locales package updates the file
/usr/lib/locale/locale-archive.

I am not sure whether this is allowed by policy, hence severity: minor.
Maybe this file would better be in /var.

Greetings
Marc

-- System Information:
Debian Release: 10.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.2.1-zgsrv20080 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8), LANGUAGE=en 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages locales depends on:
ii  debconf [debconf-2.0]  1.5.71
ii  libc-bin   2.28-10
ii  libc-l10n  2.28-10

locales recommends no packages.

locales suggests no packages.

-- debconf information:
* locales/locales_to_be_generated: de_DE.UTF-8 UTF-8, en_US.UTF-8 UTF-8
* locales/default_environment_locale: en_US.UTF-8