e72e5cf Fix %post scriptlet to not require the shell

Authored and Committed by zbyszek 2 years ago
1 file changed. 12 lines added. 3 lines removed.
    Fix %post scriptlet to not require the shell
    
    os.execute uses /bin/sh, which to a large extent defeats the purpose of having
    the scriptlet in lua ;)
    
    $ strace -qq -ff -eexecve rpm -E "%{lua:os.execute('true')}"
    execve("/usr/bin/rpm", ["rpm", "-E", "%{lua:os.execute('true')}"], 0x7ffd180ce638 /* 60 vars */) = 0
    [pid 849466] execve("/bin/sh", ["sh", "-c", "true"], 0x7fff73cfc9d8 /* 60 vars */) = 0
    
    Let's use posix.exec(). rpm.execute() would be nice, but it does not
    support suppressing of stderr.
    
        
file modified
+12 -3