2011-05-11 14:31:54 +02:00
|
|
|
From 811469ebe70ea65029d64ae2e7bc6e9828f59c9e Mon Sep 17 00:00:00 2001
|
|
|
|
From: Ludwig Nussel <ludwig.nussel@suse.de>
|
|
|
|
Date: Wed, 11 May 2011 13:15:22 +0200
|
|
|
|
Subject: [PATCH] check for files in /var/run and /var/lock
|
|
|
|
|
|
|
|
nowadays /var/run and /var/lock move to using tmpfs so disallow
|
|
|
|
packaging files there
|
|
|
|
---
|
|
|
|
FilesCheck.py | 16 ++++++++++++++++
|
|
|
|
1 files changed, 16 insertions(+), 0 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/FilesCheck.py b/FilesCheck.py
|
|
|
|
index a82b4b8..0f43927 100644
|
|
|
|
--- a/FilesCheck.py
|
|
|
|
+++ b/FilesCheck.py
|
|
|
|
@@ -443,6 +443,10 @@ class FilesCheck(AbstractCheck.AbstractCheck):
|
2010-04-26 23:35:02 +02:00
|
|
|
printError(pkg, 'dir-or-file-in-usr-local', f)
|
|
|
|
elif f.startswith('/var/local/'):
|
|
|
|
printError(pkg, 'dir-or-file-in-var-local', f)
|
|
|
|
+ elif f.startswith('/var/run/') and f not in ghost_files:
|
|
|
|
+ printError(pkg, 'dir-or-file-in-var-run', f)
|
2011-05-11 14:31:54 +02:00
|
|
|
+ elif f.startswith('/var/lock/'):
|
|
|
|
+ printError(pkg, 'dir-or-file-in-var-lock', f)
|
2010-04-26 23:35:02 +02:00
|
|
|
elif sub_bin_regex.search(f):
|
|
|
|
printError(pkg, 'subdir-in-bin', f)
|
|
|
|
elif f.startswith('/home/'):
|
2011-05-11 14:31:54 +02:00
|
|
|
@@ -1019,6 +1023,18 @@ for packages to install files in this directory.''',
|
2010-04-26 23:35:02 +02:00
|
|
|
'''A file in the package is located in /var/local. It's not permitted
|
|
|
|
for packages to install files in this directory.''',
|
|
|
|
|
|
|
|
+'dir-or-file-in-var-run',
|
|
|
|
+'''A file or directory in the package is located in /var/run. It's not
|
|
|
|
+permitted for packages to install files in this directory as it might
|
2011-05-11 14:31:54 +02:00
|
|
|
+be created as tmpfs during boot. Mark the files in question as %ghost and
|
|
|
|
+create them at run time instead.''',
|
|
|
|
+
|
|
|
|
+'dir-or-file-in-var-lock',
|
|
|
|
+'''A file or directory in the package is located in /var/lock. It's
|
|
|
|
+not permitted for packages to install files in this directory as it
|
|
|
|
+is a) reserved for legacy device lock files and b) might be created
|
|
|
|
+as tmpfs during boot.''',
|
2010-04-26 23:35:02 +02:00
|
|
|
+
|
|
|
|
'subdir-in-bin',
|
|
|
|
'''The package contains a subdirectory in /usr/bin. It's not permitted to
|
|
|
|
create a subdir there. Create it in /usr/lib/ instead.''',
|
2011-05-11 14:31:54 +02:00
|
|
|
--
|
|
|
|
1.7.3.4
|
|
|
|
|