From: Daniel Wagner <daniel.wag...@bmw-carit.de>

Hi,

[In case you are confused about the previous version I already sent
out ignore them.  I restart again with v0 on this set.]

This is against the current master.

This series contains in the first part a few refactoring patches which
are all related to the new feature I'd like to add. That's why I am sending
them in this set.

  session_policy_local: Do not handle small allocation

Patch #1 updates session_policy_local to the new policy not trying to
handle the small allocation errors. The upsite the code paths gets
simpler to read, especially with the interaction between session core
and the plugin.

  session_policy_local: Refactor SELinux context parser

Patch #2 splits the input and parser handler so that the parser really only
parses and does not do convert from 'const unsigned char*' to 'char *'.

  session_policy_local: Add some more debug infos

Patch #3 prints a log entry whenever a session is updated due to a
changed policy files. Not strickly necessary but it helped debugging.

  session_policy_local: Print warning if loading of policy fails

The same applies for patch #4.

  session_policy_local: Track policy data structure in a separate list
  session_policy_local: Use policy_hash only to track the policy files
  session_policy_local: Rename policy_hash to file_hash
  session_policy_local: Rename ident to filename
  session_policy_local: Split LSM context ident from filename

Patch #5 - #9 change the code in that regard that now more than one 
policy file might map to a session. Think about the case where we have
a SELinux and UID file which map to a session. Currently the policy hash
is the owner of a policy (= policy file). In short these patches changing
the plugin to allow a n:1 mapping. 

  session_policy_local: Retrieve UID/GID from session user
  session-test: Add tests for session_policy_local

Finally, patch #10 introduces the new feature. From our discussion on
IRC we might want to drop the GID part. It doesn't seem really safe to
use because it is racy.  First the code retrieves the UID and then it
retrieves the GID based on the retrieved UID. 
Patch #11 adds a test for UID/GID.

cheers,
daniel

Daniel Wagner (11):
  session_policy_local: Do not handle small allocation
  session_policy_local: Refactor SELinux context parser
  session_policy_local: Add some more debug infos
  session_policy_local: Print warning if loading of policy fails
  session_policy_local: Track policy data structure in a separate list
  session_policy_local: Use policy_hash only to track the policy files
  session_policy_local: Rename policy_hash to file_hash
  session_policy_local: Rename ident to filename
  session_policy_local: Split LSM context ident from filename
  session_policy_local: Retrieve UID/GID from session user
  session-test: Add tests for session_policy_local

 plugins/session_policy_local.c | 335 +++++++++++++++++++++++++++++------------
 tools/session-test.c           | 156 +++++++++++++++++++
 2 files changed, 395 insertions(+), 96 deletions(-)

-- 
1.8.2.rc3.16.gce432ca

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to