platform/core/security/security-server.git
10 years agoRemove retry timeout check
Lukasz Wojciechowski [Mon, 9 Dec 2013 15:36:16 +0000 (16:36 +0100)]
Remove retry timeout check

[Issue#]       SSDWSSP-709
[Feature/Bug]  Retry timeout check is not required
[Problem]      Rapid password check sequences should be possible.
[Cause]        Retry timeout check cause may cause unnecessary failure.
[Solution]     Remove retry timeout check.
[Verification] Succesfull build and run of tests:
               security-tests.sh ss-password --output=text
               --regexp=no_retry_timeout

Change-Id: I802e5e067792182fcf7a5833f608bfb63e84b468

10 years agoFix isPwdValid. Correct logs. Change history related function names.
Lukasz Kostyra [Thu, 5 Dec 2013 07:34:55 +0000 (08:34 +0100)]
Fix isPwdValid. Correct logs. Change history related function names.

[Issue#]        N/A
[Bug]           Wrong value returned by isPwdValid. Some logs showed up incorrectly as error.
                History related functions had misleading names.
[Cause]         Incorrect casting in isPwdValid.
[Solution]      Add condition correcting returned time by isPwdValid. Correct log types. Change
                historySize related functions to maxHistorySize.
[Verification]  Build, run tests. Test tc43 should pass, others should work as earlier. Commit with
                tc43 - http://slp-info.sec.samsung.net/gerrit/#/c/357776/

Change-Id: Ic9ce0423f2ec233f3c1d8703dba8ab92e998632d

10 years agoFix improper description in header
Zofia Abramowska [Thu, 28 Nov 2013 14:12:29 +0000 (15:12 +0100)]
Fix improper description in header

[Issue#] N/A
[Feature/Bug] N/A
[Cause] Header contained wrong information about rules needed for
using security_server_check_privilege_by_sockfd
[Solution] Fixed description in header.
[Verification] Build.

Change-Id: I4ce035086268eff6f0d9d46834fe297206788923

10 years agoAdd flag checking if password is set. Correct history behaviour
Lukasz Kostyra [Tue, 3 Dec 2013 14:49:11 +0000 (15:49 +0100)]
Add flag checking if password is set. Correct history behaviour

[Issue#]        N/A
[Bug]           N/A
[Cause]         N/A
[Solution]      N/A
[Verification]  Build, install, run tests. Should pass as they passed earlier.

Change-Id: I1ab45c23564e0592c8f5912c03a96dc4cb146ead

10 years agoIncrease attempt count before checking max attempts.
Lukasz Kostyra [Tue, 3 Dec 2013 12:53:58 +0000 (13:53 +0100)]
Increase attempt count before checking max attempts.

[Issue#]        N/A
[Bug]           N/A
[Cause]         N/A
[Solution]      N/A
[Verification]  Build, install, run tests. Tests which checked for correctly returned attempt count
                should return error due to incorrect attempt count. Others should pass.

Change-Id: I120e7339e3af591374ddad5207ab8c0c8894b973

10 years agoAdd new constants to password service. Change infinite expiration time.
Lukasz Kostyra [Mon, 2 Dec 2013 14:16:11 +0000 (15:16 +0100)]
Add new constants to password service. Change infinite expiration time.

[Issue#]        SSDWSSP-700
[Feature/Bug]   Add PASSWORD_INFINITE_EXPIRATION_TIME and PASSWORD_INFINITE_ATTEMPT_COUNT constant
                to password service. Change infinite expiration time.
[Cause]         Infinite expiration time and infinite attempt count were inputed directly to
                variables in multiple places. Other infinite expiration time
[Solution]      Constants were added for simplier switching between different infinite expiration
                times and infinite attempt  counts.
[Verification]  Build, install, run tests. All should pass, except tests that treated infinite
                expiration time as 0 value.

Change-Id: I49877154e97f57ac444dbc37924bb571f4fa3abe

10 years agoChange debug flag from TIZEN_ENGINEER_MODE to TIZEN_DEBUG_ENABLE
Zbigniew Jasinski [Fri, 29 Nov 2013 10:13:14 +0000 (11:13 +0100)]
Change debug flag from TIZEN_ENGINEER_MODE to TIZEN_DEBUG_ENABLE

Also changes in spec file reflecting flag change.

[Issue#]      SSDWSSP-697
[Feature/Bug] N/A
[Problem]     Many issues in user binaries.
[Cause]       N/A
[Solution]    Add debug not only for engineering packages.

[Verification] Build with debug flag, run tests.

Change-Id: I0de009b02813785fd540e555b8c6dd5de7d0cec5

10 years agoRemove deprecated code related to sockets.
Bartlomiej Grzelewski [Wed, 27 Nov 2013 11:39:43 +0000 (12:39 +0100)]
Remove deprecated code related to sockets.

Socket "exec-path" was deprecated and was not used.
Service "echo" was removed and definition in protocol.h is not required.

[Issue#]       N/A
[Bug/Solution] N/A
[Problem]      Security-server have got 1 additional socket open.
[Solution]     Remove deprecated code and systemd configuration.

[Verification] Build, run tests.

Change-Id: If1ce352b2ecfa5e9d14e5367d4e3b1b2f8f85d07

10 years agoChange label of security-server binary.
Bartlomiej Grzelewski [Tue, 26 Nov 2013 16:17:21 +0000 (17:17 +0100)]
Change label of security-server binary.

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

[Verification] Build, run tests.

Change-Id: I1280be4bd12f07d3b9752ada06e65362374eca83

10 years agoFix errors reported by prevent.
Bartlomiej Grzelewski [Thu, 28 Nov 2013 10:15:55 +0000 (11:15 +0100)]
Fix errors reported by prevent.

[Issue#]    N/A
[Bug/Cuase] Error code was not checked.
[Solution]  N/A

[Verification] Build, run tests.

Change-Id: I33c2f0b31416a0720d5dcccb7408b7c6efc569fc

10 years agoSeparate password_set and password_reset APIs on socket level.
Marcin Niesluchowski [Wed, 27 Nov 2013 15:41:52 +0000 (16:41 +0100)]
Separate password_set and password_reset APIs on socket level.

[Issue#]        SSDWSSP-691
[Bug/Feature]   N/A
[Cause]         Applications should have access only to those functions they
                need.
[Solution]      Moving password_reset to new socket with different label.
[Verification]  Build and install. Run security-server password tests.

Change-Id: I318e649314fd7410ccfa065124b7d6175cf6687e

10 years agoRemoved echo service leftovers
Krzysztof Jackiewicz [Wed, 27 Nov 2013 10:46:12 +0000 (11:46 +0100)]
Removed echo service leftovers

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Echo service has been removed but some leftovers are still present in
code
[Cause] N/A
[Solution] Removed

[Verification] Succesfull compilation

Change-Id: I26728971dd610f103dfcaaf7dcc47f9028ffc42d

10 years agoCorrect socket paths in protocols.cpp
Lukasz Kostyra [Tue, 26 Nov 2013 16:36:51 +0000 (17:36 +0100)]
Correct socket paths in protocols.cpp

[Issue#]        SSDWSSP-686
[Bug]           Constants which contained paths to password sockets had incorrect paths.
[Cause]         N/A
[Solution]      Correct socket paths.
[Verification]  Build, install, run tests. All should pass.

Change-Id: I410d50a8ac42517a74bfdeba1e6990bd7ce169d2

10 years agoChange exec-label from "none" to "security-server"
Bartlomiej Grzelewski [Tue, 26 Nov 2013 15:46:38 +0000 (16:46 +0100)]
Change exec-label from "none" to "security-server"

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

[Verification] Build, run tests.

Change-Id: I50868c0d0a6a0eb56ab4ab9e16c59656a8a4d8b6

10 years agoUpdate systemd configuration.
Bartlomiej Grzelewski [Mon, 25 Nov 2013 17:15:44 +0000 (18:15 +0100)]
Update systemd configuration.

seucurity-server.socket is no logner used. All confituration connected
with this socket has been removed.

[Issue#]      N/A
[Bug/Problem] Unused socket was created by systemd.
[Solution]    Remove configuration.

[Verification] Build, run tests.

Change-Id: I4c7d588d6189cca129f7d4ac4b45b290dc1fbb8d

10 years agoElimination of floor (_) labeled executables and relative command paths
Radoslaw Bartosiak [Mon, 25 Nov 2013 19:29:41 +0000 (20:29 +0100)]
Elimination of floor (_) labeled executables and relative command paths

[Issue#]       SSDWSSP-684
[Bug/Feature]  A security vulnerability to attacks fixed.
[Cause]        1) Using an floor labaled exec, a malicious process can pollute the floor labelled resources.
               2) If a relative path is used a different, malicious command might be executed (PATH change)
[Solution]     The floor labaled executables and relative command paths were eliminated.
[Verification] 1) Build, install and run tests.
               2) Verify that no executables from the package has the floor label.
               3) Verify that there are no relative command paths in scripts installed by the package.

Change-Id: Ic5b948d38406c47bc424077779303636bcdc8969

10 years agoRemove API function security_server_get_object_name.
Bartlomiej Grzelewski [Mon, 25 Nov 2013 16:53:17 +0000 (17:53 +0100)]
Remove API function security_server_get_object_name.

This function provides same functionality as getgrgid and was not used
on the platform.

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

[Verification] Build platform.

Change-Id: Id7cc0acf83c7e9a7f2329eb475dc3f1fa8982899

10 years agoChange timeout in clinet from 1 secont to 2 seconds.
Bartlomiej Grzelewski [Tue, 19 Nov 2013 17:10:25 +0000 (18:10 +0100)]
Change timeout in clinet from 1 secont to 2 seconds.

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

[Verification] Build, run tests.

Change-Id: I6f82c20889d1a19a0f43ebf1bcf29c90151dc2f7

10 years agoRemove unused header file.
Bartlomiej Grzelewski [Mon, 25 Nov 2013 10:24:17 +0000 (11:24 +0100)]
Remove unused header file.

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

[Verification] N/A

Change-Id: I2e759f6ecdc7c49d5efc8e9a8d12712242f7a4ec

10 years agoMove init of SmackAuditLog to security-server.
Bartlomiej Grzelewski [Mon, 25 Nov 2013 10:24:46 +0000 (11:24 +0100)]
Move init of SmackAuditLog to security-server.

In old implementation SmackAuditLog was always added to provider list
and it cause problem inside security-server-client library because
process that loaded this library was not allowed to access smack log
files.

[Issue#]      N/A
[Problem/Bug] Lots of SMACK deny logs in audit files.
[Cause]       Unecessary initialization of SmackAuditLog inside client-library.
[Solution]    Remove SmackAuditLog from client.

[Verification] Build, run tests.

Change-Id: I08b5bcfe0a539d73f8c38b0fe234476b5c679631

10 years agoFlush files with security server passwords data
Jan Cybulski [Fri, 22 Nov 2013 17:14:24 +0000 (18:14 +0100)]
Flush files with security server passwords data

[Issue#]       SSDWSSP-683
[Bug/Feature]  Information about putting password attempts was not flushed.
[Solution]     Flush that information to file. Test shown, that only using
               fsynch gives proper result.
[Veryfication] Build, install, run tests.

Change-Id: I96ee50186253d3efd1c74f3e2821dbc4f845a056

10 years agoRemove all legacy code from security-server
Bartlomiej Grzelewski [Tue, 5 Nov 2013 12:36:20 +0000 (13:36 +0100)]
Remove all legacy code from security-server

[Issue#]   SSDWSSP-424
[Bug]      N/A
[Problem]  Old code was not immune for interupts and have many
           synchronization issues.
[Solution] N/A

[Verification] Build, run tests.

Conflicts:

src/communication/security-server-comm.c
src/include/security-server-comm.h
src/server/main/security-server-util.cpp

Change-Id: Ifc091f4dd8994b53c76f90898e5d39ec2c12547a

10 years agoAPI function try/catch decoration
Krzysztof Jackiewicz [Tue, 5 Nov 2013 14:12:52 +0000 (15:12 +0100)]
API function try/catch decoration

[Issue#] SSDWSSP-636
[Feature/Bug] N/A
[Problem] Lot of duplicated try/catch code in every API function
[Cause] N/A
[Solution] Use lambda expressions and a decorator function.

[Verification] Successfull compilation and passing security-server-tests-*

Conflicts:

src/server2/client/client-password.cpp
src/server2/client/client-socket-privilege.cpp
src/server2/client/client-common.cpp
src/server2/client/client-common.h

Change-Id: I0097d8e02e28b8f50d88f74bed900e5761e8b4a6

10 years agoRewrite security-server password service to security-server 2
Lukasz Kostyra [Tue, 24 Sep 2013 12:23:54 +0000 (14:23 +0200)]
Rewrite security-server password service to security-server 2

[Issue#]        SSDWSSP-366
[Feature]       New password service to security-server 2 API
[Cause]         N/A
[Solution]      N/A
[Verification]  Build, install, run security-server-tests-password --output=text. With commit that
                adapts tests to this framework ( http://slp-info.sec.samsung.net/gerrit/#/c/339854 )
                all tests should pass.

Conflicts:

packaging/security-server.spec
src/CMakeLists.txt
src/server2/client/client-common.h
src/server2/common/protocols.cpp
src/server2/common/protocols.h
src/server2/main/server2-main.cpp
src/server2/service/cookie.h
systemd/CMakeLists.txt
systemd/security-server.service
src/server/security-server-password.c

Change-Id: Id1534e2cac06b499580d0ba94ff117275f7c00e8

10 years agoService connection info refactoring
Krzysztof Jackiewicz [Thu, 21 Nov 2013 10:06:47 +0000 (11:06 +0100)]
Service connection info refactoring

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Services use similar connection info maps.
[Cause] N/A
[Solution] Commonly used types moved to common header. Service specific types
renamed and moved to class internals.

[Verification] Successfull compilation

Change-Id: I5296bbc7b23b2ed4183a11213398ca8cd85d3691

10 years agoNew Security Server security_server_open_for function.
Zbigniew Jasinski [Wed, 9 Oct 2013 09:56:51 +0000 (11:56 +0200)]
New Security Server security_server_open_for function.

This function allows to create, if doesn't exist, or open existing file by
Security Server on behalf of calling process in secured directory.

[Issue#]        SSDWSSP-398
[Bug/Feature]   New SS API function.
[Cause]         DataControl issues.
[Solution]      Proposal for DataControl issues.
[Verification]  Build and run new tests:
                security-server-tests-server --output=text --regexp='open_for'

Change-Id: I9eaa69d37c20a2eb8aa3f8ba9e3aa6ef6291bae7

10 years agoSecurity-server new API for privilege checking
Marcin Lis [Fri, 18 Oct 2013 16:13:43 +0000 (18:13 +0200)]
Security-server new API for privilege checking

[Issue#]       SSDWSSP-527
[Feature]      Introduce two new SS API functions.
[Cause]        New API will improve the performance while checking
               app privileges.
[Solution]     Two new functions in client API enable to check whether a given
               app or caller app has enabled permission specified by name.
               Modified service: app-permissions.
               Two new sockets added to systemd and affected service.
[Verification] Build, install & run tests.
               Verify together with new libprivilege database.

Change-Id: If8d4efd30bbf22f82cd1442256ccbe7efb68a8aa

10 years agoRemove unused service.
Bartlomiej Grzelewski [Thu, 14 Nov 2013 16:25:40 +0000 (17:25 +0100)]
Remove unused service.

[Issue#]    N/A
[Bug]       N/A
[Cause]     Code that was using exec serivice was removed.
[Problem]   Service exec path was not used.
[Solution]  Deprecated code has been removed.

[Verification] Build, run tests.

Change-Id: I33e5ba64486d4b631a8a92a8a1af65e1e2ca096b

10 years agoStore smack deny logs into files
Marek Smolinski [Thu, 31 Oct 2013 09:05:51 +0000 (10:05 +0100)]
Store smack deny logs into files

SS logs smack deny access into file in /var/log/audit/
Files are create sequential, if max file number in config is reach
it deleted oldest file and creates new one.

Configuration file security-server-audit.conf at
/etc/security/ containing number of files log and max size in bytes peer
file.

    [Issue#]        SSDWSSP-614
    [Bug/Feature]   SS creates log files on runtime and sequential
                    loging smack access
    [Cause]         N/A
    [Solution]      Add AuditSmackLog Class to manage log files
    [Verification]  Compile, run tests

Change-Id: I5d3e9c436bda6d545748da525cb3507488c47380

10 years agoSecurity-server documentation and manifest update
Pawel Polawski [Fri, 25 Oct 2013 09:33:52 +0000 (11:33 +0200)]
Security-server documentation and manifest update

[Issue#]        SSDWSSP-505
[Bug/Feature]   SS manifest update
[Cause]         SS manifest out of date
[Solution]      Manifest and header updated
[Verification]  Compile, run tests

Change-Id: Ic1358611a6d13d820407a672cc200b1074d8f536

10 years agoFixing some security-server cookie service functions to work on smack disabled.
Marcin Niesluchowski [Mon, 28 Oct 2013 07:08:49 +0000 (08:08 +0100)]
Fixing some security-server cookie service functions to work on smack disabled.

[Issue#]        SSDWSSP-603
[Bug/Feature]   Nosmack security-server client tests fail due to incorrect
                security-server implementation for smack disabled.
[Cause]         Security-server cookie service generates incorrect label for
                nosmack and privilegeByCookieRequest does not check for smack.
[Solution]      Changing label to empty string and adding smack_check().
[Verification]  Running nosmack security-server client tests. Test
                tc05_check_privilege_by_cookie_nosmack and
                tc_security_server_get_smacklabel_cookie_nosmack should pass.

Change-Id: Ibf1ea7976d9442c56f718f8e4ca11939391cc8cd

10 years agoRemove false alarm from prevent.
Bartlomiej Grzelewski [Mon, 28 Oct 2013 13:21:15 +0000 (14:21 +0100)]
Remove false alarm from prevent.

[Issue#]   N/A
[Bug]      N/A
[Cause]    Prevent reported that readlink may return value 4096 and
           instruction path[retval] = 0 will cause segmentation fault.
[Problem]  Prevent.

[Verification] Build, run tests.

Change-Id: I5eebb22f00bb43f30024b0da297a6ec2465d6454

10 years agoAdd suppor for sendmsg to security-server.
Bartlomiej Grzelewski [Mon, 21 Oct 2013 11:20:43 +0000 (13:20 +0200)]
Add suppor for sendmsg to security-server.

[Issue#]   SSDWSSP-598
[Problem]  OpenFor service must use sendmsg for communication.
[Cause]    OpenFor service must pass descriptor to client.
[Solution] Add support for sendmsg.

[Verification] Build, run tests.

Change-Id: I1650c6d98692985bf16b32134950b5c750c56a70

10 years agoRemove deprecated SS_SMACK logs.
Bartlomiej Grzelewski [Thu, 24 Oct 2013 12:51:34 +0000 (14:51 +0200)]
Remove deprecated SS_SMACK logs.

Each api privided by security-server uses separate socket. Each socket
is secured with diffrent smack label (for example socket:
security-server-api-data-share.sock is secured with label
security-server::api-data-share). In this way all deny logs connected
with smack were moved from dlog to dmesg. Also secure mechanism
connected with SMACK was removed from security-server code. Now,
secuirty-server is using SMACK check provided by linux kernel.

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

[Verification] Build, run tests.

Change-Id: Id9b6f05731e281a6187d3c5696a44f04a754041e

10 years agoSecurity-server was not restarded after update.
Bartlomiej Grzelewski [Thu, 17 Oct 2013 15:14:53 +0000 (17:14 +0200)]
Security-server was not restarded after update.

[Issue#]    N/A
[Bug]       New sockets were not activated after update.
[Cause]     N/A
[Problem]   Lots of tests fails after security server update.

[Verification] Build, run tests.

Change-Id: I225bac131d0f2fa24d23051528189672346793f2

10 years agoAdopt for gcc 4.8. Remove multiple static_cast from code.
Bartlomiej Grzelewski [Wed, 2 Oct 2013 13:57:23 +0000 (15:57 +0200)]
Adopt for gcc 4.8. Remove multiple static_cast from code.

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

[Verification] Build, run tests.

Change-Id: Ia8f73f4bf4c92a825325885f8c42a8ddfe391998

10 years agoFix synchronization problem during application closing
Piotr Bartosiewicz [Thu, 10 Oct 2013 12:11:45 +0000 (14:11 +0200)]
Fix synchronization problem during application closing

[Issue#]        N/A
[Bug]           Application may not close imediately in rare cases.
[Cause]         Synchronization issue.
[Solution]      Fixed synchronization issue.
[Verification]  Build secutiry server, run tests.

Change-Id: I70bf075c38c312731ec5fb360644068e056ae000

10 years agoRename methods read and readOne in each service
Piotr Bartosiewicz [Thu, 10 Oct 2013 08:16:32 +0000 (10:16 +0200)]
Rename methods read and readOne in each service

[Issue#]        SSDWSSP-577
[Feature]       Method read and readOne should be renames to process and
                processOne.
[Cause]         There is nothing to read in this methods.
[Solution]      Method was renames.
[Verification]  Build security server and run tests on target.

Change-Id: I1c67834e73f021402b1bfb45323ba5d5370a9f2f

10 years agoRemoved unused virtual method Event(ErrorEvent) from GenericSocketService and all...
Adam Malinowski [Fri, 20 Sep 2013 06:37:10 +0000 (08:37 +0200)]
Removed unused virtual method Event(ErrorEvent) from GenericSocketService and all it's implementations.
[Issue#] SSDWSSP-480 /3
[Feature] Method Event(ErrorEvent) should be removed.
[Cause] It is not used so it is not needed.
[Solution] Method was removed.
[Verification] Build security-server and run security server tests on target.

Change-Id: If933780083e2bc8c0e644427c1e8ad768e2b4c1a

10 years agoRenamed class SocketBuffer to MessageBuffer and all its usages.
Adam Malinowski [Thu, 19 Sep 2013 12:42:26 +0000 (14:42 +0200)]
Renamed class SocketBuffer to MessageBuffer and all its usages.
[Issue#] SSDWSSP-480 /1
[Feature] SocketBuffer class needed to be renamed to MessageBuffer.
[Cause] SocketBuffer is not right name for this class.
[Solution] Class was renamed.
[Verification] Build security-server and run security server tests on target.

Change-Id: I8fce6aef14308389e1148599e89b3e11939a36fd

10 years agoAdd README file
Jan Cybulski [Wed, 2 Oct 2013 11:18:12 +0000 (13:18 +0200)]
Add README file

    [Issue#]       SSDWSSP-528
    [Bug/Feature]  Added README file.
    [Cause]        N/A
    [Solution]     N/A
    [Verification] N/A

Change-Id: I00a8654ab2589013e4f8849352f7d8c231c8caf5

10 years agoFix problem with security-server build with tizen 3.0 toolchain
Pawel Polawski [Wed, 25 Sep 2013 08:34:30 +0000 (10:34 +0200)]
Fix problem with security-server build with tizen 3.0 toolchain

[Issue#]        SSDWSSP-549
[Bug/Feature]   Fix errors in build
[Cause]         Required static cast in switch statement
[Solution]      Static cast added
[Verification]  Build

Change-Id: If3d354e87ed8d7edd1c485c98b1a8023876c4abd

10 years agoCompilation flags 'verbose' mode
Marcin Lis [Fri, 20 Sep 2013 09:42:17 +0000 (11:42 +0200)]
Compilation flags 'verbose' mode

[Issue#]       SSDWSSP-496
[Bug/Feature]  N/A
[Cause]        CMAKE_VERBOSE_MAKEFILE flag turned OFF in packaging spec file
[Solution]     Turn ON the flag.
[Verification] Build, verify that compile flags passed to gcc are visible
               using different build types (in gbs: --define "build_type ...").

Change-Id: I939916fabb47bfba864aba0d1e526db0ba4bdfc8

10 years agoFix security server API argument validation
Marcin Lis [Thu, 29 Aug 2013 10:10:17 +0000 (12:10 +0200)]
Fix security server API argument validation

[Issue#]       SSDWSSP-332
[Bug]          Potential bug, bad parameters (f.e. pid) may be used in two
               functions.
[Cause]        Two API functions does not validate all given arguments.
               Also there is a risk of unsigned int overflow when calculating
               password validity (when changing from days to seconds).
[Solution]     Checking existence of a process with given pid added.
               Unsigned int overflow protection is added.
               Also argument validation added to API function.
[Verification] Build, install and run tests.

Change-Id: Ia8e9528462e31220faf88c72c111b7f0efc03681

10 years agoMaking security-server buildable under GCC 4.8.
Marcin Niesluchowski [Thu, 19 Sep 2013 09:52:09 +0000 (11:52 +0200)]
Making security-server buildable under GCC 4.8.

    [Issue#]        SSDWSSP-523
    [Bug/Feature]   Security-server does not build under GCC 4.8.
    [Cause]         switch() does not accept int to enum conversion.
    [Solution]      Applying static_cast.
    [Verification]  Building under GCC 4.8.

Change-Id: Ib28b21058d6e6a63925e933aa936b8197f553393

10 years agoSecurity-server symbols hidden by default
Krzysztof Jackiewicz [Wed, 18 Sep 2013 10:12:13 +0000 (12:12 +0200)]
Security-server symbols hidden by default

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Security-server unnecessarily exports its symbols
[Cause] N/A
[Solution] Symbols hidden by default

[Verification] Successful compilation. Tests should pass as before. Security-server binary size should be ~50KB smaller.

Change-Id: Ifc82fc7dcae75a7619be0a416296d3835652aeef

10 years agoPassword validity argument check added
Krzysztof Jackiewicz [Fri, 13 Sep 2013 13:04:01 +0000 (15:04 +0200)]
Password validity argument check added

[Issue#] N/A
[Feature/Bug] N/A
[Problem] tc10_security_server_set_pwd_current_pwd_max_valid_period_in_days fails
[Cause] Password validity argument was not checked
[Solution] Check added

[Verification] Run security-server-tests-password. All should pass.

Change-Id: I564ec3fcfa905c8b3ed9af620f67dec47f86fc87

10 years agoInclude external header files with isystem.
Bartlomiej Grzelewski [Thu, 12 Sep 2013 11:22:54 +0000 (13:22 +0200)]
Include external header files with isystem.

[Issue#]   N/A
[Bug]      N/A
[Cause]    N/A
[Problem]  Waning from external libraries may cause build break when
           security-server is compiled with -Werror flag.
[Solution] Include external headers path with -isystem option.

[Verification] Successful build.

Change-Id: I97994d39fc5d466d1b6bda83b55d21ee398cd0ac

10 years agoClean-up logging
Bartlomiej Grzelewski [Wed, 11 Sep 2013 09:26:51 +0000 (11:26 +0200)]
Clean-up logging

Change logging in ss1, now in RELEASE build log only errors

    [Issue#]        SSDWSSP-457
    [Bug/Feature]   Clean-up logging
    [Cause]         N/A
    [Solution]      N/A
    [Verification]  Build

Change-Id: I1584eafdcaec478cc6ccab40bcb55a8969e21b1a

10 years agoAdd Garbage Collector in cookie module
Marek Smolinski [Thu, 5 Sep 2013 10:30:08 +0000 (12:30 +0200)]
Add Garbage Collector in cookie module

[Issue#]   SSDWSSP-495
[Bug]      N/A
[Cause]    N/A
[Solution] Add GC,gc is called each GET_COOKIE API call
[Verification] build

Change-Id: I8c64dec020174025a355ae067cb59ca5f140c117

10 years agoReduce false defects reported by prevent.
Bartlomiej Grzelewski [Tue, 10 Sep 2013 12:51:54 +0000 (14:51 +0200)]
Reduce false defects reported by prevent.

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

[Verification] Build.

Change-Id: I13bd90c0815caf6018824359d203afee8e4ca1f2

10 years agoSynchronize repositories.
Bartlomiej Grzelewski [Wed, 11 Sep 2013 09:02:56 +0000 (11:02 +0200)]
Synchronize repositories.

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

[Verification] N/A

10 years agoFix api get-cookie-uid/get-cookie-gid.
Bartlomiej Grzelewski [Tue, 10 Sep 2013 15:27:42 +0000 (17:27 +0200)]
Fix api get-cookie-uid/get-cookie-gid.

[Issue#]   N/A
[Bug]      Client was using wrong server socket and all
           request were ignored.
[Problem]  N/A
[Solution] N/A

[Verification] Build, run tests.

Change-Id: Ibee05c2be476f96756ae6cdbfcd17a454115a8b9

10 years agoImplement new API for get GID and UID by cookie
Pawel Polawski [Tue, 3 Sep 2013 15:23:38 +0000 (17:23 +0200)]
Implement new API for get GID and UID by cookie

[Issue#]        SSDWSSP-399
[Bug/Feature]   New API to security-server
[Cause]         Missing API to get UID and GID by cookie
[Solution]      New API added
[Verification]  Compile, run tests

Change-Id: Ie6f65378a31e65840b682b3a6dc2c9ab3f931ec2

10 years agoRemove support for DPL_USE_OLD_STYLE_* environment values in RELEASE build.
Bartlomiej Grzelewski [Wed, 4 Sep 2013 09:52:33 +0000 (11:52 +0200)]
Remove support for DPL_USE_OLD_STYLE_* environment values in RELEASE build.

This environment values will be supported in DEBUG build only:
 * DPL_USE_OLD_STYLE_LOGS
 * DPL_USE_OLD_STYLE_PEDANTIC_LOGS
 * DPL_USE_OLD_STYLE_LOGS_MASK

This commit turn off all logs except Error logs in RELEASE build.

[Issue#]   SSDWSSP-447
[Problem]  Security-server generates too many logs in RELEASE build.
           Debug logs may be turn on by environment values.
[Solution] Remove support for environment values.

[Verification] Successful build.

Change-Id: I557a69c007e4d916b2b2ac2f92e21572a9fb9f37

10 years agoEnabling compilation under GCC-4.8.
Bartlomiej Grzelewski [Mon, 9 Sep 2013 09:23:00 +0000 (11:23 +0200)]
Enabling compilation under GCC-4.8.

[Issue#]   N/A
[Bug]      Build break.
[Problem]  Lack of header files.
           Space is required between strings that will be concatenated.
           Remove compilation warning.
[Solution] N/A

[Verification] Build. Run tests.

Change-Id: I7c34508a17ccd539d987d887a530959b3f257b87

10 years agoAdd missing header files in cookie module.
Bartlomiej Grzelewski [Wed, 4 Sep 2013 16:15:49 +0000 (18:15 +0200)]
Add missing header files in cookie module.

[Issue#]   N/A
[Bug]      Missing include sys/smack.h in cookie module.
[Cause]    N/A
[Solution] Add missing header.

[Verification] Build, run tests.

Change-Id: I66809021fd99f4fed5fe9548e9662910d958530a

10 years agoRemove deprecated and unused code.
Bartlomiej Grzelewski [Wed, 4 Sep 2013 12:43:33 +0000 (14:43 +0200)]
Remove deprecated and unused code.

Service responsible for function security_server_check_privileges_by_pid
was written some time ago. This commit removes old implementation of
this function.

[Issue#]   SSDWSSP-424
[Bug]      N/A
[Cause]    N/A
[Solution] N/A

[Verification] Build. Run all tests.

Change-Id: I69706853b0851e1c686a543b61a4e5d8d45b1b3f

10 years agoAfter SIGTERM security-server crashes.
Bartlomiej Grzelewski [Tue, 3 Sep 2013 12:38:30 +0000 (14:38 +0200)]
After SIGTERM security-server crashes.

[Issue#]   N/A
[Problem]  NULL poiter dereference in SocketManager.
[Cause]    Pointer to SocketManager was not set in SignalService.
[Solution] Set pointer in SignalService.

[Verification] Run command "systemctl restart security-server.service".
               Security-server should restart without any errors.

Change-Id: I79e8c581c5a1d6479509713634a81521a947bfeb

10 years agoMove security server cookie API to new framework
Pawel Polawski [Thu, 1 Aug 2013 13:15:43 +0000 (15:15 +0200)]
Move security server cookie API to new framework

[Issue#]        SSDWSSP-365
[Bug/Feature]   Rewrite cookie functions to new security-server framework
[Cause]         API functions in deprecated framework
[Solution]      API functions moved to the new framework
[Verification]  No tests should fail

Change-Id: If0a12680c8d966a78a940c3656920da1beaf4285

10 years agoThis patch enable compilation under GCC-4.8
Bartlomiej Grzelewski [Mon, 26 Aug 2013 12:43:15 +0000 (14:43 +0200)]
This patch enable compilation under GCC-4.8

[Issue#]   N/A
[Bug]      Build break under GCC-4.8
[Cause]    Services does not included required header files.
[Solution] Add headers to cpp files.

[Verification] Build.

Change-Id: I114ffb5592e6c7d600c0047fc1fb2d4dbceeb913

10 years agoAdding cap check after smack_have_access in security-server and displaying logs
Marcin Niesluchowski [Mon, 19 Aug 2013 14:15:20 +0000 (16:15 +0200)]
Adding cap check after smack_have_access in security-server and displaying logs
regarding this call.

[Issue#]        SSDWSSP-454
[Bug/Feature]   SECURE_SLOG* macros used after smack_have_access() and its wrapper
                don't write messages to dlog and CAP_MAC_OVERRIDE is not checked.
[Cause]         SECURE_SLOG* macros depend on TIZEN_ENGINEER_MODE flag in dlog.h
                which is turned off.
[Solution]      Changing SECURE_SLOG* to SEC_SVR_* and Log* macros and adding check for
                CAP_MAC_OVERRIDE after smack_have_access.
[Verification]  Check dlogutil for those logs.

Change-Id: I167dea72f9c1bcbcc2c4ea7008eea3a6bbbd9c82

10 years agoAdapt security-server for a new libsmack API
Jan Cybulski [Thu, 25 Jul 2013 09:54:50 +0000 (11:54 +0200)]
Adapt security-server for a new libsmack API

    [Issue#]   SSDWSSP-433
    [Bug]      N/A
    [Cause]    Changed API of libsmack.
    [Problem]  Function smack_new_label_from_socket() is now returning value greater than 0 on success, not 0 as it was before.
    [Solution] Changes of expected function results
    [Verification] Run tests.

Change-Id: I89aa91e69fccb0091dfb1eccd2fc2d6347cfcf3b

10 years agoTurn off environment CFLAGS cleaning.
Bartlomiej Grzelewski [Thu, 1 Aug 2013 12:07:33 +0000 (14:07 +0200)]
Turn off environment CFLAGS cleaning.

CMAKE_C_FLAGS options will overwritten default environment flags.
This commit comments out this value so default evfironment values won't
be overwritten.

[Issue#]   N/A
[Bug]      N/A
[Cause]    Enable executable tuning for cortex-a8.
[Solution] N/A

[Verfication] Successful compilation.

Change-Id: Id582c07c45d7042b4fcab73f68bda8de21872321

10 years agoUnused code causing buildbreak removed
Krzysztof Jackiewicz [Tue, 13 Aug 2013 08:06:31 +0000 (10:06 +0200)]
Unused code causing buildbreak removed

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Buildbreak
[Cause] Ignored return value warning
[Solution] Code causing buildbreak is unused. It has been removed.

[Verification] Succesfull compilation. Tests should pass

Change-Id: Ibf4299964c091f478de384c7b7b4f2e6186ae0dd

Conflicts:

src/server/security-server-main.c

10 years agoFix for proc/<pid>/status line extraction crash
Krzysztof Jackiewicz [Mon, 12 Aug 2013 08:03:08 +0000 (10:03 +0200)]
Fix for proc/<pid>/status line extraction crash

[Issue#] SSDWSSP-448
[Feature/Bug] N/A
[Problem] Crash during cookie creation
[Cause] Buffer overflow
[Solution] Line extraction code rewritten to use getline

[Verification] Compile and run tests.

Change-Id: Ib69bc601847c93f8ea7f21f9520fa4c0f229bf32

10 years agoClean up after SIGTERM.
Bartlomiej Grzelewski [Wed, 17 Jul 2013 14:46:34 +0000 (16:46 +0200)]
Clean up after SIGTERM.

[Issue#]   N/A
[Bug]      N/A
[Cause]    Lack of SIGTERM support.
[Problem]  N/A
[Solution] Add support for SIGTERM signal.

[Verification] Use "systemctl restart security-server.service" command.
               Security server should be killed and restarted.

Change-Id: Ic41957bf3aaee60afb98cae6de841a057f3ad49a

10 years agoEmpty string password bug fixed.
Marcin Niesluchowski [Thu, 8 Aug 2013 11:02:04 +0000 (13:02 +0200)]
Empty string password bug fixed.

[Issue#]        SSDWSSP-422
[Bug/Feature]   Empty password should not be set.
[Cause]         N/A
[Solution]      N/A
[Verification]  Running ss-pasword tests from http://slp-info.sec.samsung.net/gerrit/#/c/259674/ commit.

Change-Id: I0063f8b315e0f0be2631a9d51d3834f070f3eb2c

10 years agoRemoving bug regarding security-server first use.
Marcin Niesluchowski [Thu, 8 Aug 2013 17:26:18 +0000 (19:26 +0200)]
Removing bug regarding security-server first use.

[Issue#]        SSDWSSP-449
[Bug/Feature]   There should be difference between initiated password time and
                first function call regarding password so that difference should
                not cause SECURITY_SERVER_ERROR_PASSWORD_RETRY_TIMER error.
[Cause]         While security-server is called for the first time, it initiates
                itself.
[Solution]      N/A
[Verification]  Running security-server ss-password tests. There should be no
                error with SECURITY_SERVER_ERROR_PASSWORD_RETRY_TIMER (value -17).

Change-Id: I67243269fc8ed0476f614ab4143d81f4c12e24ee

10 years agoReduce number of logs.
Bartlomiej Grzelewski [Thu, 8 Aug 2013 09:46:00 +0000 (11:46 +0200)]
Reduce number of logs.

Now core of security-server2 won't log any information
about timeouts. All debug logs in socket-manager were
removed. This patch should reduce number of logs for 50%.

[Issue#]      SSDWSSP-447
[Bug/Problem] Security-server generates too many logs.
[Cause]       New implementation was tested.
[Solution]    Decrease number of logs.

[Verification] Build, run tests.

Change-Id: I9c3cec96f1ca4899e8a95c988cd9dc56cf2d9db5

10 years agoAdd support for EINTR in client.
Bartlomiej Grzelewski [Wed, 31 Jul 2013 09:22:11 +0000 (11:22 +0200)]
Add support for EINTR in client.

[Issue#]     N/A
[Bug]        Poll did not support EINTR code. This error
             may break communication between security-server and client.
[Solution]   Add support for EINTR.

[Verification] Compile, run tests.

Change-Id: I0c052f3895f351adf80908db0b7c1ac826f3c0e0

10 years agoFix for unused variable warning/error
Krzysztof Jackiewicz [Wed, 7 Aug 2013 11:02:16 +0000 (13:02 +0200)]
Fix for unused variable warning/error

[Issue#] N/A
[Feature/Bug] N/A
[Problem] Buildbreak caused by unused variables
[Cause] Dlog logging macros have been recently disabled
[Solution] Variables marked as unused

[Verification] Successfull compilation

Change-Id: Idbbc5741ed14dda4484daac0edc2dbc4759c99e9

10 years agoGet rid of build warnings
Marcin Lis [Thu, 18 Jul 2013 08:35:32 +0000 (10:35 +0200)]
Get rid of build warnings

[Issue#] SSDWSSP-397
[Bug] Several warnings was appearing during package build
[Cause] These warnings mainly concern implicit functions declarations
and comparisons between variables of different types
[Solution] Adding function declarations, header file inclusions,
explicit cast operators.
Also 'Werror' flag is added to CMakeLists.txt .

[Verification] Successful compilation & all security tests successfully
completed on target device

Change-Id: I2387b829835319354097384497abd9f1eaec9636

10 years agoFix bug in app-permissions module.
Bartlomiej Grzelewski [Fri, 2 Aug 2013 09:16:55 +0000 (11:16 +0200)]
Fix bug in app-permissions module.

[Issue#]    N/A
[Bug/Cause] Function security_server_app_disable_permissions
            did not propagate success code.
[Solution]  Add return in security_server_app_disable_permissions.

[Verification] Build, run tests.

Change-Id: I389e6a65ae4f3d2e1496bf14a048274ef6263def

10 years agoFix latest prevent defects
Radoslaw Bartosiak [Mon, 29 Jul 2013 08:10:54 +0000 (10:10 +0200)]
Fix latest prevent defects

[Issue#] SSDWSSP-435
[Bug/Feature] Unitialized scalar variable.
[Cause] Using uninitialized value "cr.pid" when calling "get_exec_path(pid_t, std::string &)".
[Solution] Change of program execution flow and logging, change unique_ptr deleter.
[Verification] Analyzing execution flow, running prevent tests.

Change-Id: Iaaf0f938e6f7111419325898436245e399d652bd

10 years agoAdded API for APP enable and disable permissions
Pawel Polawski [Thu, 25 Jul 2013 13:00:48 +0000 (15:00 +0200)]
Added API for APP enable and disable permissions

[Issue#]        SSDWSSP-155
[Bug/Feature]   Implement API for removing/adding API feature rules from
                applications SMACK profile
[Cause]         Need new API
[Solution]      New API added
[Verification]  Compile. No new tests should fail

Change-Id: Ib6e95f32fa0cf0ebb2fdfd787b1c1f156b5a96b6

10 years agoSecurity-server fix.
Bartlomiej Grzelewski [Tue, 30 Jul 2013 11:20:25 +0000 (13:20 +0200)]
Security-server fix.

[Issue#]      N/A
[Bug/Feature] Null dereference when client closes connection while
              servier is writting.
[Cause]       N/A
[Problem]     N/A
[Solution]    Add additional check in CloseSocket function.

[Verification] Build, run tests.

Change-Id: I026b4cff31868dd72a1d221b8bffad108fcdf350

10 years agoAdd LogSecure* macros.
Bartlomiej Grzelewski [Fri, 19 Jul 2013 09:11:12 +0000 (11:11 +0200)]
Add LogSecure* macros.

[Issue#]   SSDWSSP-392
[Bug]      N/A
[Cause]    N/A
[Problem]  Some security-server logs must marked as "secure".
[Solution] Add support for SECURE_SLOG macro in the project.

[Verification] Run tests.

Change-Id: Ic5b4058a39ff0c1acb191871b27bafaf25f3cad7

10 years agoAdd configuration for systemd.
Bartlomiej Grzelewski [Thu, 18 Jul 2013 15:35:24 +0000 (17:35 +0200)]
Add configuration for systemd.

List of changes:
 * change socket name for get-get api
 * add systemd configuration for get-object-name api
 * remove some useless logs from services

[Issue#]      N/A
[Bug/Feature] Remove deprecated logs.
[Cause]       N/A
[Solution]    N/A

[Verification] Build, install, run tests.

Change-Id: I5eed0ab203dee6d3d777f64c6bd495ea01dbd4fb

10 years agoRemove API function security_server_launch_debug_tool()
Janusz Kozerski [Fri, 19 Jul 2013 11:55:14 +0000 (13:55 +0200)]
Remove API function security_server_launch_debug_tool()

[Issue#]        SSDWSSP-369
[Bug]           Function give an access to run any command as root.
[Cause]         Re-witing security-server.
[Solution]      Remove function.
[Verification]  Build, install, run tests.

Change-Id: I19f202608d54bdd70b4bfd5edc9dcba816854d68

10 years agoImplemented security_server_get_object_name function in new framework.
Jan Olszak [Tue, 9 Jul 2013 10:03:56 +0000 (12:03 +0200)]
Implemented security_server_get_object_name function in new framework.

[Issue#] Function for new security-server framework.
[Bug/Feature] Get name in new security-server.
[Cause] N/A
[Solution] Reimplemented solution.
[Verification]  Build, install, run tests.

Change-Id: I432170b517f4a3ee20d2db4281e18f7bd7dd449d

10 years agoRewriting client socket privilige part and adding exec path service
Zofia Abramowska [Tue, 16 Jul 2013 10:01:42 +0000 (12:01 +0200)]
Rewriting client socket privilige part and adding exec path service

[Issue#] SSDWSSP-367
[Bug/Feature] N/A
[Cause] Rewriting client API and security-server socket privilige checks
functionality to match recently written security-server services
[Solution] Rewriting client API to use new implementation of sockets,
adding new service for get execution path request
[Verification] Successful build.
        Run test 'security-server-test-client-smack'
        with 'regexp=sock' argument and check dlog logs whether
        execution path is being properly send
        (This functionality is not in ss API, so no tests for
        this specific service are available)

Change-Id: I49031860de14986f73899cb8c99f061241ede39b

10 years agoFix sendToServer function.
Bartlomiej Grzelewski [Tue, 16 Jul 2013 17:06:47 +0000 (19:06 +0200)]
Fix sendToServer function.

Security server closes connection when protocol is broken.
Client was not able to handle this situation.

[Issue#]   N/A
[Bug]      Client program may hang.
[Cause]    sendToServer function does not support
           situation when read returns 0.
[Problem]  N/A
[Solution] N/A

[Verification] Run tests.

Change-Id: Ie3002ae88c6ac4b55958b4e0d2d81ca5aacd5c43

10 years agoAdd implementation for check_privilege_by_pid in security server 2
Jan Cybulski [Fri, 12 Jul 2013 07:50:23 +0000 (09:50 +0200)]
Add implementation for check_privilege_by_pid in security server 2

    [Issue#] SSDWSSP-368
    [Bug/Feature] Check privilege by pid via security server 2
    [Cause] N/A
    [Solution] Old implementation ported to new framework.
    [Verification]  Build, install, run tests.

Change-Id: If8937113015a435ed14c31b76f9443b39776e030

10 years agoChange log destination to system journal.
Bartlomiej Grzelewski [Fri, 12 Jul 2013 11:29:59 +0000 (13:29 +0200)]
Change log destination to system journal.

[Issue#]   SSDWSSP-392
[Bug]      N/A
[Cause]    N/A
[Problem]  Security-server logs must be saved in system.
[Solution] N/A

[Verification] Run tests.

Change-Id: I95a0db02b860c961dbea4ea55138298793a295cd

10 years agoAdd socket activation for get-gid api.
Bartlomiej Grzelewski [Thu, 11 Jul 2013 16:38:26 +0000 (18:38 +0200)]
Add socket activation for get-gid api.

[Issue#]   N/A
[Bug]      N/A
[Cause]    N/A
[Problem]  Lack of socket activation for api get-gid.
[Solution] Add support for socket activation in security-server.

[Verification] Reinstall security-server. Reboot target. Run tests.

Change-Id: Ia3f1a1630df69da85398e5f53cf34a446d79bc94

10 years agoImplemented security_server_get_gid function in new framework.
Jan Olszak [Tue, 9 Jul 2013 10:03:56 +0000 (12:03 +0200)]
Implemented security_server_get_gid function in new framework.

[Issue#] Function for new security-server framework.
[Bug/Feature] Check GID in new security-server.
[Cause] N/A
[Solution] Used old implementation with small changes.
[Verification]  Build, install, run tests.

Change-Id: I3032d80dc2af8d9fa40f4aa7ab8cbf9d0daa0919

10 years agoRemove deprecated code and scripts.
Bartlomiej Grzelewski [Mon, 8 Jul 2013 12:56:53 +0000 (14:56 +0200)]
Remove deprecated code and scripts.

Removed:
 * init scripts
 * deprecated lines from spec file
 * remove deprecated code from old security server

[Issue#]   SSDWSSP-146
[Bug]      N/A
[Cause]    N/A
[Problem]  Security server starts twice (by systemd and init).
[Solution] Remove init scripts.

[Verification] Reinstall security-server. Reboot target. Run tests.

Change-Id: Ibac028b8b452284e7447b7fcb81b9a8927aded68

10 years agoConvert to systemd API.
Bartlomiej Grzelewski [Fri, 5 Jul 2013 16:54:23 +0000 (18:54 +0200)]
Convert to systemd API.

- enable socket activation
- enable sn_notify (start-up completion notification).

[Issue#]   SSDWSSP-146
[Bug]      N/A
[Cause]    N/A
[Problem]  Socket activation is required in security-server.
[Solution] Add support for socket activation in security-server.

[Verification] Reinstall security-server. Reboot target. Run tests.

Change-Id: I4d8c4f79bf1979df5e9e48b24bae9725441a9a14

10 years agoTakes compilation profile from command line.
Bartlomiej Grzelewski [Thu, 11 Jul 2013 11:16:53 +0000 (13:16 +0200)]
Takes compilation profile from command line.

This command will start compilation with debug(-O0 -g -ggdb)
    gbs lb -A armv7l --define "build_type DEBUG"

Default command will use RELEASE profile(-02 -g):
    gbs lb -A armv7l

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

[Verification] Run tests.

Change-Id: Ic1388759b720aebadcfcf98dc0fbd5a73d9eb384

10 years agoRemove compilation warnings in security-server-util-common.c
Bartlomiej Grzelewski [Thu, 11 Jul 2013 10:28:26 +0000 (12:28 +0200)]
Remove compilation warnings in security-server-util-common.c

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

[Verification] Run tests.

Change-Id: Ieb1dfb3d3de91a070286d6dc33cfd5d1340d0700

10 years agoRefactoring common utility functions
Zofia Abramowska [Wed, 10 Jul 2013 11:28:10 +0000 (13:28 +0200)]
Refactoring common utility functions

[Issue#] N/A
[Bug/Feature] N/A
[Cause] Some utility functions were not extracted to util source
files. It is needed to properly write new services for ss2
[Solution] Moved some functions out of main file to util file
[Verification] Successfull build

Change-Id: I31af2fe3618dd58c77be7b0e23faeeb6e25d6c32

10 years agoRemove deprecated code connected with shared memory.
Bartlomiej Grzelewski [Mon, 8 Jul 2013 14:46:43 +0000 (16:46 +0200)]
Remove deprecated code connected with shared memory.

[Issue#]   SSDWSSP-378
[Bug]      N/A
[Cause]    N/A
[Problem]  Some code from tutorial was release on unknown licence.
[Solution] Code was removed.

[Verification] Run tests.

Change-Id: I302d168defb16cad32d665b9046a139843fd9523

10 years agoChanged dlog logging buffer.
Jan Olszak [Thu, 4 Jul 2013 12:59:07 +0000 (14:59 +0200)]
Changed dlog logging buffer.

[Issue#] dlog logged in a wrong buffer.
[Bug/Feature]   Recent prevent bugs need fix.
[Cause]         N/A
[Solution]      N/A
[Verification]  Build, install, run "dlogutil -c", run tests, run "dlogutil -b main SECURITY_SERVER" (no loggs), "dlogutil -b system SECURITY_SERVER" (loggs..)

Change-Id: I8680f74ab4452469147e6f348c2a3491b9063bf7

10 years agoError code for empty passwords.
Jan Olszak [Tue, 2 Jul 2013 13:35:52 +0000 (15:35 +0200)]
Error code for empty passwords.

[Issue] No error code for empty passwords. Needed in tests.
[Feature] N/A
[Cause] N/A
[Solution] Added error code
[Verification]  Build

Change-Id: Icb1d6aacaf5b346ab2733245d7d328d48a1e03f5

10 years agoFixing prevent defects in security-server
Marcin Niesluchowski [Fri, 5 Jul 2013 11:27:22 +0000 (13:27 +0200)]
Fixing prevent defects in security-server
* 63411; Critical; Resource leak; In function
  SecurityServer::BinaryQueue::AppendUnmanaged(
      void const*,
      unsigned int,
      void (*)(void const*, unsigned int, void *),
      void *)
  in src/server2/dpl/core/src/binary_queue.cpp
* 63374; Critical; Explicit null dereferenced; In function
  SecurityServer::SharedMemoryService::readOne(SecurityServer::ConnectionID const&,
                                               SecurityServer::SocketBuffer &)
  in src/server2/service/data-share.cpp

[Issue#]        SSDWSSP-356
[Bug/Feature]   Prevent bugs need to be fixed.
[Cause]         N/A
[Solution]      N/A
[Verification]  Running security-server tests.

Change-Id: I816e8b50ff94470256604d37a88a400dbeac59b5

10 years agoSocket won't have any smack label when smack is turn off.
Bartlomiej Grzelewski [Wed, 3 Jul 2013 08:17:35 +0000 (10:17 +0200)]
Socket won't have any smack label when smack is turn off.

[Issue#]   SSDWSSP-68
[Bug]      Security-server does not work without smack.
[Cause]    Smack was mandatory.
[Solution] Add runtime check for smack existance.

[Verfication] Run tests.

Change-Id: I431a2c86a6f110f5c79b3795e07f32e49759cd28

10 years agoSecurity-server refactoring.
Bartlomiej Grzelewski [Mon, 20 May 2013 09:11:27 +0000 (11:11 +0200)]
Security-server refactoring.

* Rewrite shared-memory-service.
* Each service will run in own thread.
* Import log and exception modules from DPL library.
* Add serialization.
* Hide symbols in client library.

[Issue#]   SSDWSSP-68
[Bug]      N/A
[Cause]    N/A
[Solution] N/A

[Verification] Run security-server tests.

Change-Id: Ib353c4ddaccc2f4211f2bbce74dd890956fa60de

10 years agoFixing prevent defects in security-server.
Marcin Niesluchowski [Fri, 21 Jun 2013 12:05:25 +0000 (14:05 +0200)]
Fixing prevent defects in security-server.
* 60575; Major; Unsigned compared against 0; In function security_server_thread
  in src/server/security-server-main.c
* 52113; Minor; Unchecked return value; In function security_server_thread
  in src/server/security-server-main.c

[Issue#]        SSDWSSP-335
[Bug/Feature]   Prevent detected new defects.
[Cause]         N/A
[Solution]      N/A
[Verification]  Running tests.

Change-Id: Ie74a957585482b3435783c9bcba4dc1e7ce13ee2

10 years agoChanging some error logs to warnings and turning off debug logs on security-server.
Marcin Niesluchowski [Thu, 20 Jun 2013 07:57:50 +0000 (09:57 +0200)]
Changing some error logs to warnings and turning off debug logs on security-server.

[Issue#]        SSDWSSP-331
[Bug/Feature]   Too many error logs. Debug logs should be turned off.
[Cause]         N/A
[Solution]      N/A
[Verification]  Checking logs and running tests.

Change-Id: I060a891700e161064980c97a5b90c32eef47fca6