Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 603372 - x11-misc/virtualgl: init script should use checkpath instead of truncate/chmod
Summary: x11-misc/virtualgl: init script should use checkpath instead of truncate/chmod
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Pacho Ramos
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-21 19:49 UTC by Michael Orlitzky
Modified: 2022-07-24 08:32 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Orlitzky gentoo-dev 2016-12-21 19:49:59 UTC
The init script for vgl used "truncate" and "chmod" to create an empty file with mode 644:

  start() {
      ebegin "Starting VirtualGL"
      truncate --size=0 /var/lib/VirtualGL/vgl_xauth_key
      ...
      xauth -f /var/lib/VirtualGL/vgl_xauth_key add $DISPLAY . \
        $(xauth -f $XAUTHORITY list | awk '{print $3;exit}') && \
        chmod 644 /var/lib/VirtualGL/vgl_xauth_key
      eend $?
  }

A single call to "checkpath" from OpenRC (man openrc-run) would be more appropriate here. It's more portable, being part of OpenRC, and it's also more secure: truncate and chmod will follow symlinks, so if root:root ever loses full control of that path, somebody might be able to swap out that auth file for a symlink and gain root.