Bug 244941 - /var/run is not cleaned up properly
/var/run is not cleaned up properly
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Bill Nottingham
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-06-19 19:36 EDT by David Zeuthen
Modified: 2014-03-16 23:07 EDT (History)
3 users (show)

See Also:
Fixed In Version: 8.70-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-04-15 13:06:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Zeuthen 2007-06-19 19:36:20 EDT


it says that if I have a package Foobar2000, I can create a directory


to use for run-time variable data and I can rely on this being cleaned up on
reboots. It works fine - if I drop file like


and it's gone on the next reboot - however if I do


it sticks around. 

This is actually a potential security risk depending on how /var/run is used
(see below).

Am unsure about the wording of FHS (it's vague) but am pretty sure this is
wrong. The reason I want this is for PolicyKit - I'd like to store temporarily
granted privileges in a per-uid sub directory, e.g. like this (note the permissions)

# tree -ugp /var/run/PolicyKit
`-- [drwxrwx--- davidz   polkit  ]  uid500
    |-- [-r--rw---- davidz   polkit  ] 
    |-- [-r--rw---- davidz   polkit  ] 
    |-- [-r--rw---- davidz   polkit  ] 
    |-- [-r--rw---- davidz   polkit  ] 
    `-- [-r--rw---- davidz   polkit  ] 

e.g. where only uid 500 can see what privileges uid 500 have been granted.

To explain the potential (minor) security problem the existence of the file 


means that the process with pid 4827, created 864.36 seconds after the kernel
booted, and owned by uid 500 is privileged for invoking actions on mechnanisms
(D-Bus system daemons or setuid helpers) that require the
'polkit-gnome-examples-frobnicate' privilege. If this is not cleaned up on
reboot.. there's a slight chance that uid 500 can create a process with pid 4827
and age 864.36 seconds on the next reboot...

Anyway, I think this is an easy fix to be a bit more FHS compliant.
Comment 1 Bill Nottingham 2007-06-19 23:41:37 EDT
Yeah, the problem is reimplementing find.
Comment 2 David Zeuthen 2007-06-20 11:42:55 EDT
(In reply to comment #1)
> Yeah, the problem is reimplementing find.

I'm curious if you agree that we're violating the FHS by not cleaning up these
Comment 3 Bill Nottingham 2007-06-20 11:46:52 EDT
From a quick reading, we are. Of course, it's sort of unclear as to whether, in
your example, the uid500 directory should be removed or not.
Comment 4 Bug Zapper 2008-04-04 08:50:10 EDT
Based on the date this bug was created, it appears to have been reported
during the development of Fedora 8. In order to refocus our efforts as
a project we are changing the version of this bug to '8'.

If this bug still exists in rawhide, please change the version back to
(If you're unable to change the bug's version, add a comment to the bug
and someone will change it for you.)

Thanks for your help and we apologize for the interruption.

The process we're following is outlined here:

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Note You need to log in before you can comment on or make changes to this bug.