Bug 150126

Summary: Vim profile script attempts write to /etc/passwd.
Product: [Fedora] Fedora Reporter: Ivan Gyurdiev <ivg231>
Component: vimAssignee: Karsten Hopp <karsten>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dwalsh, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-14 12:47:07 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:

Description Ivan Gyurdiev 2005-03-02 19:44:12 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050227 Firefox/1.0.1 Fedora/1.0.1-2

Description of problem:
Why? It causes trouble with strict policy SElinux.

[ -w /etc/passwd ] && return
if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then
  # for bash, pdksh and zsh, only if no alias is already set
  alias vi >/dev/null 2>&1 || alias vi=vim
fi

audit(1109738993.511:0): avc:  denied  { write } for  pid=2775 exe=/bin/bash name=passwd dev=dm-0 ino=669626 scontext=system_u:system_r:xdm_t tcontext=system_u:object_r:etc_t tclass=file


Version-Release number of selected component (if applicable):
vim-enhanced-6.3.061-2

How reproducible:
Always

Steps to Reproduce:
1. Install vim
2. Enable strict SELinux
3. Log into X 
  

Actual Results:  Passwd write denial 

Expected Results:  No passwd write denial.

Additional info:

Comment 1 Ivan Gyurdiev 2005-03-13 05:47:21 UTC
Status? It's a simple bug to fix. 

1) If it needs to differentiate for root, it can use the id command

2) I don't see why it needs to differentiate for root



Comment 2 Ivan Gyurdiev 2005-03-13 05:48:54 UTC
*** Bug 147650 has been marked as a duplicate of this bug. ***

Comment 5 Karsten Hopp 2005-03-14 12:47:07 UTC
fixed in 6.3.064-1.