Skip to contentSkip to conversation

Contribute cachefilesd policy from Fedora to Refpolicy.

refpolicy Daniel J Walsh 2 participants 2 messages Jan 6, 2012 – Jan 9, 2012

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Originally written by David Howells and Karl MacMillan

Please Review and Ack.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8HLS8ACgkQrlYvE4MpobMS3gCfZ08PpE+jokrteMDmGhe1/58W 3ZEAn2dAFqRD/WNAY4jizD86iRFS5ObV
=5rri
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cachfilesd.patch
Type: text/x-patch
Size: 7818 bytes
Desc: not available
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20120106/c50d181d/attachment.bin

#1 lore raw
Quoted 3 lines · Daniel J Walsh

Originally written by David Howells and Karl MacMillan

Please Review and Ack.

[...]

Review

Quoted 12 lines
(quoted diff) +12 -0
+###############################################################################
+#
+# Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
+# Written by David Howells (dhowells at redhat.com)
+#            Karl MacMillan (kmacmill at redhat.com)
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+###############################################################################

Not sure how refpolicy wants to deal with copyright statements like these. They aren't harmful and the license is okay, but looking at what is currently in, this would be a first. Christopher?

Review

Quoted 9 lines
(quoted diff) +9 -0
+#
+# Define the contexts to be assigned to various files and directories of
+# importance to the CacheFiles kernel module and userspace management daemon.
+#
+
+# cachefilesd executable will have:
+# label: system_u:object_r:cachefilesd_exec_t
+# MLS sensitivity: s0
+# MCS categories: <none>

Superfluous comments (here and later); refpolicy wants to keep comments only when it isn't obvious from the code.

Quoted 7 lines
(quoted diff) +7 -0
+type cachefiles_var_t;
+files_type(cachefiles_var_t)
+
+type cachefiles_dev_t;
+dev_node(cachefiles_dev_t)
+
+type cachefilesd_t;

Review

Quoted 10 lines
(quoted diff) +10 -0
+type cachefilesd_exec_t;
+init_daemon_domain(cachefilesd_t, cachefilesd_exec_t)
+
+type cachefilesd_var_run_t;
+files_pid_file(cachefilesd_var_run_t)
+
+type cachefiles_kernel_t;
+domain_type(cachefiles_kernel_t)
+domain_obj_id_change_exemption(cachefiles_kernel_t)
+role system_r types cachefiles_kernel_t;

The order is a bit off. Probably best to start with cachefiles_t/cachefiles_exec_t, then the rest in alphabetical order.

Review

Quoted 3 lines
(quoted diff) +3 -0
+optional_policy(`
+	rpm_use_script_fds(cachefilesd_t)
+')

Should be moved downwards.

Review

Quoted 2 lines
(quoted diff) +2 -0
+allow cachefilesd_t cachefilesd_var_run_t:file create_file_perms;
+manage_files_pattern(cachefilesd_t, cachefilesd_var_run_t, cachefilesd_var_run_t)

manage_files_pattern contains manage_file_perms, which includes the privileges from create_file_perms, so the first allow statement isn't needed.

Quoted 1 line

+allow cachefilesd_t cachefiles_var_t:dir { rw_dir_perms delete_dir_perms };

Isn't manage_dir_pattern() more appropriate here?

Review

Quoted 6 lines
(quoted diff) +6 -0
+files_read_etc_files(cachefilesd_t)
+miscfiles_read_localization(cachefilesd_t)
+logging_send_syslog_msg(cachefilesd_t)
+init_dontaudit_use_script_ptys(cachefilesd_t)
+term_dontaudit_use_generic_ptys(cachefilesd_t)
+term_dontaudit_getattr_unallocated_ttys(cachefilesd_t)

Should be alphabetically ordered (first the ones from the kernel section, then system).

Wkr,
Sven Vermeulen