summaryrefslogtreecommitdiff
path: root/src/shared/smack-util.c
AgeCommit message (Collapse)Author
2015-04-14shared: add process-util.[ch]Ronny Chevalier
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18Replace ENOTSUP with EOPNOTSUPPAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-04smack-util: remove warning when building without SMACK supportLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-27smack: introduce new SmackProcessLabel optionWaLyong Cho
In service file, if the file has some of special SMACK label in ExecStart= and systemd has no permission for the special SMACK label then permission error will occurred. To resolve this, systemd should be able to set its SMACK label to something accessible of ExecStart=. So introduce new SmackProcessLabel. If label is specified with SmackProcessLabel= then the child systemd will set its label to that. To successfully execute the ExecStart=, accessible label should be specified with SmackProcessLabel=. Additionally, by SMACK policy, if the file in ExecStart= has no SMACK64EXEC then the executed process will have given label by SmackProcessLabel=. But if the file has SMACK64EXEC then the SMACK64EXEC label will be overridden. [zj: reword man page] Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25smack: we don't need the special labels exported, hence don'tLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25smack: rework SMACK label fixing code to follow more closely the semantics ↵Lennart Poettering
of the matching selinux code Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25smack: never follow symlinks when relabellingLennart Poettering
previously mac_smack_apply(path, NULL) would operate on the symlink itself while mac_smack_apply(path, "foo") would follow the symlink. Let's clean this up an always operate on the symlink, which appears to be the safer option. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25smack: rework smack APIs a bitLennart Poettering
a) always return negative errno error codes b) always become a noop if smack is off c) always take a NULL label as a request to remove it Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25mac: rename all calls that apply a label mac_{selinux|smack}_apply_xyz(), ↵Lennart Poettering
and all that reset it to defaults mac_{selinux|smack}_fix() Let's clean up the naming schemes a bit and use the same one for SMACK and for SELINUX. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25mac: also rename use_{smack,selinux,apparmor}() calls so that they share the ↵Lennart Poettering
new mac_{smack,selinux,apparmor}_xyz() convention Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25mac: rename apis with mac_{selinux/smack}_ prefixWaLyong Cho
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25label: rearrange mandatory access control(MAC) apisWaLyong Cho
move label apis to selinux-util.ch or smack-util.ch appropriately. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05src/shared: refactor shared codeAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>