Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1280958 > unrolled thread

Bug#1127102: emacs-common: odd behaviour around /usr/local in postinst

Started bySimon McVittie <smcv@debian.org>
First post2026-02-06 11:20 +0100
Last post2026-04-17 03:00 +0200
Articles 6 — 4 participants

Back to article view | Back to linux.debian.bugs.dist


Contents

  Bug#1127102: emacs-common: odd behaviour around /usr/local in postinst Simon McVittie <smcv@debian.org> - 2026-02-06 11:20 +0100
    Bug#1127102: Add patch Arto Jantunen <viiru@debian.org> - 2026-04-05 09:40 +0200
    Bug#1127102: Add patch Rob Browning <rlb@defaultvalue.org> - 2026-04-05 18:30 +0200
    Bug#1127102: Add patch Xiyue Deng <manphiz@gmail.com> - 2026-04-08 17:10 +0200
      Bug#1127102: Add patch Rob Browning <rlb@defaultvalue.org> - 2026-04-14 04:30 +0200
        Bug#1127102: Add patch Rob Browning <rlb@defaultvalue.org> - 2026-04-17 03:00 +0200

#1280958 — Bug#1127102: emacs-common: odd behaviour around /usr/local in postinst

FromSimon McVittie <smcv@debian.org>
Date2026-02-06 11:20 +0100
SubjectBug#1127102: emacs-common: odd behaviour around /usr/local in postinst
Message-ID<Mlr6p-g8b8-7@gated-at.bofh.it>
Package: emacs-common
Version: 1:30.2+1-2
Severity: normal
User: smcv@debian.org
Usertags: dh-usrlocal

Prompted by recent changes in fontconfig's handling of 
/usr/local/share/fonts, I noticed that emacs-common's postinst has some 
open-coded script to create directories below /usr/local/share/, with 
non-Policy-compliant permissions (unconditionally root:staff, instead of 
preferring root:root).

This is mitigated by the fact that it doesn't actually seem to work as 
intended: on a first installation, /usr/local/share/emacs doesn't yet 
exist, and therefore /usr/local/share/emacs/30.2 isn't created below it 
with the wrong permissions. There is probably some sequence of events 
that would result in /usr/local/share/emacs/30.2 being created as 
root:staff, but I couldn't work out what it is!

Please consider using dh_usrlocal(1) for this, as is already done for 
/usr/local/share/emacs/site-lisp: that way, any implementation bugs can 
be fixed centrally in debhelper, and they will take effect in all 
packages that use dh_usrlocal at the next rebuild.

The procedure to do that would be something like:

1. create debian/emacs-common/usr/local/share/emacs/VERSION/site-lisp,
   for example with some `install -d` in d/rules
2. remove open-coded logic in maintainer scripts to create and remove
   the various /usr/local directories, relying on dh_usrlocal to do it

Or if /usr/local/share/emacs/VERSION/site-lisp isn't necessary in 
practice, perhaps emacs-common could just not create it?

Thanks,
    smcv

[toc] | [next] | [standalone]


#1288511 — Bug#1127102: Add patch

FromArto Jantunen <viiru@debian.org>
Date2026-04-05 09:40 +0200
SubjectBug#1127102: Add patch
Message-ID<MGqfo-cPnS-1@gated-at.bofh.it>
In reply to#1280958

[Multipart message — attachments visible in raw view] — view raw

Control: tags -1 +patch

Attached is a patch to fully convert emacs-common to use dh_usrlocal,
producing the expected set of directories with the expected permissions.
The change is affected mostly by removing the hand-written, duplicated
and not-quite-working directory creation code in postinst and prerm.

[toc] | [prev] | [next] | [standalone]


#1288543 — Bug#1127102: Add patch

FromRob Browning <rlb@defaultvalue.org>
Date2026-04-05 18:30 +0200
SubjectBug#1127102: Add patch
Message-ID<MGywh-cULP-3@gated-at.bofh.it>
In reply to#1280958
Sean Whitton <spwhitton@spwhitton.name> writes:

> Rob, Xiyue, perhaps you could review.

Sure.  I'll plan to take a look this week.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4

[toc] | [prev] | [next] | [standalone]


#1288875 — Bug#1127102: Add patch

FromXiyue Deng <manphiz@gmail.com>
Date2026-04-08 17:10 +0200
SubjectBug#1127102: Add patch
Message-ID<MHCHw-dCTC-9@gated-at.bofh.it>
In reply to#1280958

[Multipart message — attachments visible in raw view] — view raw

Sean Whitton <spwhitton@spwhitton.name> writes:

> Arto Jantunen <viiru@debian.org> [05/Apr 10:32am +03] wrote:
>> Control: tags -1 +patch
>>
>> Attached is a patch to fully convert emacs-common to use dh_usrlocal,
>> producing the expected set of directories with the expected permissions.
>> The change is affected mostly by removing the hand-written, duplicated
>> and not-quite-working directory creation code in postinst and prerm.
>>
>> From f3773414c9370a454c021538cc5aeef11137535d Mon Sep 17 00:00:00 2001
>> From: Arto Jantunen <viiru@debian.org>
>> Date: Sat, 4 Apr 2026 19:59:44 +0300
>> Subject: [PATCH] Fully convert to dh_usrlocal (Closes: #1127102)
>
> Wow, nice!
>
> Rob, Xiyue, perhaps you could review.

This looks much cleaner and seems to do the job as expected. Will check
out Rob's more authoritative review later of course.

-- 
Regards,
Xiyue Deng

[toc] | [prev] | [next] | [standalone]


#1289479 — Bug#1127102: Add patch

FromRob Browning <rlb@defaultvalue.org>
Date2026-04-14 04:30 +0200
SubjectBug#1127102: Add patch
Message-ID<MJBHj-eYei-1@gated-at.bofh.it>
In reply to#1288875
Xiyue Deng <manphiz@gmail.com> writes:

> This looks much cleaner and seems to do the job as expected. Will check
> out Rob's more authoritative review later of course.

Clearly, I didn't get to earlier, but I should have time later this
week.

Thanks, and thanks for taking a look too.
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4

[toc] | [prev] | [next] | [standalone]


#1289895 — Bug#1127102: Add patch

FromRob Browning <rlb@defaultvalue.org>
Date2026-04-17 03:00 +0200
SubjectBug#1127102: Add patch
Message-ID<MKFIR-fIeH-1@gated-at.bofh.it>
In reply to#1289479
Rob Browning <rlb@defaultvalue.org> writes:

> Clearly, I didn't get to earlier, but I should have time later this
> week.

OK, I've added that locally, so it'll be in the next version.

Thanks for the help.
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web