summaryrefslogtreecommitdiff
path: root/plugins
AgeCommit message (Collapse)AuthorFilesLines
2021-01-05upgrade rpm version to 4.14.1upstream/4.14.1.1submit/tizen_base/20210113.025730submit/tizen_base/20210105.160930accepted/tizen/base/tool/20210118.215949biao716.wang9-741/+614
Change-Id: Iab5438d6e4d45c937b191c03e9ef5dd3fad165c8 Signed-off-by: biao716.wang <biao716.wang@samsung.com>
2020-12-02Fix building issue for tizen_base(configure: error: --with-msm given, but ↵submit/tizen_base/20201207.074011submit/tizen_base/20201203.051919submit/tizen_base/20201203.032811submit/tizen_base/20201203.031009submit/tizen_base/20201130.233154accepted/tizen/base/tool/20201213.215638jiankang.fan1-2/+1
attr/xattr.h not found). attr package's version be upgraded since Tizen 6.5 <attr/xattr.h> header; use <sys/xattr.h> instead Change-Id: I5a6dd9a2923ec0d2a4f15f9e608219448bdaa634 Signed-off-by: jiankang.fan <jiankang.fan@samsung.com>
2015-04-28msm: consistency for equally ranked keyssubmit/tizen_common/20150518.122814accepted/tizen/common/20150520.164523tizen_3.0.2015.q2_commonJosé Bollo1-2/+2
The conflicts within the packages of equally ranked keys must be treated usually by rpm. Without this change, installation of conflicting packages is not possible when msm plugin is active. Change-Id: I909540524c7e2b43229b8aac90f66430041cbd55 Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
2014-10-03MSM: Avoid creating empty access rule filesJosé Bollo1-0/+4
The msm plugin creates one access rule file in SMACK_RULES_PATH=/etc/smack/accesses.d for each RPM installed. Since Tizen 3, the guideline for packages is simplified and the new guideline states that manifest files have to be as simple as: <manifest> <request> <domain name="_"/> </request> </manifest> It means that most access rule files are empty. Thus, this patch removes the file if it is empty because without any penality, it improves: - the start time of the system - the administration of the system The start time is improved because at start, all the files in /etc/smack/accesses.d are read and loaded to the kernel. As empty files are just removed, no time is spend to seek it, open it, read it, close it, apply empty rule. The administration is also improved because only meaning access rule files are retains, avoid to have to sort what is meaning and what is not. Change-Id: I7b40f2b291f0c1dbcb2f033f62191c651430e3c8 Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
2014-09-15Fixed rpm crash when trying to access an undefined domain.tizen_3.0.m14.3_ivi_releasetizen_3.0.2014.q3_common_releasesubmit/tizen_common/20141008.071414submit/tizen/20140925.072409accepted/tizen/ivi/20141005.142818accepted/tizen/common/20141008.190634accepted/tizen/common/20140925.182508tizen_3.0.m14.3_ivitizen_3.0.2014.q3_commonaccepted/tizen_3.0.m14.3_iviaccepted/tizen_3.0.2014.q3_commonMaciej J. Karpiuk1-1/+1
Change-Id: I5e84c913d1756320bf31442d87b797ff8b5f4633
2014-09-05Remove Smack rules having wrong subjectsubmit/tizen_ivi/20140912.000000submit/tizen_common/20140908.122758accepted/tizen/ivi/20140912.193607accepted/tizen/common/20140908.193650José Bollo1-0/+5
Names of the software repositories were used as subject of the generated smack rules. There is no mention of such behaviour on the help pages in the wiki of tizen. Bug-Tizen: PTREL-638 Change-Id: Iefef89492ab5c9839cb01d3b62dae4c3637f00f4 Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
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 typesubmit/tizen/20131213.021127submit/tizen/20131204.161726accepted/tizen/mobile/20131216.220231accepted/tizen/generic/20140106.135159accepted/tizen/20131213.021220accepted/tizen/20131209.172435accepted/tizen/20131207.002837Elena 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 fixessubmit/tizen/20130820.223822Elena 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 identationsubmit/tizen/20130503.232628accepted/tizen/20130503.230954Elena 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 manifestsubmit/trunk/20130318.200853accepted/trunk/20130318.201050Elena 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.