grant icon indicating copy to clipboard operation
grant copied to clipboard

bug: "[0090] ERROR unable to classify license: unable to read" on symlinkx

Open popey opened this issue 1 year ago • 1 comments

:wave:

I pointed grant at a folder, a mounted squashfs file, distributed from an app store (specifically the alacrity desktop terminal software package from the snap store). Partway through the license check, it fails with:

[0090] ERROR unable to classify license: unable to read "/snap/alacritty/current/usr/share/doc/libncursesw6": read /snap/alacritty/current/usr/share/doc/libncursesw6: is a directory

/snap/alacritty/current/usr/share/doc/libncursesw6 is actually just a symlink to a directory.

alan@ziggy:~$ ls -ld /snap/alacritty/current/usr/share/doc/libncursesw6
lrwxrwxrwx 1 root root 9 May 16  2023 /snap/alacritty/current/usr/share/doc/libncursesw6 -> libtinfo6
alan@ziggy:~$ ls -ld /snap/alacritty/current/usr/share/doc/libtinfo6
drwxr-xr-x 2 root root 70 Feb 21 17:02 /snap/alacritty/current/usr/share/doc/libtinfo6
alan@ziggy:~$ ls -l /snap/alacritty/current/usr/share/doc/libtinfo6
total 10
-rw-r--r-- 1 root root 2334 May 16  2023 changelog.Debian.gz
-rw-r--r-- 1 root root 4670 Jan 16  2022 copyright
-rw-r--r-- 1 root root 2383 Jan 16  2022 FAQ

Steps to reproduce:

  1. On a system which supports snap (such as Ubuntu), install alacritty

sudo snap install alacritty

(it's a classic (unconfined) snap, so it will need --classic passed on the above command)

  1. Run grant against the installed application

grant check /snap/alacritty/current/

Expected results

I'd expect grant to follow the symlink.

Actual results

An error is displayed:

[0090] ERROR unable to classify license: unable to read "/snap/alacritty/current/usr/share/doc/libncursesw6": read /snap/alacritty/current/usr/share/doc/libncursesw6: is a directory

popey avatar Mar 26 '24 18:03 popey

@popey Thanks for the report here! I'll also check this and see why the sym link is not being handled correctly

spiffcs avatar Mar 26 '24 19:03 spiffcs