Opened 8 weeks ago

Last modified 8 weeks ago

#13574 assigned Bug Report - General

packaging/deb/debian - multiple issues ubuntu 20.04 focal

Reported by: Mike Bibbings Owned by: Bill Meek
Priority: minor Milestone: 31.0
Component: Packaging Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Attempting to install mythtv from ppa:mythbuntu/31 on Ubuntu 20.04 focal daily build fails. I understand that focal is still in development.

I get a permission denied error at line 54 (cat $INPUT > $NEW) of mythtv-common.postinst.

Something in focal has changed, don't know if it is a bug, or tightening of code somewhere, so that something that previously worked, but should not have, now fails. The same code on Ubuntu 18.04 LTS is fine.

temporarily changing to

cp $INPUT $NEW

allowed it continue, so something is happening due to > redirection (works fine on Ubuntu 18.04 LTS)

There is also a problem with mythtv-database.postinst as it fails to configure database user mythtv is not setup. mysql 8 is being installed, so I suspect a similar change to that recently made to mc.sql mythtv master in commit 83803f53 Database: update mc.sql for MySQL version 8 change is required

Attachments (2)

permission-denied.log.tar.bz2 (7.6 KB) - added by Mike Bibbings 8 weeks ago.
0001-Config.xml-Change-owner-and-permissions-on-the-final.patch (1.7 KB) - added by rcrdnalor 8 weeks ago.
Config.xml: Change owner and permissions on the final file, only

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 weeks ago by Bill Meek

Milestone: needs_triage31.0
Owner: set to Bill Meek
Status: newaccepted

comment:2 Changed 8 weeks ago by Bill Meek

Status: acceptedinfoneeded

Here's the fix for the DB change:

diff --git a/deb/debian/mythtv-database.postinst b/deb/debian/mythtv-database.postinst
index 9b90aa9..8b87d36 100644
--- a/deb/debian/mythtv-database.postinst
+++ b/deb/debian/mythtv-database.postinst
@@ -37,7 +37,8 @@ ask_root_pw() {
 
 update_database() {
     #Set up privs for mythtv@network
-    if ! echo "GRANT ALL PRIVILEGES ON $database.* TO $mythtv_username@'%' IDENTIFIED BY '$mythtv_password';" | \
+    if ! echo "CREATE USER IF NOT EXISTS $mythtv_username@'%' IDENTIFIED BY '$mythtv_password'; \
+               GRANT ALL ON $database.* TO $mythtv_username@'%';" | \
         mysql $SECURITY_INFO "$database" >/dev/null 2>&1; then
         fail_database
     fi

I can't find a way to make the redirection issue fail. Please past the output of this: ls -ld /usr/share/mythtv /usr/share/mythtv/config.xml /etc/mythtv /etc/mythtv/config.xml here (and I'm testing on focal.) I've got no problem with your cp solution, but just would like to understand why redirection fails. Thanks.

comment:3 Changed 8 weeks ago by Mike Bibbings

Bill,

output of ld ...

mike@vm-xubuntu2004-2:~$ ls -ld /usr/share/mythtv /usr/share/mythtv/config.xml /etc/mythtv

drwxr-xr-x 2 root root 4096 Feb 5 19:27 /etc/mythtv

drwxr-xr-x 13 root root 4096 Feb 5 19:27 /usr/share/mythtv

-rw-r--r-- 1 root root 514 Feb 4 23:34 /usr/share/mythtv/config.xml

I installed Xubuntu focal daily build in a virtual machine (virtual box host Xubuntu 18.04 LTS), fully updated it and added ppa:mythtvbuntu/31, then the usual sudo apt install mythtv. I have also tried on a bare metal install of Xubuntu focal, same Permission denied message.

Attached is the terminal session log showing the error

Mike

Changed 8 weeks ago by Mike Bibbings

comment:4 Changed 8 weeks ago by Mike Bibbings

Bill,

Not sure I would call the cp hack a solution, as I have not really tested it, the initial install is probably fine, but I am not sure about mythtv upgrade.

Mike

comment:5 Changed 8 weeks ago by rcrdnalor

Config.xml: Change owner and permissions on the final file, only

See attached patch.

Newer kernels 'allow restricted O_CREAT of FIFOs and regular files (*)', which prevents editing files in directories with sticky bit set, if the user/group of the file is different to the owner of the directory itself.

(*) https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=30aba6656

See Explanation:

https://unix.stackexchange.com/questions/503111/group-permissions-for-root-not-working-in-tmp

BTW, it also affects mythtv fixes/30 on Ubuntu Focal, see

https://bugs.launchpad.net/ubuntu/+source/mythtv/+bug/1861593

Changed 8 weeks ago by rcrdnalor

Config.xml: Change owner and permissions on the final file, only

comment:6 Changed 8 weeks ago by rcrdnalor

Status: infoneededassigned
Note: See TracTickets for help on using tickets.