Bug 747335

Summary: yppasswdd returns success when /etc/passwd.adjunct is not writable
Product: [Fedora] Fedora Reporter: Honza Horak <hhorak>
Component: ypservAssignee: Honza Horak <hhorak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: hhorak, kklic, ovasik
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ypserv-2.26-8.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 747317 Environment:
Last Closed: 2011-12-10 19:45:35 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:
Bug Depends On: 747317    
Bug Blocks: 747334    

Description Honza Horak 2011-10-19 14:21:50 UTC
+++ This bug was initially created as a clone of Bug #747317 +++

Description of problem:
If rpc.yppasswdd cannot write into /etc/passwd.adjunct (or /etc/shadow in standard configuration) because of wrong SELinux context, rpc.yppasswdd still reports success, which is wrong.

Version-Release number of selected component (if applicable):
ypserv-2.19-8.el5

How reproducible:
every-time

Steps to Reproduce:
1. change context of /etc/shadow or /etc/passwd.adjunct to wrong one
# chcon -t etc_t /etc/passwd.adjunct
2. try to change password of a user using yppasswd
3. /etc/passwd.adjunct is not updated and a message "Cannot create backup file /etc/passwd.adjunct.OLD: Permission denied" is logged into /var/log/messages
  
Actual results:
yppasswd returns success, so as rpc.yppasswdd in /var/log/messages

Expected results:
yppasswd returns failure, so as rpc.yppasswdd in /var/log/messages

--- Additional comment from hhorak on 2011-10-19 10:14:06 EDT ---

Created attachment 529012 [details]
proposed patch that reports failure when rename() fails

Comment 1 Fedora Update System 2011-11-28 11:47:51 UTC
ypserv-2.26-8.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/ypserv-2.26-8.fc16

Comment 2 Fedora Update System 2011-11-29 00:08:30 UTC
Package ypserv-2.26-8.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ypserv-2.26-8.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-16503/ypserv-2.26-8.fc16
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2011-12-10 19:45:35 UTC
ypserv-2.26-8.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.