All of lore.kernel.org
 help / color / mirror / Atom feed
* selinux_file_context_verify function returns wrong value.
@ 2011-02-14 15:56 Richard Haines
  2011-02-16 18:25 ` Stephen Smalley
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Haines @ 2011-02-14 15:56 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 735 bytes --]

The selinux_file_context_verify seems to return the wrong value when I know the context of the file and that in the file_contexts file are the same (returns '1' but according to man page should be '0').
 
Looking at the libselinux source code (matchpathcon.c) the line:
 
       rc = (selinux_file_context_cmp(fcontext, con) == 0);
 
seems the problem.
 
I'm using libselinux 2.0.96
 
So should it return 0 on match, 1 if contexts are different (or if the file / file_contexts entries do not exist) and -1 on error.
 
And just to clarify the selinux_file_context_cmp function return values:
 
     Should it return 0 on match (after the 'user:' portion), 1 if contexts do not match and -1 on error.
 
Thanks
Richard
 

[-- Attachment #2: Type: text/html, Size: 1172 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-10 15:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-14 15:56 selinux_file_context_verify function returns wrong value Richard Haines
2011-02-16 18:25 ` Stephen Smalley
2011-03-09 16:34   ` Richard Haines
2011-03-10 15:01     ` Daniel J Walsh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.