platform/core/security/libprivilege-control.git
11 years agoRe-enable Smack setting for native apps.
Rafal Krypa [Thu, 11 Apr 2013 16:16:33 +0000 (18:16 +0200)]
Re-enable Smack setting for native apps.

[Issue#] SSDWSSP-184
[Feature] Re-enable Smack support.
[Cause] Runtime Smack support ready for integration.
[Solution] Re-enable existing Smack support.
[Verification] Build, install, reboot target. Verify running of native applications and widgets.

Change-Id: I314e7252e17ecf97d74133868787e3dc27be2dce

11 years agoFull set of SMACK rules support for OSP and WRT
Rafal Krypa [Thu, 11 Apr 2013 16:25:44 +0000 (18:25 +0200)]
Full set of SMACK rules support for OSP and WRT

[Issue#]       SSDWSSP-184
[Feature]      Temporarily provide full set of rules in base permission.
[Cause]        During integration applications must continue to work.
[Solution]     Provide full set of Smack rules even without API features enabled.
[Verification] N/A

Change-Id: I9dad1bd15fd6d4c428db5ea373590b127d48f274

11 years agoAdded support for gids in add_new_feature API
Krzysztof Jackiewicz [Wed, 17 Apr 2013 16:16:30 +0000 (18:16 +0200)]
Added support for gids in add_new_feature API

[Issue#] N/A
[Feature/Bug] N/A
[Problem] N/A
[Cause] add_new_feature API needed
[Solution] Support for guids implemented

[Verification] libprivilege-control-test --output=text --regexp=add_api_feature
should pass

Change-Id: Ib2ee5c2f5f429031c4595bc26d0dabb89942b145

11 years agoAdd check if app_label and shared_label are different in app_label_shared_dir
Jan Cybulski [Tue, 2 Apr 2013 10:58:10 +0000 (12:58 +0200)]
Add check if app_label and shared_label are different in app_label_shared_dir

    [Issue#]    SSDWSSP-154
    [Feature]   API function app_label_shared_dir checks if app_label and shared_label are different
    [Cause]   New API feature
    [Verification] Build and tests

Change-Id: I7a923a196a0d93590c96a506caaa6afc0ee07eac

11 years agoAdd implementation of API function add_shared_dir_readers.
Jan Cybulski [Tue, 2 Apr 2013 10:55:22 +0000 (12:55 +0200)]
Add implementation of API function add_shared_dir_readers.

[Issue#] SSDWSSP-154
[Feature] API function add_shared_dir_readers adds rx rules to an subject with shared_label for a list of applications with labels listed as a second parameter
[Cause] New API feature
[Solution] adds SMACK rx rules for listed application identifiers to shared_label.
[Verification]

Change-Id: I7eda467fe4738f9cff4f00b24156ac21c444294f

11 years agoImplement adding apps to additional groups based on enabled permissions.
Rafal Krypa [Wed, 17 Apr 2013 15:54:30 +0000 (17:54 +0200)]
Implement adding apps to additional groups based on enabled permissions.

[Issue#]       SSDWSSP-175
[Feature]      Mixing DAC and SMACK for proper database access control.
[Cause]        SQlite databases require SMACK write permissions to be readable (locking).
[Solution]     Use both DAC and SMACK to control access to databases.
[Verification] Build, install, reboot target, run tests.

Change-Id: Ic5c7da4484d857513f0015582c6ea15dfe8d0d18

11 years agoTruncate Smack file for app in app_revoke_permissions().
Rafal Krypa [Wed, 17 Apr 2013 12:04:42 +0000 (14:04 +0200)]
Truncate Smack file for app in app_revoke_permissions().

[Issue#]       N/A
[Feature]      The function removed rules from kernel, but not from disk.
[Cause]        It used to remove the file, but removal is now done in app_uninstall().
[Solution]     Add explicit truncate.
[Verification] Run tests from security-tests package.

Change-Id: I17e0cf25c95f59762a3b8fcc53a1cdf1d113d3e0

11 years agoChange implementation of have_smack()
Rafal Krypa [Fri, 12 Apr 2013 16:31:04 +0000 (18:31 +0200)]
Change implementation of have_smack()

[Issue#]       N/A
[Feature]      More reliable checking whether Smack is available in runtime.
[Cause]        Code reuse.
[Solution]     Use function provided in libsmack to check usability of smackfs.
[Verification] Run tests from security-tests.

Change-Id: Ib237a0a6ddbcdd966daac35bc8c416338c501af2

11 years agoUnify code indentation.
Rafal Krypa [Mon, 15 Apr 2013 12:38:49 +0000 (14:38 +0200)]
Unify code indentation.

[Issue#]       N/A
[Bug/Feature]  N/A
[Cause]        Previously commited code not compatible with standard used in this project.
[Solution]     Replace space indents with tabs.
[Verification] Build.

Change-Id: I9d1d557e1fa34358413438d9d8660b7a23c414f3

11 years agoFix logging ifdefs in slp-su.c.
Rafal Krypa [Mon, 8 Apr 2013 13:48:07 +0000 (15:48 +0200)]
Fix logging ifdefs in slp-su.c.

[Issue#]       N/A
[Feature]      slp-su has logging disabled.
[Cause]        Typo.
[Solution]     Correct the typo.
[Verification] Build.

Change-Id: Ifacdc02732b39c269bdb2b880b3a472ea6c742ba

11 years agoImlement app_disable_permissions() API function stub.
Rafal Krypa [Mon, 8 Apr 2013 13:46:17 +0000 (15:46 +0200)]
Imlement app_disable_permissions() API function stub.

[Issue#]       SSDWSSP-167
[Feature]      Provide API for disabling API features for applications.
[Cause]        User can decide which API feature are allowed per application.
[Solution]     Complimentary function to already existing app_enable_permissions().
[Verification] Build.

Change-Id: I1bf079280835de1a6f14bb1d201f369018ca8457

11 years agoAdd API for install antivirus (app_register_av API function). Add abstract layer...
Janusz Kozerski [Mon, 8 Apr 2013 09:31:22 +0000 (11:31 +0200)]
Add API for install antivirus (app_register_av API function). Add abstract layer to libprivilege database.

[Issue#]       SSDWSSP-176
[Feature]      New function: int app_register_av(const char* app_av_id)
[Cause]        Needed to grant an anti virus access to all others app installed in system.
[Solution]     N/A
[Verification] Build, install, reboot, run libprivilege-control tests.

Change-Id: Iaf95c89fc6a7f40240f0ba3c86bce106424935a9

11 years agoAdded add_api_feature API
Krzysztof Jackiewicz [Wed, 10 Apr 2013 10:12:59 +0000 (12:12 +0200)]
Added add_api_feature API

[Issue#] N/A
[Feature] New API for adding custom features requested
[Problem] N/A
[Cause] N/A
[Solution] API implemented

[Verification] Run libprivilege-control-test --output=text
--regexp=add_api_feature

Change-Id: I75b60bed5b0af9d3c300e90f976c4fd8e5ba5f5a

11 years agoReduce complexity from O(n) to O(log(n)) druing state search.
Bartlomiej Grzelewski [Thu, 11 Apr 2013 17:00:52 +0000 (19:00 +0200)]
Reduce complexity from O(n) to O(log(n)) druing state search.

[Issue#]   N/A
[Bug]      N/A
[Cause]    N/A
[Solution] N/A

[Verification] Build. Run libprivilege-tests.

Change-Id: I14edfeb874559aa375df6e7ede4451dab13339c5

11 years agoImplemet data control solution for OSP apps.
Bartlomiej Grzelewski [Tue, 9 Apr 2013 13:05:11 +0000 (15:05 +0200)]
Implemet data control solution for OSP apps.

[Issue#]   SSDWSSP-177
[Bug]      N/A
[Cause]    Native apps use shared memory. To Shared memory application
           needs cross rules.
[Solution] Now libprivilege may add access to shared memory created by
           provider.
[Verification] Build.

Change-Id: I92fa7826e0efe21cea346ae38968af4c582a9b68

11 years agoRevert "Temporary fix for web app launching."
Rafal Krypa [Thu, 28 Mar 2013 13:28:34 +0000 (14:28 +0100)]
Revert "Temporary fix for web app launching."

This reverts commit e11d51f7b0cf73750e2c8af872d451a221c05cfa.

Change-Id: Id841633f0e797d47ed5911243e753dd8f59ab444

11 years agoCheck validity of Smack labels in API function arguments.
Rafal Krypa [Thu, 28 Mar 2013 13:23:18 +0000 (14:23 +0100)]
Check validity of Smack labels in API function arguments.

[Issue#]       N/A
[Feature]      Catch errors with invalid Smack labels.
[Cause]        API users are passing invalid strings as Smack labels.
[Solution]     Implement internal checking of Smack labels.
[Verification] Build

Change-Id: I60d5e03fe687f5c85da2571b90c01cc94cf6d210

11 years agoAdd debug logging into app_install() and app_uninstall()
Rafal Krypa [Thu, 28 Mar 2013 11:11:00 +0000 (12:11 +0100)]
Add debug logging into app_install() and app_uninstall()

[Issue#]       N/A
[Feature]      Need to track calls into new API functions.
[Cause]        Debug logs "Enter function" missing for these two.
[Solution]     Add logging on functions entry.
[Verification] Build

Change-Id: I0a7e36451c2242df0e857ac5f051c662501de9c4

11 years agoFix logging in app_add_permissions_internal()
Rafal Krypa [Wed, 27 Mar 2013 18:26:11 +0000 (19:26 +0100)]
Fix logging in app_add_permissions_internal()

[Issue#]       N/A
[Feature]      Get some log before execution of code the log is about.
[Cause]        N/A
[Solution]     N/A
[Verification] N/A

Change-Id: If38b11f0c35b8b5345a14a3e454b46dc5cfc4b3c

11 years agoFix ifdef for debug logging.
Rafal Krypa [Wed, 27 Mar 2013 18:04:29 +0000 (19:04 +0100)]
Fix ifdef for debug logging.

[Issue#]       N/A
[Bug]          Even if enabled in cmake, debug logs doesn't work.
[Cause]        Typo in ifdef in code.
[Solution]     Correct the typo.
[Verification] Build with debug logs enabled and check if they are printed.

Change-Id: Id2d199c338502fcf658691eafebc7772ef28f2a4

11 years agoFix error handling in perm_to_smack() internal function.
Rafal Krypa [Wed, 27 Mar 2013 17:58:56 +0000 (18:58 +0100)]
Fix error handling in perm_to_smack() internal function.

[Issue#]       N/A
[Bug]          perm_to_smack() always failed.
[Cause]        Invalid handling of error codes.
[Solution]     Return success value when everything went fine.
[Verification] N/A

Change-Id: Ib55b3e68d20a5322c37ced49be152184589b8421

11 years agoFix app_install function.
Rafal Krypa [Wed, 27 Mar 2013 17:39:32 +0000 (18:39 +0100)]
Fix app_install function.

[Issue#]       N/A
[Bug]          Desn't create the file, but returns ok. error code.
[Cause]        Missing flag to open, mising goto.
[Solution]     Fix the code.
[Verification] N/A

Change-Id: Ibe2064ca055921c5dc060605a90e785531726f60

11 years agoFix for 64 bit compatibility.
Junfeng Dong [Mon, 25 Mar 2013 13:01:33 +0000 (21:01 +0800)]
Fix for 64 bit compatibility.

- Fix hardcoding path.
- Use %cmake to set default paths.
- Fix type casting between pointer and int.

Change-Id: I2d1d42843ffd71281b17bf9f88e1ddea52bc8623

11 years agoMerge "Bugfix: Ensure that SMACK labelling finishes before we start launching middlew...
Lukasz Stelmach [Fri, 29 Mar 2013 16:40:45 +0000 (01:40 +0900)]
Merge "Bugfix: Ensure that SMACK labelling finishes before we start launching middleware services"

11 years agoAdded proper #ifdef SMACK_ENABLED to new APIs static functions.
Tomasz Swierczek [Tue, 26 Mar 2013 15:31:58 +0000 (16:31 +0100)]
Added proper #ifdef SMACK_ENABLED to new APIs static functions.

[Issue#] SSDWSSP-156
[Bug]    Build break caused by missing #ifdefs
[Cause]  Code cherrypicked from private repository
[Solution] Added missing lines with #ifdefs
[Verification] Proper build with and without #ifdefs in spec file

Change-Id: I7bedc6a41bfb6911515701da1c849fbda9dab4d8

11 years agoImplicitly include base permission in app_enable_permissions().
Rafal Krypa [Tue, 26 Mar 2013 11:06:06 +0000 (12:06 +0100)]
Implicitly include base permission in app_enable_permissions().

[Issue#]       N/A
[Feature]      When adding list of permissions, also add an internal permission related to app type.
[Cause]        New semantics for permission names is incompatible with passing this from caller.
[Solution]     N/A
[Verification] Build only.

Change-Id: I254c2be16de6ec4c9a977e6d95da9f49e5e658e9

11 years agoAdded stub for add_shared_dir_readers function.
Tomasz Swierczek [Tue, 26 Mar 2013 08:30:06 +0000 (09:30 +0100)]
Added stub for add_shared_dir_readers function.

Change-Id: If6b657f841da48ffa3bd5b81f90d9c78b8f14c4c

11 years agoDon't fail when trying to enable app permissions that doesn't exist.
Rafal Krypa [Mon, 25 Mar 2013 19:38:16 +0000 (20:38 +0100)]
Don't fail when trying to enable app permissions that doesn't exist.

[Issue#]       N/A
[Feature]      Ability to function with missing Smack permission configs.
[Cause]        Not all API features are know at the moment.
[Solution]     Gently return on missing permission name.
[Verification] Build only.

Change-Id: Icdb3393a65abc820e953df646b8fb4927b4cfa49

11 years agoAdd new API function app_enable_permissions() to replace app_add_permissions() and...
Rafal Krypa [Mon, 25 Mar 2013 19:35:45 +0000 (20:35 +0100)]
Add new API function app_enable_permissions() to replace app_add_permissions() and app_add_volatile_permissions().

New function replaces the two old functions and accepts one additional argument:
application type. Permission names are now accepted in new form, compatinble
with Tizen API feature names, like "http://tizen.org/privilege/alarm".

[Issue#]       SSDWSSP-148
[Feature]      Enable passing names of application permissions in format used in specification.
[Cause]        A list of public API features with exact names was provided.
[Solution]     Implement parsing API feature names like "http://tizen.org/privilege/alarm".
[Verification] Build only.

Change-Id: Ief7b2e95950ba9fcb2890385d88a14b6843182f5

11 years agoAdd new API functions app_install() and app_uninstall().
Rafal Krypa [Mon, 25 Mar 2013 19:12:14 +0000 (20:12 +0100)]
Add new API functions app_install() and app_uninstall().

The first function must be called by installer before any other call to app_*
functions for the app. It will create empty Smack config file for the app.
It will fail if the file was already there (conflicting app_ids).
Other functions operating on Smack rules for the application will fail if
this file is not present.
The latter function removes the file, supposed to be the last call to
libprivilege-control from uninstaller.
For temporary compatibility old permissive behaviour of app_add_permissions() is
retained.

[Issue#]       N/A
[Feature]      N/A
[Cause]        N/A
[Solution]     N/A
[Verification] Build, install, reboot target.

Change-Id: I371c38b88a0c14a17eade5526e8fa1276a482f85

11 years agoNew API function app_add_friend(app_id1, app_id2).
Rafal Krypa [Fri, 22 Mar 2013 18:37:04 +0000 (19:37 +0100)]
New API function app_add_friend(app_id1, app_id2).

Function grants full Smack rule between the two applications.

[Issue#]       SSDWSSP-123
[Feature]      Provide API for hybrid applications.
[Cause]        There are groups of applications that need full access to each other.
[Solution]     Provide API for granting appropriate Smack rules.
[Verification] Build only (no tests nor API usage at the moment).

Change-Id: Iaa6b483246bcf0ecdb2f53e788b5f72b05b43645

11 years agoRework Smack-less mode.
Rafal Krypa [Fri, 1 Mar 2013 18:10:42 +0000 (19:10 +0100)]
Rework Smack-less mode.

[Issue#]       N/A
[Feature]      Only turn off parts that really require Smack support when it's not available.
[Cause]        Previous implementation was written very quickly.
[Solution]     Revise checking for Smack support and turning off parts of the functions.
[Verification] Build, install and run on Smack-less system.

Change-Id: I0f857c1a1d9cafd5523aea1280e7c1309b641aa3

11 years agoCosmetic: fix space indentation.
Rafal Krypa [Wed, 20 Feb 2013 12:17:31 +0000 (13:17 +0100)]
Cosmetic: fix space indentation.

[Issue#]       N/A
[Bug]          Inconsisten code style.
[Cause]        Different developers.
[Solution]     Unify indentation.
[Verification] Build.

Change-Id: Ia04825c77ec1a632169a910cf2adef5c222a9c59

11 years agoEnable libprivilege-control for target without smack module in kernel.
Bartlomiej Grzelewski [Fri, 15 Feb 2013 13:53:59 +0000 (14:53 +0100)]
Enable libprivilege-control for target without smack module in kernel.

[Issue#]       N/A
[Feature]      N/A
[Cause]        N/A
[Solution]     Added check if smack is supported in kernel.
[Verification] Compile, install, reboot target

Change-Id: I28bbcbe162e32a55c72c24a12c782ed269183cd8

11 years agoTemporary fix for web app launching.
Tomasz Swierczek [Fri, 15 Feb 2013 11:47:47 +0000 (12:47 +0100)]
Temporary fix for web app launching.

[Issue#]       N/A
[Feature]      N/A
[Cause]        N/A
[Solution]     Commented reset_permissions() and changed web app label to shorter
[Verification] Compile, install, reboot target

Change-Id: I77e4af57eb9050d1acf2eab24b8ccc1b145887ac

11 years agoFix for compatibility of GCC 4.7.
Junfeng [Wed, 20 Mar 2013 03:03:46 +0000 (11:03 +0800)]
Fix for compatibility of GCC 4.7.

Change-Id: If923d10339e088cc1addb7d21e68097a94d6f715

11 years agoBugfix: Ensure that SMACK labelling finishes before we start launching middleware...
Karol Lewandowski [Tue, 19 Mar 2013 15:09:39 +0000 (16:09 +0100)]
Bugfix: Ensure that SMACK labelling finishes before we start launching middleware services

11 years agoModifying rules for changed osp-*-service labels
Bumjin Im [Mon, 18 Mar 2013 09:34:07 +0000 (18:34 +0900)]
Modifying rules for changed osp-*-service labels

11 years agoModifying device node labels
Bumjin Im [Thu, 14 Mar 2013 01:26:28 +0000 (10:26 +0900)]
Modifying device node labels

11 years agoremove udev rules file
Kidong Kim [Mon, 11 Mar 2013 08:46:14 +0000 (17:46 +0900)]
remove udev rules file

11 years agoAdding missing rule for crash popup
Bumjin Im [Fri, 8 Mar 2013 08:38:21 +0000 (17:38 +0900)]
Adding missing rule for crash popup

11 years agoAdding missing rules
Bumjin Im [Mon, 4 Mar 2013 04:09:22 +0000 (13:09 +0900)]
Adding missing rules

11 years agoRevising running Smack default rules for all combinations
Bumjin Im [Sun, 3 Mar 2013 23:40:36 +0000 (08:40 +0900)]
Revising running Smack default rules for all combinations

11 years agoapply smack default rules
Kidong Kim [Thu, 28 Feb 2013 06:35:46 +0000 (15:35 +0900)]
apply smack default rules

11 years agoapply smack default rule
Kidong Kim [Tue, 26 Feb 2013 07:47:27 +0000 (16:47 +0900)]
apply smack default rule

11 years agoadd new rules
Kidong Kim [Tue, 26 Feb 2013 00:55:12 +0000 (09:55 +0900)]
add new rules

11 years agoDisable libprivilege-control logs for performance increase
Tomasz Swierczek [Tue, 19 Feb 2013 08:46:55 +0000 (09:46 +0100)]
Disable libprivilege-control logs for performance increase

[Issue#]       N/A
[Bug]          Logs degrading performance.
[Cause]        Too much logs in dlog.
[Solution]     commented line in CMakeLists.txt.
[Verification] Compile, install, reboot target - no libprivilege logs in dlog.

Change-Id: I38cd536df1e2a97bab89e526dc82ea80bf53587d

11 years ago[Release] libprivilege-control_0.0.24.TIZEN
Tomasz Swierczek [Thu, 14 Feb 2013 09:00:11 +0000 (10:00 +0100)]
[Release] libprivilege-control_0.0.24.TIZEN

* Refactoring: adjust names of some internal identifiers.
* Refactoring: removed compilation warnings when SMACK is disabled.
* Disabled SMACK operation for tizendev.org.
* Remove prefix from process labels of WRT applications.
* Provide app_reset_permissions() API function.
* Provide app_add_volatile_permissions() API function.
* Rewrite internal function set_smack_for_wrt().
* Recreate Smack configuration files for WRT devcaps.
* Remove legacy code for WRT, enable new WRT functionality.

Change-Id: Ibc6584f5b2a6ed7d5fa85f555e7ca5bee05c4056

11 years agoDisabled SMACK on tizendev.org (removed usage)
Tomasz Swierczek [Thu, 14 Feb 2013 08:57:09 +0000 (09:57 +0100)]
Disabled SMACK on tizendev.org (removed usage)

[Issue#]       N/A
[Feature]      N/A
[Cause]        SMACK is disabled on tizendev.org - libprivilege-control API needs to return success temporarily
[Solution]     Comment SMACK_ENABLED #ifdef in CMakeLists.txt
[Verification] Build, install, reboot target device

Change-Id: Icfbc38aedfffbd1b386fe62b86cf820735d06090

11 years agoRemoved compilation warnings when SMACK is disabled.
Tomasz Swierczek [Thu, 14 Feb 2013 08:06:59 +0000 (09:06 +0100)]
Removed compilation warnings when SMACK is disabled.

[Issue#]       N/A
[Feature]      N/A
[Cause]        N/A
[Solution]     #ifdef SMACK operations when SMACK_ENABLED is not set
[Verification] Build, install, reboot target device

Change-Id: I777422f68ea3e950dc451514b78f0287e1703c3c

11 years agoRemove legacy code for WRT, enable new WRT functionality.
Rafal Krypa [Wed, 13 Feb 2013 15:12:06 +0000 (16:12 +0100)]
Remove legacy code for WRT, enable new WRT functionality.

[Issue#]       SSDWSSP-95
[Feature]      Remove old APIs designed for WRT, enable the new one.
[Cause]        New API is available and the old one was never used.
[Solution]     N/A
[Verification] Build, install, run tests from security-tests package.

Change-Id: I7e010f68832c9a79a3690de34354bc29176e7ba6

11 years agoRecreate Smack configuration files for WRT devcaps.
Rafal Krypa [Wed, 13 Feb 2013 15:10:09 +0000 (16:10 +0100)]
Recreate Smack configuration files for WRT devcaps.

[Issue#]       SSDWSSP-95
[Feature]      Provide empty Smack file for each WRT devcap.
[Cause]        Unification of API for WRT apps.
[Solution]     N/A
[Verification] Build, install, run tests from security-tests package.

Change-Id: I3253e22e4de7a1f01001c89d50348fbdf1403075

11 years agoRewrite internal function set_smack_for_wrt().
Rafal Krypa [Wed, 13 Feb 2013 15:03:47 +0000 (16:03 +0100)]
Rewrite internal function set_smack_for_wrt().

[Issue#]       SSDWSSP-95
[Feature]      Rewrite Smack setting for WRT process according to new requirements.
[Cause]        Unification of API for WRT apps.
[Solution]     N/A
[Verification] Build, install, run tests from security-tests package.

Change-Id: I995f78c12c10966208509754f736358b6a01702c

11 years agoProvide app_add_volatile_permissions() API function.
Rafal Krypa [Wed, 13 Feb 2013 14:42:18 +0000 (15:42 +0100)]
Provide app_add_volatile_permissions() API function.

[Issue#]       SSDWSSP-95
[Feature]      Function for granting one-time Smack rules for an application.
[Cause]        Unification of API for WRT apps.
[Solution]     N/A
[Verification] Build, install, run tests from security-tests package.

Change-Id: I92f168b4f007adc0ac1b92437dacff911a1a262d

11 years agoProvide app_reset_permissions() API function.
Rafal Krypa [Tue, 12 Feb 2013 14:39:27 +0000 (15:39 +0100)]
Provide app_reset_permissions() API function.

[Issue#]       SSDWSSP-95
[Feature]      Function for re-reading Smack rules for an application from disk.
[Cause]        Unification of API for WRT apps.
[Solution]     N/A
[Verification] Build, install, run tests from security-tests package.

Change-Id: I5c9e5816edb19d1038ff9505845a90a2c272969e

11 years agoRemove prefix from process labels of WRT applications.
Rafal Krypa [Tue, 12 Feb 2013 13:59:14 +0000 (14:59 +0100)]
Remove prefix from process labels of WRT applications.

[Issue#]       N/A
[Feature]      Unify Smack labeling of WRT applications.
[Cause]        Unification of WRT and non-WRT APIs.
[Solution]     N/A
[Verification] Build, install, run tests.

Change-Id: I2f96cada573fb4349b76faf88f8d7ff68630c825

11 years agoRefactoring: adjust names of some internal identifiers.
Rafal Krypa [Mon, 11 Feb 2013 17:38:25 +0000 (18:38 +0100)]
Refactoring: adjust names of some internal identifiers.

[Issue#]       N/A
[Feature]      Unify internal naming convention.
[Cause]        Refactoring
[Solution]     N/A
[Verification] Build

Change-Id: Idb0ba56c36c0f65b7604eb6e45c2701defab2d7c

11 years ago[Release] libprivilege-control_0.0.23.TIZEN
Tomasz Swierczek [Wed, 6 Feb 2013 14:05:48 +0000 (15:05 +0100)]
[Release] libprivilege-control_0.0.23.TIZEN

* Fixing bug in setting execute label for executable files.
* Correct bug in dir_set_smack_r() introduced by previous fix.
* Fix implementation of setting process label from Smack exec label.
* Remove white spaces at the end of lines of smack_default_rules file

Change-Id: I4b1201ad3283e801773839291a0e902922eafe48

11 years agoFix implementation of setting process label from Smack exec label.
Rafal Krypa [Tue, 5 Feb 2013 16:10:21 +0000 (17:10 +0100)]
Fix implementation of setting process label from Smack exec label.

[Issue#]       SSDWSSP-80
[Bug]          set_smack_from_binary() gets label from symlink, not its target.
[Cause]        Used function for getting label doesn't follow symlinks.
[Solution]     Change the function to the symlink-following one.
[Verification] Build, install, run latest tests from security-tests package.

Change-Id: Ibc67d8f91621ad0ab05c1690d87604acdc78c995

11 years agoCorrect bug introduced by patch 8ee07d7.
Rafal Krypa [Tue, 5 Feb 2013 14:13:56 +0000 (15:13 +0100)]
Correct bug introduced by patch 8ee07d7.

[Issue#]       SSDWSSP-70
[Bug]          Internal function dir_set_smack_r() ignores type mask argument.
[Cause]        Lack of curly brackets after if.
[Solution]     Fix the typo in code.
[Verification] Build, install, run latest tests from security-tests package.

Change-Id: Ibed39f9f103231c904d90299eadfaf93c0524b63

11 years agoFixing bug in setting execute label for executable files
Zofia Abramowska [Tue, 5 Feb 2013 10:35:16 +0000 (11:35 +0100)]
Fixing bug in setting execute label for executable files

[Issue#] SSDWSSP-70
[Bug] Execute labels was set for all files (not only executable)
[Cause] Bad flags and logic for given API
[Solution] Changed stat flags and now execute label is set for
everything with execute permissions and then removed from directories
[Verification] Successful build

Change-Id: Ic812c4872190d0faa2d1175edb98389d79b83b61

11 years agosmack_default_rules: remove white spaces at the end of lines
Rafal Krypa [Mon, 4 Feb 2013 11:35:28 +0000 (12:35 +0100)]
smack_default_rules: remove white spaces at the end of lines

This cosmetic change is intended to align the file between RSA and private
repositories, making the diff minimal.
No functional changes introduced.

Change-Id: I78c911068bfe8254fa1040898ddfbe717a6f911c

11 years ago[Release] libprivilege-control_0.0.22.TIZEN
Tomasz Swierczek [Tue, 5 Feb 2013 08:26:44 +0000 (09:26 +0100)]
[Release] libprivilege-control_0.0.22.TIZEN

* Added new API for setting access/execute labels and transmute on OSP apps directories
* Fixed dlog usage
* Reverted "make symbolic link of udev rules file" (commit c3a7c9d1188f08fdc950858c589173bb5bb0c817)

Change-Id: I4dd69f4b637207ed635d0c13332d7f0d5540b681

11 years agoCorrect debug in dir_set_smack_r().
Rafal Krypa [Mon, 4 Feb 2013 18:40:28 +0000 (19:40 +0100)]
Correct debug in dir_set_smack_r().

[Issue#]       N/A
[Bug]          Debug log about setting Smack label on file is printed even for files don't matching the mask.
[Cause]        Debug log misplaced.
[Solution]     Move the log inside if block, checking whether file should be labeled.
[Verification] Build.

Change-Id: I1d83ca6986be8e4a47818e69738a66deda1b9b74

11 years agoFix segfault in DLOG in dir_set_smack_r function.
Janusz Kozerski [Mon, 4 Feb 2013 15:36:29 +0000 (16:36 +0100)]
Fix segfault in DLOG in dir_set_smack_r function.

[Issue#]       N/A
[Bug]          Segfult in dir_set_smack_r function.
[Cause]        Wrong DLOG agrument - printing enum like a string.
[Solution]     Fix print format.
[Verification] Build libprivilege with WRT_SMACK_ENABLE and run libprivilege-control tests.

Change-Id: I7be2f912537a4585afdcf9cc088eea340dfb0c74

11 years agoChanges for label settings on directories API
Zofia Abramowska [Mon, 4 Feb 2013 15:13:57 +0000 (16:13 +0100)]
Changes for label settings on directories API

[Issue#] SSDWSSP-70
[Feature] New API for setting label on application directory and
application shared directory
[Cause] N/A
[Solution] N/A
[Verification] Successful build

Change-Id: I9b0d739ee2a4fa636a226f1ef81cd29d06cd6502

11 years agoRevert "make symbolic link of udev rules file"
Rafal Krypa [Fri, 1 Feb 2013 17:52:45 +0000 (18:52 +0100)]
Revert "make symbolic link of udev rules file"

This reverts commit c3a7c9d1188f08fdc950858c589173bb5bb0c817.

The reverted commit was a workaround for pre-v182 udev. Since udev has
been upgraded already, the workaround is no longer needed.

Change-Id: Ife6a922f0daa1ec851221151c9b1c814d63a25d0

11 years ago[Release] libprivilege-control_0.0.21.TIZEN
Rafal Krypa [Fri, 1 Feb 2013 16:24:50 +0000 (17:24 +0100)]
[Release] libprivilege-control_0.0.21.TIZEN

* add new label and change label - system::core -> sys-assert::core
* Adding new API for setting label and transmute on directory

Change-Id: Ic20d398f2f0b57654d5f0245d1c38e256e98d921

11 years agoAdding new API for setting label and transmute on directory
Zofia Abramowska [Fri, 1 Feb 2013 11:15:59 +0000 (12:15 +0100)]
Adding new API for setting label and transmute on directory

[Issue#] SSDWSSP-67
[Feature] New API for setting label and transmute on directory
[Cause] N/A
[Solution] N/A
[Verification] Successful build

Change-Id: I81e7b0cbbbc5ec857c7dc4be450691dc8d7994b5

11 years agoadd new label and change label - system::core -> sys-assert::core
Kidong Kim [Fri, 1 Feb 2013 00:38:19 +0000 (09:38 +0900)]
add new label and change label - system::core -> sys-assert::core

11 years ago[Release] libprivilege-control_0.0.20.TIZEN
Rafal Krypa [Wed, 30 Jan 2013 16:16:41 +0000 (17:16 +0100)]
[Release] libprivilege-control_0.0.20.TIZEN

* Prevent related bugfixes.
* add new default smack rule.
* add new group for crash-logger.
* add new smack label - system::crash.
* Bug fix in adding permissions.
* Implement logging in libprivilege-control.
* Fix parsing of Smack config files.
* Remove some unnecessary code from wrt_set_src_dir() and wrt_set_data_dir().

Change-Id: I70cd2ba8ab5ac876be726aac4902939efc250a61

11 years agoRemove some unnecessary code from wrt_set_src_dir() and wrt_set_data_dir().
Rafal Krypa [Tue, 29 Jan 2013 17:19:06 +0000 (18:19 +0100)]
Remove some unnecessary code from wrt_set_src_dir() and wrt_set_data_dir().

[Issue#]       N/A
[Bug]          Widget label constructed, where it is not used.
[Cause]        Only file labels are needed in those functions.
[Solution]     Remove appropriate code blocks.
{Verification] Build.

Change-Id: I3e9c6908c90efc8832f9c93177f371e1e9f5afd2

11 years agoFix parsing of Smack config files.
Rafal Krypa [Fri, 25 Jan 2013 16:13:51 +0000 (17:13 +0100)]
Fix parsing of Smack config files.

[Issue#]       N/A
[Bug]          Giving Smack permissions to apps based on permissions list not working.
[Cause]        Invalid return code from fscanf() expected.
[Solution]     Fix parsing in perm_to_smack() internal function.
[Verification] Run libprivilege-control tests from security-tests.

Change-Id: I9efd05b256e31e2c39bc479db01b744e3169c3f7

11 years agoImplement logging in libprivilege-control
Janusz Kozerski [Tue, 22 Jan 2013 15:29:43 +0000 (16:29 +0100)]
Implement logging in libprivilege-control

[Issue#]       LINUXSWAP-440
[Bug]          N/A
[Cause]        Missing logs in libprivilege-control.
[Solution]     Add logs.

[Verification] Build, install, reboot target. Verify running of native applications and widgets. Run dlogutil and check if logs are present.

Change-Id: I9e13d5f465ee306d6b350f300bd6cb0ebefe1ad8

11 years agoadd new smack label - system::crash
Kidong Kim [Wed, 30 Jan 2013 01:51:54 +0000 (10:51 +0900)]
add new smack label - system::crash

11 years agoBug fix in adding permissions.
Jan Olszak [Thu, 17 Jan 2013 14:10:26 +0000 (15:10 +0100)]
Bug fix in adding permissions.

[Issue] Bad function arguments.
[Bug] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build.

Change-Id: I2dc34ba858340316da5abd000431f9ac0d001d9c

11 years agoadd new group for crash-logger
Kidong Kim [Fri, 25 Jan 2013 05:19:36 +0000 (14:19 +0900)]
add new group for crash-logger

11 years agoadd new default smack rule
Kidong Kim [Thu, 24 Jan 2013 10:24:34 +0000 (19:24 +0900)]
add new default smack rule

11 years agoPrevent related bugfixes.
Mariusz Domanski [Tue, 15 Jan 2013 14:40:06 +0000 (15:40 +0100)]
Prevent related bugfixes.

[Issue] N/A
[Bug] Bugs found by Coverity.
[Cause] N/A
[Solution] Fix for copy-paste error.
[Verification] Build libprivilege-control, installl package
               on target and successfuly reboot target.

11 years ago[Release] libprivilege-control_0.0.19
Rafal Krypa [Thu, 10 Jan 2013 16:47:34 +0000 (17:47 +0100)]
[Release] libprivilege-control_0.0.19

* Removed "Epoch" from spec file.
* Remove stale permission files.
* Introduce WRT_ prefix in smack for current SMACK configuration files.
* Drop legacy USE_PRIVILEGE_CONTROL ifdef.
* Change syntax of SMACK config files.
* New API for native/OSP installer.
* Add SMACK config for OSP apps.

Change-Id: Ia481bcd10158a6491e439cf3bde32987c367bc6c

11 years agoAdd SMACK config for OSP apps.
Rafal Krypa [Tue, 8 Jan 2013 19:32:03 +0000 (20:32 +0100)]
Add SMACK config for OSP apps.

[Issue#]       LINUXSWAP-426
[Feature]      Add SMACK file prepared by Kidong Kim.
[Cause]        New API for OSP app installer.
[Solution]     Include the file, adapted to the final rule files format.
[Verification] N/A

Change-Id: Idb096c6841e1b92d210bdae8a98b16035d0b0953

11 years agoNew API for native/OSP installer.
Rafal Krypa [Tue, 8 Jan 2013 19:27:59 +0000 (20:27 +0100)]
New API for native/OSP installer.

[Issue#]       LINUXSWAP-426
[Feature]      New API for simplified SMACK management for native apps.
[Cause]        New API has been requested and designed.
[Solution]     Implement new functions: app_add_permissions, app_revoke_permissions, app_label_dir
[Verification] Only build verification, until the API is used.

Change-Id: I37110e030a71e958dda80650b376036c5dcc7051

11 years agoChange syntax of SMACK config files.
Rafal Krypa [Tue, 8 Jan 2013 17:15:00 +0000 (18:15 +0100)]
Change syntax of SMACK config files.

[Issue#]       LINUXSWAP-426
[Feature]      New syntax: "~APP~ OBJECT PERM" or "SUBJECT ~APP~ PERM"
[Cause]        The syntax has been discussed.
[Solution]     Use three-field syntax to make files understandable easier.
[Verification] Build, install, reboot target.

Change-Id: I5c3c7a331373495a0944680beb72f72fa6062091

11 years agoDrop legacy USE_PRIVILEGE_CONTROL ifdef.
Rafal Krypa [Tue, 8 Jan 2013 16:35:24 +0000 (17:35 +0100)]
Drop legacy USE_PRIVILEGE_CONTROL ifdef.

[Issue#]       N/A
[Feature]      Drop unused ifdef and related stub code.
[Cause]        The ifdef used to enable turning off the library functionality, but it's no longer feasible.
[Solution]     Drop the ifdef and dummy API function counterparts.
[Verification] Build, install, reboot target.

Change-Id: I7f73b8fe236785b868f14724de17e27d77d3f67d

11 years agoIntroduce WRT_ prefix in smack for current SMACK configuration files.
Rafal Krypa [Tue, 8 Jan 2013 16:30:08 +0000 (17:30 +0100)]
Introduce WRT_ prefix in smack for current SMACK configuration files.

[Issue#]       LINUXSWAP-426
[Feature]      Prepare for non-WRT smack permission configs.
[Cause]        Implementing new API for OSP apps.
[Solution]     Prefix existing SMACK config files with WRT_.
[Verification] Build, install, reboot target.

Change-Id: I2dcec947ec42ac340f8fbc383a7713ef8017b4c0

11 years agoRemove stale permission files.
Rafal Krypa [Tue, 8 Jan 2013 16:04:47 +0000 (17:04 +0100)]
Remove stale permission files.

[Issue#]       N/A
[Feature]      Remove group-based permission configs.
[Cause]        Stale permission files left after code that used them was removed.
[Solution]     Remove the files from source and CMake.
[Verification] Build, install, reboot target.

Change-Id: I013872c07773a2befe7f32cc3322efba17468349

11 years agoRemoved "Epoch" from spec file.
Tomasz Swierczek [Thu, 10 Jan 2013 15:09:40 +0000 (16:09 +0100)]
Removed "Epoch" from spec file.

Change-Id: Ifd3d4daf2d9b7cfe20d35eb83c5435323a4e74ff

11 years ago[Release] libprivilege-control_1:0.0.18
Rafal Krypa [Tue, 8 Jan 2013 10:25:44 +0000 (11:25 +0100)]
[Release] libprivilege-control_1:0.0.18

* Modify label for browser db files
* Separate ifdefs for Smack support for WRT.
* Re-enable Smack setting for native apps.
* Fix app type checking in set_app_privilege().
* smack_default_labeling: use variables for various /opt/* paths.

Change-Id: I7346a6691d72de430f5a70e4fb326797bc1baaf7

11 years agoFix app type checking in set_app_privilege().
Rafal Krypa [Tue, 18 Dec 2012 18:05:25 +0000 (19:05 +0100)]
Fix app type checking in set_app_privilege().

[Issue#] LINUXSWAP-417
[Bug] Passing type=NULL to set_app_privilege() caused segfault.
[Cause] Inappropriate handling of NULL value in this argument.
[Solution] Static function verify_app_type() now returns the app type.
[Verification] Build install, reboot target. Verify running of native applications and widgets.

Change-Id: I12c165048e8b049eb76b41afe3f214e0f92c0c55

11 years agoRe-enable Smack setting for native apps.
Rafal Krypa [Thu, 13 Dec 2012 13:45:22 +0000 (14:45 +0100)]
Re-enable Smack setting for native apps.

[Issue#] LINUXSWAP-409
[Feature] Re-enable Smack support.
[Cause] Aul needs support for SMACK64EXEC.
[Solution] Re-enable existing Smack support.
[Verification] Build install, reboot target. Verify running of native applications and widgets.

Change-Id: Ia17974eeea57c642b42a9f6d2241730eeca0f271

11 years agoSeparate ifdefs for Smack support for WRT.
Rafal Krypa [Thu, 13 Dec 2012 13:40:25 +0000 (14:40 +0100)]
Separate ifdefs for Smack support for WRT.

[Issue#] LINUXSWAP-409
[Feature] Make it possible to enable Smack for native applications only.
[Cause] Want to use non-wrt Smack features, wrt stuff still not ready.
[Solution] Add WRT_SMACK_ENABLED ifdef, use it for wrt-specific code.
[Verification] Build with different setting of SMACK_ENABLED and WRT_SMACK_ENABLED.

Change-Id: I6c0ab6fa9693908d00825cd714891bc0625bc845

11 years agosmack_default_labeling: use variables for various /opt/* paths.
Rafal Krypa [Tue, 8 Jan 2013 09:27:45 +0000 (10:27 +0100)]
smack_default_labeling: use variables for various /opt/* paths.

[Issue#]       N/A
[Feature]      Make merging between RSA and SLP easier.
[Cause]        RSA and SLP use different directories.
[Solution]     Use variables in the shell script.
[Verification] Build, install, reboot target.

Change-Id: Id6e73d0342edeb710ae31950c419c08704035396

11 years agoModify label for browser db files
Halton Huo [Wed, 5 Dec 2012 06:55:32 +0000 (14:55 +0800)]
Modify label for browser db files

11 years agofix udev and add new db
Kidong Kim [Thu, 13 Dec 2012 02:26:57 +0000 (11:26 +0900)]
fix udev and add new db

Change-Id: I4013ee838de20828ddb29dbfc12047411e4cc5a5

11 years agoudev: change heuristics for guessing camera device nodes
Rafal Krypa [Fri, 7 Dec 2012 13:13:47 +0000 (14:13 +0100)]
udev: change heuristics for guessing camera device nodes

[Bug] Camera device nodes are not detectepd properly. V4L query in udev increases boot time.
[Cause] V4L capabilities doesn't allow distinguishing camera devices.
[Solution] Use hardcoded device nodes based on kernel version number. Detect kernel version in udev rules.
[Verification] Build, install, reboot target. Verify permissions of /dev/video* nodes.

Change-Id: Ib2728bd2aba5d2008fe0efbfee6f1bd2c0d154d7

11 years agocmake: change the way the udev files are installed.
Rafal Krypa [Fri, 7 Dec 2012 14:53:20 +0000 (15:53 +0100)]
cmake: change the way the udev files are installed.

[Feature] Restructure udev files in the source and their installation.
[Solution] Move udev/rules/ to udev/rules.d, install whole udev/ directory in CMake.
[Verification] Build, install, reboot target. Verify permissions in /dev/.

Change-Id: Ibf6490b490df6319a89179cf3bfa2868f330b169

11 years agoFix problems reported on Coverity
Pawel Polawski [Wed, 7 Nov 2012 16:46:02 +0000 (17:46 +0100)]
Fix problems reported on Coverity

[Issue#]        http://cam.sprc.samsung.pl/browse/LINUXSWAP-325
[Bug]           Fix prevent defects.
[Cause]         Bugs in sorce reported by Coverity may cause software
                errors or malfunctions.
[Solution]      Bugs has been fixed.
[Verification]  Rebuild project.

Change-Id: Ibc0d085408f5ef189c09df48e23696b2ec5f1388

11 years agoAdd build type required for code coverage analysis.
Zbigniew Kostrzewa [Wed, 21 Nov 2012 11:37:17 +0000 (12:37 +0100)]
Add build type required for code coverage analysis.

[Issue#]        N/A
[Bug]           N/A
[Cause]         N/A
[Solution]      N/A
[Verification]  Build project without build type provided explicitly
and with build type set to CCOV. In both cases, project should build
successfully. In second case, with CCOV build type, additional .gcno
files should be created in the projects build root. Please, verify if
they exist.

Hint: pass `--define='build_type CCOV'` to osc build command to set
build type to CCOV.

Change-Id: I320457323e17079df11ce1d300d6e3cc81e8e58a

11 years agosystemd: Add systemd unit to set default smack labels
Karol Lewandowski [Tue, 11 Dec 2012 10:54:36 +0000 (11:54 +0100)]
systemd: Add systemd unit to set default smack labels

Signed-off-by: Jacek Migacz <j.migacz@samsung.com>
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Change-Id: Ia572357d4501b5d0f5cc003a5c0ec268a2bad89e

11 years agofix db name
Kidong Kim [Fri, 7 Dec 2012 06:04:18 +0000 (15:04 +0900)]
fix db name