FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 12-15-2009, 05:50 PM
Peter Jones
 
Default Catch failures to set selinux contexts so it doesn't cause a crash.

On 12/15/2009 01:28 PM, David Lehman wrote:
> ---
> isys/isys.py | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/isys/isys.py b/isys/isys.py
> index 14d2a5d..9341c6b 100755
> --- a/isys/isys.py
> +++ b/isys/isys.py
> @@ -612,9 +612,13 @@ def matchPathContext(fn):
> # @param instroot An optional root filesystem to look under for fn.
> def setFileContext(fn, con, instroot = '/'):
> full_path = os.path.normpath("%s/%s" % (instroot, fn))
> + rc = False
> if con is not None and os.access(full_path, os.F_OK):
> - return (selinux.lsetfilecon(full_path, con) != 0)
> - return False
> + try:
> + rc = (selinux.lsetfilecon(full_path, con) == 0)
> + except OSError:
> + log.info("failed to set SELinux context for %s" % full_path)
> + return rc
>
> ## Restore the SELinux file context of a file to its default.
> # @param fn The filename to fix.

Same comment on the error message as previous patch. I also think we
should avoid calling this on empty mountpoints...

Basically, I think if this error shows up in the log, it's indicative of
a bug, though not necessarily one we *really* care about.

--
Peter

When privacy is outlawed only outlaws will have privacy.
-- Zimmermann

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 08:37 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org