Bug 144878

Summary: restorecon segfaults when no previous context
Product: [Fedora] Fedora Reporter: Sami Farin <hvtaifwkbgefbaei>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dwalsh, pgraner
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-26 14:09:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
check for null pointers in only_changed_user none

Description Sami Farin 2005-01-12 10:29:49 UTC
Description of problem:
if I e.g. install a new file to /usr/local/bin and run restorecon for it,
it segfaults after setting the context because
param b in function only_changed_user is 0.

Also, on system startup I get segfault errors when restorecon
fails for /tmp/.ICE-unix and other files.

Version-Release number of selected component (if applicable):
1.20.1-2

How reproducible:
always

Steps to Reproduce:
1. create a new file at almost any dir
2. run restorecon on it
3.
  
Actual results:
restorecon gets killed because it dereferences null pointer

Expected results:
showing that context was restored and exiting normally...

Additional info:
patch attached.  quickie fix, it just checks for null pointers,
works for me,...

Comment 1 Sami Farin 2005-01-12 10:31:16 UTC
Created attachment 109661 [details]
check for null pointers in only_changed_user

Comment 2 Daniel Walsh 2005-01-26 14:09:02 UTC
Fixed in policycoreutils-1.21.3-2