summaryrefslogtreecommitdiff
path: root/plugins
AgeCommit message (Collapse)AuthorFilesLines
2014-01-10MSM: fix access type length and validationJarkko Sakkinen2-2/+3
This patch fixes three issues with access type: - SMACK_ACCESS_TYPE_LENGHT -> SMACK_ACCESS_TYPE_LENGTH - Changed the value of SMACK_ACCESS_TYPE_LENGTH from 5 to 6. - String length was calculated with unsafe 'strlen()'. Changed to use strlen(type, SMACK_LABEL_LENGTH + 1) instead. Change-Id: I127d7b2beb8a3258ec1e4a5142f253f842b2fa7a Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
2013-12-20Security plugin: change policy to advisoryJarkko Sakkinen1-19/+29
Change policy from enforcing to advisory when access is requested from unknown domain or permitted to unknown domain. Also trunacated lines to 80 characters, fixed grammar in the warning messages, and removed trailing spaces and tabs. In future, it might make sense to make this behaviour a command-line option. Added a FIXME comment about that. Change-Id: Iab78d79a8a28e019ec8601265a59d259fd46f9d6 Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
2013-12-04Security plugin: adding support for l access typeElena Reshetova1-1/+1
Change-Id: Id61dd99ef2e6a673d3c66a58d71c735b07571970
2013-12-03Security plugin: removing exec label restrictionElena Reshetova1-0/+2
Change-Id: I1da33e6e842a7f93dade78f2aebc00ed271a271c
2013-11-15msm: check libxml/{xmlreader,tree}.hAdrian Negreanu1-1/+2
msmconfig.c:29:25: fatal error: libxml/tree.h: No such file or directory msmmanifest.c:37:30: fatal error: libxml/xmlreader.h: No such file or directory Bug-Id: https://bugs.tizen.org/jira/browse/PTREL-397 Change-Id: If287d79f343ca6f6f4be9392f09e17387305fb8a Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-09-27Security plugin: plugin hooks code refactoring and improvmentElena Reshetova5-341/+400
Change-Id: I4d44db47865dd5c83fcf28435ffc26a70164b69d
2013-08-20Security plugin: adding checking of return code for dbus policy verificationElena Reshetova2-35/+37
2013-08-19Security plugin: small fixesElena Reshetova2-52/+1
- Removing unused code - Changing the init hook to take care of new libsmack return code
2013-08-07Security plugin: removing disable-dchecks optionElena Reshetova2-24/+0
2013-08-05Security plugin: support for --root optionElena Reshetova3-38/+113
-adding macros to configure location of default policy -adding a default security policy to rpm-plugins dir -adding copying of policy file to chroot dir when rpm is run with --root param -moving policy saving to post_tsm hook
2013-08-05Security plugin: pkg_name allocation in conflictElena Reshetova1-6/+9
- fix to the pkg_name allocation in conflict handling
2013-08-05Security plugin: allowing multiple domains definitionElena Reshetova4-122/+170
- allowing multiple domains definition per manifest - fixing indirect include of config.h - restricting adding new sw source with the same key info
2013-05-31Security plugin: Adding configuration option --disable-dchecksElena Reshetova2-5/+33
2013-05-31Security-plugin: Fix the null pointer comparisonElena Reshetova1-3/+4
possibility in msmXattrSupport
2013-04-22Cleaning up code identationElena Reshetova5-1437/+1337
2013-04-18Fix the missing path prefix for Plugin init hookElena Reshetova1-13/+51
2013-04-17Fixes to rpm security pluginElena Reshetova3-16/+36
- stricter control over smack64exec label assigment - strciter control over dbus interface labels
2013-03-26init message testElena Reshetova1-1/+1
2013-03-26Changing smack load pathElena Reshetova1-1/+1
2013-03-12Adding a new attribute tag to manifestElena Reshetova3-5/+65
Attribute tag allows to specify the type of the package (currenlty only application or system) that affects setting SMACK64EXEC label. For system packages it isn't set by default and for applications it is set to requested domain.
2013-02-04Moving some plugin info prints to debugElena Reshetova2-45/+45
2013-02-02fixing error in cleanup if magic db can't be loadedElena Reshetova1-0/+1
2013-02-02Adding security msm pluginElena Reshetova8-0/+4500
2013-02-02Making pre/post tsm/psm hooks more consistent.Elena Reshetova1-2/+2
-All post hooks take an additional rc argument that indicates general return code from operation. -All post hooks are always called if correspoding pre hook has been called. -The return value from post hooks is curently ignored Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-02-02Improving scriptlet related rpm plugin hooks.Elena Reshetova1-2/+4
Three new hooks added: PLUGINHOOK_SCRIPTLET_PRE_FUNC Called before scriptlet execution PLUGINHOOK_SCRIPTLET_FORK_POST_FUNC Called after fork() but before scriptlet execution PLUGINHOOK_SCRIPTLET_POST_FUNC Called after scriptlet execution Currently pre and post hooks are called for externals and internal lua scripts. post hook is called even if scriptlet execution has failed and the return code is given as an argument. fork_post hook is only called for external scriptlets, because for internal scriptlets no fork() is currently performed. Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-02-02Extending rpm plugin interface, part 1Elena Reshetova1-0/+14
This change adds a new type of the rpm plugin, called transaction plugin and a set of initial hooks for this plugin. The hooks are: PLUGINHOOK_TSM_PRE Pre-transaction hook that is called before an rpm transaction begins PLUGINHOOK_TSM_POST Post-transaction hook that is called after an rpm transaction ends PLUGINHOOK_PSM_PRE Pre-transaction-element hook that is called before an rpm transaction-element is processed PLUGINHOOK_PSM_POST Post-transaction-element hook that is called after an rpm transaction-element is processed PLUGINHOOK_SCRIPT_SETUP Per-script hook that is called once for each rpm mainainers script that is present in the package Each hook is called for every plugin that have this hook registered. The avaliable transaction plugins can be specified in macros.in via transaction_plugins element. Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-10-11Eliminate now unnecessary WITH_SELINUX conditionals in sepolicy pluginPanu Matilainen1-22/+3
2012-10-11Only try compiling sepolicy plugin if selinux is enabledPanu Matilainen1-1/+4
2012-01-12remove the 'path' parameter of rpmtsSELabelInit()Ales Kozumplik1-1/+1
- It is always selinux_file_context_path() anyway.
2012-01-12selinux: reopen label between transactions if necessary (RhBug: 746073)Ales Kozumplik1-1/+1
2011-11-09Make base64 encoding/decoding part of rpmio public APIPanu Matilainen1-2/+2
- Base64 is present in headers and all, it's only reasonable that our API users have access to this functionality without having to link to other libraries. Even if we didn't want to carry the implementation forever in our codebase, we should provide a wrapping for this (much like the other crypto stuff) for the reason stated above. - A bigger issue is that our dirty little (badly hidden) secret was using non-namespaced function names, clashing with at least beecrypt. And we couldn't have made these internal-only symbols even on platforms that support it, because they are used all over the place outside rpmio. So... rename the b64 functions to rpmLikeNamingStyle and make 'em public. No functional changes, just trivial renaming despite touching numerous places.
2011-09-01Fix up one strict-prototype warning that has crept in meantimePanu Matilainen1-1/+1
2011-05-30Remove trailing dead NULL-assignments from sepoltransFree()Panu Matilainen1-2/+3
- Replace assignments with a memset() to blast away the contents instead, taking care of other members too
2011-05-30Minor cleanups to sepolLoadPolicies() in sepolicy pluginPanu Matilainen1-14/+7
- Having an err label which we fall through on success too seems a bit funny, rename the label to exit - Initialize the sepoltrans at declaration already - Remove redundant RPMRC_FAIL assignment on sepoltransNew() fail case, this already assumes failure - Remove redundant jump to exit from sepoltransCommit() error - Eliminate trailing dead NULL assignment of the local pt variable
2011-05-30Return explicit NULL on sepoltransNew() failurePanu Matilainen1-2/+2
2010-12-22Only sepolicy-plugin needs linking to libsemanagePanu Matilainen1-1/+1
2010-12-21Move rpmtsSELabelFoo() functions to an internal-only headerPanu Matilainen1-0/+1
- The sepolicy plugin needs them so the symbols can't be hidden, but these are not something external API-users should be messing with. - Ultimately we'll want to push the actual labeling from FSM to the plugin, insulating rpm from all SELinux specifics, this is just a band-aid temporary "solution" to keep this out of the API.
2010-10-12Move plugins out of rpm config directoryPanu Matilainen1-1/+1
- Plugins are by their very nature arch specific, while /usr/lib/rpm is a hodgepodge of all sorts of ... stuff, most of which is arch-independent and all. Use %{_libdir}/rpm-plugins to cleanly differentiate 32 vs 64bit plugin paths
2010-09-21Fix up bunch of silly int vs rpmRC return code mismatchesPanu Matilainen2-3/+3
2010-09-01Add SELinux policy pluginSteve Lawrence2-1/+684
This adds a new plugin specifically for a collection to load SELinux policy. This implements the post_add and pre_remove plugin hooks. The only time anything happens during the pre_remove hook is if post_add was not called (i.e. if the transaction only removes policies). This plugin extracts all the policy information from packages in the sepolicy collection during the open te hook. It then determines which policies should be installed/removed based on if the package is being installed/removed and the type of the policy and the system policy. It then executes semodule (or uses libsemanage if semodule cannot be executed or installing in a chroot) to remove and install the necessary policies. It then reloads the selinux state, reloads the file contexts, and if necessary, relabels the file system.
2010-09-01Update the plugin architecture to allow for remembering stateSteve Lawrence4-18/+40
This moves most of the plugin logic to a new rpmplugins file with a struct and functions for managing plugins, allowing for plugins to carry state. This also adds init and cleanup hooks for plugins to initialize and cleanup their state, and a new 'open te' hook allowing plugins to read and save information from transaction elements. This also generalizes the plugin architecture a bit so it isn't so specific to collections.
2010-06-23Make rpmChrootIn/Out() accessible to pluginsPanu Matilainen1-1/+1
- the exec plugin was using a private copy of rpmchroot.c to avoid RPM_GNUC_INTERNAL on the API, better let the plugins use librpm state instead - the chroot API really belongs to librpmio but for now...
2010-06-22Add a generic plugin for use by simple CollectionsSteve Lawrence3-0/+63
This patch adds a generic plugin, exec.so, that should be sufficient for the majority of Collection actions. After all packages in a Collection have been installed/removed, this plugin executes the arguments by calling system(3), allowing for a very generic and powerful method to perform many actions. This also adds two sample macros as examples of the format, using the exec.so plugin.