Bug 848929

Summary: groupadd fails to rename group file across filesystem boundary
Product: [Fedora] Fedora Reporter: Michael Dale Long <nikarul>
Component: shadow-utilsAssignee: Tomas Mraz <tmraz>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 16CC: pvrabec, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 702172 Environment:
Last Closed: 2012-08-17 06:47:29 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 Michael Dale Long 2012-08-16 20:39:47 UTC
I was able to reproduce this bug in Fedora 16 with current updates (as of this writing).



+++ This bug was initially created as a clone of Bug #702172 +++

Description of problem:

Attempting to add a group fails because the call to rename /etc/group+ to /path/on/other/fs/group fails.


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

shadow-utils-4.1.4.2-11.fc14.x86_64


How reproducible:

100%

Steps to Reproduce:
1.  Move /etc/group to another filesystem (e.g. /mnt/group).
2.  Symlink /etc/group to /mnt/group
3.  Attempt to add a group with 'groupadd test'
  
Actual results:

Groupadd fails to add a group:
"groupadd: failure while writing changes to /etc/group"

Expected results:

Groupadd should add the group successfully.

Additional info:

From strace output, it appears that the call to rename('/etc/group+', '/mnt/etc/group') is the failure point.  A possible solution would be to ensure group+ is created in the same directory as group.

--- Additional comment from nikarul on 2011-05-04 20:24:25 EDT ---

This appears to happen to passwd, shadow, and gshadow as well, probably for similar reasons.

Comment 1 Tomas Mraz 2012-08-17 06:47:29 UTC
Please report the issue upstream. I don't think this use-case is really important and useful.