0

I was looking in /usr/bin tonight and saw this:

snapd in usr bin.png

The symbolic link in cyan / red is a curiosity:

lrwxrwxrwx  1 root root          25 Jul 19 04:48 ubuntu-core-launcher -> ../lib/snapd/snap-confine*

As I don't use snapd yet (Ubuntu 16.04 / Unity Interface) I'm not really concerned but I'm curious if anyone else has encountered this strange coloured link and what it means with all the dangerous looking red?

  • Looks like a bug in ls. Instead of filling the width of file name, it probably padded printf() function to fill the screen width with blanks, but instead of sticking control character to uncolonize the output at the end of filename, it stuck it at the end of the padding. – Sergiy Kolodyazhnyy Sep 26 '18 at 23:42
  • If you're asking about the meaning of color, then it probably means full permissions for everyone, notice the permissions the link has. There's a post about it on askubuntu somewhere – Sergiy Kolodyazhnyy Sep 26 '18 at 23:46
  • 2
    From What do the different colors mean in ls? Uncolored with red background: set-user-ID file – steeldriver Sep 26 '18 at 23:47
  • @SergiyKolodyazhnyy Could it be what the link points to? -rwsr-sr-x root root 98440 Jul 19 04:48 /usr/lib/snapd/snap-confine Notice the s where x for execute usually resides for root and group ID, yet Everyone is set to x and not s. – WinEunuuchs2Unix Sep 26 '18 at 23:52
  • @steeldriver The link left me more confused than the red in my question did :) – WinEunuuchs2Unix Sep 26 '18 at 23:54
  • Yes, the s bit, that's what the steeldriver's link actually explains. So red because it's SUID program and it can do root things without promoting for password – Sergiy Kolodyazhnyy Sep 26 '18 at 23:58
  • @SergiyKolodyazhnyy Actually it means root runs as the user? http://olivermellinuxacademy.com/blog/rwx-versus-rws/ Plus as you mentioned a bug in printf usage. – WinEunuuchs2Unix Sep 27 '18 at 00:00

1 Answers1

1

As sergiy mentioned in comments it is a bug with ls not filling in colors properly when window size causes a line to wrap to the next.

You can see it here by changing the window size for sudoedit:

ls for sudoedit.png

As for the color red itself it's because root becomes the user due to access permissions:

$ llocate /lib/snapd/snap-confine
ACCESS      OWNER  GROUP  SIZE   MODIFIED      NAME (updatdb last ran: 2018-09-26 17:45:05)
-rwsr-sr-x  root   root   98440  Jul 19 04:48  /mnt/clone/usr/lib/snapd/snap-confine
-rwsr-sr-x  root   root   85832  Nov 30  2017  /mnt/old/usr/lib/snapd/snap-confine
-rwsr-sr-x  root   root   98440  Jul 19 04:48  /usr/lib/snapd/snap-confine

Notice root has access rights rws and group has access rights r-s. Everyone else has r-x execute rights. See: rwx Versus rws


Scrolling down further there is another bug example in orange this time:

ls write bug.png