fwts snap: unclear error message "cannot open results log 'results'"

Bug #2037502 reported by Heinrich Schuchardt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fwts (Ubuntu)
Fix Released
Medium
Ivan Hu

Bug Description

I have the riscv64 snap fwts V23.09.00 installed on Ubuntu Mantic.

$ sudo /snap/bin/fwts --ebbr
/snap/fwts/904/usr/local/bin/fwts: Cannot open results log 'results' (you may need to remove it to set proper permissions).

Files result and results.log does not exist in the current directory.

In /var/log/kern.log I find this entry:

2023-09-27T07:07:21.435093+02:00 unmatched kernel: [255426.512789] audit: type=1400 audit(1695791241.430:407): apparmor="DENIED" operation="capable" class="cap" profile="snap.fwts.fwts" pid=235742 comm="snapcraft-runne" capability=2 capname="dac_read_search"

$ uname -a
Linux workstation 6.2.0-24-generic #24.1-Ubuntu SMP Fri Jun 23 00:35:17 UTC 2023 riscv64 riscv64 riscv64 GNU/Linux

The current drive is mounted as
/dev/nvme1n1p2 on /home type ext4 (rw,nosuid,relatime)

After

$ sudo touch results.log

I can run fwts.

It does not work with a chmod 666 results.log that is not owned by root.

It seems that the restrictions for the snap are a bit tight.

description: updated
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Without sudo it works fine in my home directory.

So these questions remain:

Could the error message say 'results.log' and not 'results'? This would require moving the error message to fwts_log_open().

Could the fwts snap indicate that you have to run it in your home directory?

Best regards

Heinrich

summary: - fwts snap: cannot open results log 'results'
+ fwts snap: unclear error message "cannot open results log 'results'"
Ivan Hu (ivan.hu)
Changed in fwts (Ubuntu):
assignee: nobody → Ivan Hu (ivan.hu)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Ivan Hu (ivan.hu) wrote :

for the error message of 'results.log', a patch has sent to fwts-devel,
https://lists.ubuntu.com/archives/fwts-devel/2023-November/013765.html

Revision history for this message
Ivan Hu (ivan.hu) wrote :

As for the "Could the fwts snap indicate that you have to run it in your home directory?"

I believe snap install with --devmode could help.

$snap install --devmode fwts
$sudo su
$/snap/bin/fwts

Changed in fwts (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Ivan Hu (ivan.hu) wrote :

fix released on fwts 23.11.00

Changed in fwts (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Ivan Hu (ivan.hu) wrote :

Got another issue when users specified the result file, it got more ".log"

$ fwts -r test.log acpidump
fwts: Cannot open results log 'test.log.log' (you may need to remove it to set proper permissions).

Changed in fwts (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
Ivan Hu (ivan.hu) wrote :
Changed in fwts (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Ivan Hu (ivan.hu) wrote :

Released in fwts 24.01.00

Changed in fwts (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.