Debian Bug report logs - #900612
apache2-suexec-pristine: Packaging steps undo setting of setuid bit

version graph

Package: apache2-suexec-pristine; Maintainer for apache2-suexec-pristine is Debian Apache Maintainers <[email protected]>; Source for apache2-suexec-pristine is src:apache2 (PTS, buildd, popcon).

Reported by: Jason Perrin <[email protected]>

Date: Sat, 2 Jun 2018 00:18:01 UTC

Severity: normal

Tags: patch

Found in version apache2/2.4.25-3+deb9u4

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Debian Apache Maintainers <[email protected]>:
Bug#900612; Package apache2-suexec-pristine. (Sat, 02 Jun 2018 00:18:04 GMT) (full text, mbox, link).


Acknowledgement sent to Jason Perrin <[email protected]>:
New Bug report received and forwarded. Copy sent to Debian Apache Maintainers <[email protected]>. (Sat, 02 Jun 2018 00:18:04 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Jason Perrin <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: apache2-suexec-pristine: Packaging steps undo setting of setuid bit
Date: Fri, 01 Jun 2018 17:06:10 -0700
Package: apache2-suexec-pristine
Version: 2.4.25-3+deb9u4
Severity: normal
Tags: patch
Justification: fails to build from source (but built successfully in the past)

Dear Maintainer,

When building the apache2-suexec-pristine (and apache2-suexec-custom) packages
from source, I expected the built .deb packages to contain setuid binaries
(at /usr/lib/apache2/suexec-pristine and /usr/lib/apache2/suexec-custom
respectively). However, when packaging was done, the packages contained
binaries with the permissions 0754, not 4754, as set in the debian/rules file.

Looking into this more, it appears that chgrp (through the chown system call)
clears the setuid bit (and all bits in the first octet of permissions) when it
is run, so the steps in override_dh_fixperms-arch end up removing the setuid
bit when chgrp is run after chmod.

This appears to be a problem in the source for this package, on the master
branch, as well as on separate branches for different distros:
https://salsa.debian.org/apache-team/apache2/blob/master/debian/rules#L148-153
I'm not sure how this has worked properly to produce packages, since the last
change to that section was 6 years ago, so I'm a bit confused on that point.

Here is a patch to fix the setting of the setuid bit in both packages by just
moving the chmod to after chgrp has already run:

--- debian/rules
+++ debian/rules
@@ -146,11 +146,11 @@ override_dh_install: clean-config-vars-stamp \

 override_dh_fixperms-arch:
        # standard suexec
-       chmod 4754 debian/apache2-suexec-pristine/usr/lib/apache2/suexec-pristine
        chgrp www-data debian/apache2-suexec-pristine/usr/lib/apache2/suexec-pristine
+       chmod 4754 debian/apache2-suexec-pristine/usr/lib/apache2/suexec-pristine
        # configurable suexec
-       chmod 4754 debian/apache2-suexec-custom/usr/lib/apache2/suexec-custom
        chgrp www-data debian/apache2-suexec-custom/usr/lib/apache2/suexec-custom
+       chmod 4754 debian/apache2-suexec-custom/usr/lib/apache2/suexec-custom
        dh_fixperms -a -Xusr/lib/apache2/suexec-custom -Xusr/lib/apache2/suexec-pristine
        chown -R www-data:www-data debian/apache2/var/cache/apache2/mod_cache_disk
        chown root:adm debian/apache2/var/log/apache2


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

Kernel: Linux 4.9.0-6-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



Information forwarded to [email protected], Debian Apache Maintainers <[email protected]>:
Bug#900612; Package apache2-suexec-pristine. (Sat, 02 Jun 2018 08:39:05 GMT) (full text, mbox, link).


Acknowledgement sent to Stefan Fritsch <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Apache Maintainers <[email protected]>. (Sat, 02 Jun 2018 08:39:05 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Stefan Fritsch <[email protected]>
To: Jason Perrin <[email protected]>
Cc: [email protected]
Subject: Re: Bug#900612: apache2-suexec-pristine: Packaging steps undo setting of setuid bit
Date: Sat, 02 Jun 2018 10:35:24 +0200
On Saturday, 2 June 2018 02:06:10 CEST Jason Perrin wrote:

> This appears to be a problem in the source for this package, on the master
> branch, as well as on separate branches for different distros:
> https://salsa.debian.org/apache-team/apache2/blob/master/debian/rules#L148-1
> 53 I'm not sure how this has worked properly to produce packages, since the
> last change to that section was 6 years ago, so I'm a bit confused on that
> point.


That's weird because it seems all distributed packages in the last 6 years 
have the correct permissions. Do you build the package as root? Usually 
packages are built as non-root user using fakeroot. Maybe fakeroot is not 
being faithful to the real kernel behavior and hides the bug.

Cheers,
Stefan






Information forwarded to [email protected], Debian Apache Maintainers <[email protected]>:
Bug#900612; Package apache2-suexec-pristine. (Sat, 02 Jun 2018 20:27:05 GMT) (full text, mbox, link).


Acknowledgement sent to Jason Perrin <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Apache Maintainers <[email protected]>. (Sat, 02 Jun 2018 20:27:05 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Jason Perrin <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: Bug#900612: apache2-suexec-pristine: Packaging steps undo setting of setuid bit
Date: Sat, 2 Jun 2018 13:24:31 -0700
Hi Stefan,

You're absolutely right, I was building the package as root inside a
docker container, mostly as a one-off kind of build to add some
debugging information. I tried using fakeroot instead, and it masked
the problem as you mentioned, as the file at the end still has the
setuid bit, even though it has changed group (and the same happens if
the owner is changed):

jvperrin@fireball:~$ fakeroot /bin/bash
root@fireball:~# touch test.txt
root@fireball:~# ls -l test.txt
-rw-r--r-- 1 root root 0 Jun  2 13:08 test.txt
root@fireball:~# chmod 4754 test.txt
root@fireball:~# ls -l test.txt
-rwsr-xr-- 1 root root 0 Jun  2 13:08 test.txt*
root@fireball:~# chgrp nogroup test.txt
root@fireball:~# ls -l test.txt
-rwsr-xr-- 1 root nogroup 0 Jun  2 13:08 test.txt*

If I do the same without fakeroot, it loses the setuid bit (as it should):

jvperrin@fireball:~$ sudo -i
root@fireball:~# touch test.txt
root@fireball:~# ls -l test.txt
-rw-r--r-- 1 root root 0 Jun  2 13:11 test.txt
root@fireball:~# chmod 4754 test.txt
root@fireball:~# ls -l test.txt
-rwsr-xr-- 1 root root 0 Jun  2 13:11 test.txt*
root@fireball:~# chgrp nogroup test.txt
root@fireball:~# ls -l test.txt
-rwxr-xr-- 1 root nogroup 0 Jun  2 13:11 test.txt*

This suggests to me that this is indeed a problem with fakeroot, not
with this package, although I do still think the patch I included on
this bug report could be helpful as it wouldn't change the behavior
when it fakeroot and fixes the issue if anyone else is building
manually outside of fakeroot. Looking at fakeroot's bug reports, it's
already been reported almost a decade ago
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=497109). It hasn't
had any activity since then, so that's unfortunate, I'll try and
follow up there. Thank you for your help, that was very useful!
On Sat, Jun 2, 2018 at 1:35 AM Stefan Fritsch <[email protected]> wrote:
>
> On Saturday, 2 June 2018 02:06:10 CEST Jason Perrin wrote:
>
> > This appears to be a problem in the source for this package, on the master
> > branch, as well as on separate branches for different distros:
> > https://salsa.debian.org/apache-team/apache2/blob/master/debian/rules#L148-1
> > 53 I'm not sure how this has worked properly to produce packages, since the
> > last change to that section was 6 years ago, so I'm a bit confused on that
> > point.
>
>
> That's weird because it seems all distributed packages in the last 6 years
> have the correct permissions. Do you build the package as root? Usually
> packages are built as non-root user using fakeroot. Maybe fakeroot is not
> being faithful to the real kernel behavior and hides the bug.
>
> Cheers,
> Stefan
>
>
>



Information forwarded to [email protected], Debian Apache Maintainers <[email protected]>:
Bug#900612; Package apache2-suexec-pristine. (Sun, 10 May 2020 08:46:25 GMT) (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Debian Apache Maintainers <[email protected]>. (Sun, 10 May 2020 08:46:25 GMT) (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: "Nael M. Al Homoud" <[email protected]>
To: undisclosed-recipients:;
Subject: Investment Proposal
Date: Sun, 10 May 2020 09:33:43 +0100
[Message part 1 (text/plain, inline)]
Good day,

My associate from China wants to discuss a business investment deal with
you. I awaiting your response to enable us discuss about this business
investment

Nael M. Al Homoud
Executive Director & High Investment Committee Member@
The Arab Investment Co
www.taic.com [1]

  

Links:
------
[1] http://www.taic.com
[Message part 2 (text/html, inline)]

Information forwarded to [email protected], Debian Apache Maintainers <[email protected]>:
Bug#900612; Package apache2-suexec-pristine. (Mon, 27 Sep 2021 07:45:12 GMT) (full text, mbox, link).


Acknowledgement sent to "Dorian Kwiatkowski" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Apache Maintainers <[email protected]>. (Mon, 27 Sep 2021 07:45:12 GMT) (full text, mbox, link).


Message #25 received at [email protected] (full text, mbox, reply):

From: "Dorian Kwiatkowski" <[email protected]>
To: <[email protected]>
Subject: Fotowoltaika dla firm
Date: Mon, 27 Sep 2021 07:30:46 GMT
Dzień dobry,

kontaktuję się z Państwem, ponieważ dostrzegam możliwość redukcji opłat za prąd.

Odpowiednio dobrana instalacja fotowoltaiczna to rozwiązanie, które pozwala wygenerować spore oszczędności w skali roku.

Chciałbym porozmawiać z Państwem o tego typu rozwiązaniu, a także przedstawić wstępne kalkulacje.

Czy są Państwo zainteresowani?

Pozdrawiam,
Dorian Kwiatkowski



Information forwarded to [email protected], Debian Apache Maintainers <[email protected]>:
Bug#900612; Package apache2-suexec-pristine. (Thu, 14 Oct 2021 07:57:19 GMT) (full text, mbox, link).


Acknowledgement sent to "Patryk Górecki" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Apache Maintainers <[email protected]>. (Thu, 14 Oct 2021 07:57:20 GMT) (full text, mbox, link).


Message #30 received at [email protected] (full text, mbox, reply):

From: "Patryk Górecki" <[email protected]>
To: <[email protected]>
Subject: Ruch z pierwszej pozycji w Google
Date: Thu, 14 Oct 2021 07:46:13 GMT
Dzień dobry, 

jakiś czas temu zgłosiła się do nas firma, której strona internetowa nie pozycjonowała się wysoko w wyszukiwarce Google. 

Na podstawie wykonanego przez nas audytu SEO zoptymalizowaliśmy treści na stronie pod kątem wcześniej opracowanych słów kluczowych. Nasz wewnętrzny system codziennie analizuje prawidłowe działanie witryny.  Dzięki indywidualnej strategii, firma zdobywa coraz więcej Klientów.  

Czy chcieliby Państwo zwiększyć liczbę osób odwiedzających stronę internetową firmy? Mógłbym przedstawić ofertę? 


Pozdrawiam serdecznie,
Patryk Górecki



Information forwarded to [email protected], Debian Apache Maintainers <[email protected]>:
Bug#900612; Package apache2-suexec-pristine. (Wed, 20 Oct 2021 07:54:22 GMT) (full text, mbox, link).


Acknowledgement sent to "Patryk Górecki" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Apache Maintainers <[email protected]>. (Wed, 20 Oct 2021 07:54:22 GMT) (full text, mbox, link).


Message #35 received at [email protected] (full text, mbox, reply):

From: "Patryk Górecki" <[email protected]>
To: <[email protected]>
Subject: Ruch z pierwszej pozycji w Google
Date: Wed, 20 Oct 2021 07:50:24 GMT
Dzień dobry, 

jakiś czas temu zgłosiła się do nas firma, której strona internetowa nie pozycjonowała się wysoko w wyszukiwarce Google. 

Na podstawie wykonanego przez nas audytu SEO zoptymalizowaliśmy treści na stronie pod kątem wcześniej opracowanych słów kluczowych. Nasz wewnętrzny system codziennie analizuje prawidłowe działanie witryny.  Dzięki indywidualnej strategii, firma zdobywa coraz więcej Klientów.  

Czy chcieliby Państwo zwiększyć liczbę osób odwiedzających stronę internetową firmy? Mógłbym przedstawić ofertę? 


Pozdrawiam serdecznie,
Patryk Górecki



Information forwarded to [email protected], Debian Apache Maintainers <[email protected]>:
Bug#900612; Package apache2-suexec-pristine. (Mon, 08 Nov 2021 08:51:17 GMT) (full text, mbox, link).


Acknowledgement sent to "Dawid Rowicki" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Apache Maintainers <[email protected]>. (Mon, 08 Nov 2021 08:51:17 GMT) (full text, mbox, link).


Message #40 received at [email protected] (full text, mbox, reply):

From: "Dawid Rowicki" <[email protected]>
To: <[email protected]>
Subject: Prezentacja
Date: Mon, 8 Nov 2021 08:40:58 GMT
Dzień dobry!

Czy mógłbym przedstawić rozwiązanie, które umożliwia monitoring każdego auta w czasie rzeczywistym w tym jego pozycję, zużycie paliwa i przebieg?

Dodatkowo nasze narzędzie minimalizuje koszty utrzymania samochodów, skraca czas przejazdów, a także tworzenie planu tras czy dostaw.

Z naszej wiedzy i doświadczenia korzysta już ponad 49 tys. Klientów. Monitorujemy 809 000 pojazdów na całym świecie, co jest naszą najlepszą wizytówką.

Bardzo proszę o e-maila zwrotnego, jeśli moglibyśmy wspólnie omówić potencjał wykorzystania takiego rozwiązania w Państwa firmie.


Z poważaniem,
Dawid Rowicki



Information forwarded to [email protected], Debian Apache Maintainers <[email protected]>:
Bug#900612; Package apache2-suexec-pristine. (Thu, 18 Nov 2021 09:15:29 GMT) (full text, mbox, link).


Acknowledgement sent to "Adrian Ostojski" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Apache Maintainers <[email protected]>. (Thu, 18 Nov 2021 09:15:29 GMT) (full text, mbox, link).


Message #45 received at [email protected] (full text, mbox, reply):

From: "Adrian Ostojski" <[email protected]>
To: <[email protected]>
Subject: Wymiana faktury
Date: Thu, 18 Nov 2021 08:58:56 GMT
Dzień dobry,

czy interesuje Państwa wymiana niezapłaconych przez Klientów faktur na gotówkę?

Pomagamy wszystkim przedsiębiorcom, którzy szukają gwarancji bezpieczeństwa i płynności finansowej.

Jeśli są Państwo otwarci na wstępną rozmowę w tym temacie proszę o odpowiedź.


Pozdrawiam,
Adrian Ostojski
Dyrektor Finansowy



Information forwarded to [email protected], Debian Apache Maintainers <[email protected]>:
Bug#900612; Package apache2-suexec-pristine. (Wed, 15 Dec 2021 08:57:12 GMT) (full text, mbox, link).


Acknowledgement sent to "Adam Furgalski" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Apache Maintainers <[email protected]>. (Wed, 15 Dec 2021 08:57:12 GMT) (full text, mbox, link).


Message #50 received at [email protected] (full text, mbox, reply):

From: "Adam Furgalski" <[email protected]>
To: <[email protected]>
Subject: Słowa kluczowe do wypozycjonowania
Date: Wed, 15 Dec 2021 08:45:57 GMT
Dzień dobry,

zapoznałem się z Państwa ofertą i z przyjemnością przyznaję, że przyciąga uwagę i zachęca do dalszych rozmów. 

Pomyślałem, że może mógłbym mieć swój wkład w Państwa rozwój i pomóc dotrzeć z tą ofertą do większego grona odbiorców. Pozycjonuję strony www, dzięki czemu generują świetny ruch w sieci.

Możemy porozmawiać w najbliższym czasie?


Pozdrawiam
Adam Furgalski



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Sun Sep 22 09:40:59 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.