#8 avoid using shell in %transfiletrigger* entirely + move %transfiletrigger* in common subpackage
Merged 3 years ago by fweimer. Opened 3 years ago by ignatenkobrain.
Unknown source lua-exec  into  master

file modified
+20 -22
@@ -349,28 +349,6 @@

  Linux system will not function.

  

  ######################################################################

- # File triggers to do ldconfig calls automatically (see rhbz#1380878)

- ######################################################################

- 

- # File triggers for when libraries are added or removed in standard

- # paths.  Use Lua to avoid a dependency on /bin/sh.  Due to an RPM

- # spec file parser deficiency, we cannot move the trigger into a

- # subpackage.

- %transfiletriggerin -p <lua> -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64

- os.execute("/sbin/ldconfig")

- %end

- 

- %transfiletriggerpostun -p <lua> -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64

- os.execute("/sbin/ldconfig")

- %end

- 

- # We need to run ldconfig manually because ldconfig cannot handle the

- # relative include path in the /etc/ld.so.conf file we generate.

- %undefine __brp_ldconfig

- 

- ######################################################################

- 

- ######################################################################

  # libnsl subpackage

  ######################################################################

  
@@ -461,6 +439,26 @@

  The glibc-common package includes common binaries for the GNU libc

  libraries, as well as national language (locale) support.

  

+ ######################################################################

+ # File triggers to do ldconfig calls automatically (see rhbz#1380878)

+ ######################################################################

+ 

+ # File triggers for when libraries are added or removed in standard

+ # paths.

+ %transfiletriggerin common -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64

+ /sbin/ldconfig

+ %end

+ 

+ %transfiletriggerpostun common -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64

+ /sbin/ldconfig

+ %end

+ 

+ # We need to run ldconfig manually because ldconfig cannot handle the

+ # relative include path in the /etc/ld.so.conf file we gneerate.

+ %undefine __brp_ldconfig

+ 

+ ######################################################################

+ 

  %package locale-source

  Summary: The sources for the locales

  Requires: %{name} = %{version}-%{release}

commit 5a78ef7be165bd17feecfce24dc28c3412863ddc
Author: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date:   Tue Feb 6 11:25:39 2018 +0100

    move %transfiletrigger* in common subpackage

    Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>

commit afe44858b14f059bc971ce919bb9ad736a794d74
Author: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date:   Tue Feb 6 11:03:39 2018 +0100

    avoid using shell in %transfiletrigger* entirely

    If we do posix.fork() → posix.exec(), we don't spawn a shell which is
    good.

    Same technics can be found up in glibc spec file and in systemd one.

    Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>

rebased onto 8eeace4fae2528367697e7cd7a7671f3c86aa870

3 years ago

rebased onto afe44858b14f059bc971ce919bb9ad736a794d74

3 years ago

This problem wasn't introduced by this commit, but it would be nice if we could fix the problem as part of this work. Basically rpm-ostree doesn't support lua :cry: which is causing problems if we leave it like it is. See https://pagure.io/atomic-wg/issue/419

@dustymabe that's not a problem of glibc... for instance, systemd uses filetriggers in lua. If you want people to stop using lua as interpreter, you need to work with FPC. But the whole reason here is to avoid dependency on shell (which is circular dependency after all).

@walters - do you know why we see this problem with glibc and not with systemd?

I'd prefer to run the trigger from the common package, using /bin/sh. The use of Lua is not necessary here, and spawning a shell should not matter because we do this only once per transaction.

rebased onto a02f097696fe5d358a8f0a5dac78665664fbae0b

3 years ago

@ignatenkobrain Looks okay to me (but has conflicts).

rebased onto c09c662

3 years ago

Pull-Request has been merged by fweimer

3 years ago

when can we get a copy of this into rawhide?

@dustymabe whenever rawhide compose succeeds (which didn't happen for more than 1 week) ;)

weird.. so I made a new repo with the new build in it. for some reason I still get an error from rpm-ostree stating that there is lua in the transferfiletriggerin:

error: Executing %transfiletriggerin for glibc: Package 'glibc' has (currently) unsupported <lua> script in '%transfiletriggerin'

or maybe I grabbed the wrong build. I grabbed the latest one that was built: https://koji.fedoraproject.org/koji/buildinfo?buildID=1028645

and not the latest one florian had built

yeah neither one of them work.
- glibc-2.27-2.fc28
- glibc-2.27-1.fc28.1

i'm guessing this change didn't make it into an rpm build yet

yeah if you look at the git hash in the koji builds it looks like neither of them was built with the latest commits