On 04/19/2013 02:21 PM, Patrik Flykt wrote:
On Fri, 2013-04-19 at 13:59 +0200, Daniel Wagner wrote:
This function now does find_policy_by_string(), it seems. Although
here
it is unknown wheth er the intention is to match against lsm_ctx
(which
probably is a file name?), user or group. But it is impossible to
know
which of these three matched.
Why would you want to know which of them has matched? The ordering of
the matches is defined.
The ordering is defined, yes. But if the intention is to match members
of a Unix group called 'ivi', the current code will match against a Unix
user name called 'ivi'. Just belonging to a group that has an identical
name as a user name should not be considered a proper match.
Ah, I see. Anyway, I'll need to change this snippet to support matching
on multiple groups a process might belong to.
The argument name called 'filename' is interesting as the comparison is
against the variable names 'policy->user' and 'policy->group'. It does
not sound logical to me.
Original idea was that the filename is used to as id we want to lookup.
Maybe I should call it just 'key'? Would that help?
cheers,
daniel
_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman