RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1478622 - FILE PERMISSIONS ARE REVERTING BACK TO PREVIOUS OWNER WHEN WE ARE USING VIM EDITOR
Summary: FILE PERMISSIONS ARE REVERTING BACK TO PREVIOUS OWNER WHEN WE ARE USING VIM E...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: vim
Version: 7.0
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Kamil Dudka
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-05 08:04 UTC by shanmukh
Modified: 2017-08-07 08:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-07 08:12:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description shanmukh 2017-08-05 08:04:37 UTC
Description of problem:
file permissions are reverting when we are using vim 

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

How reproducible:
First create two users(user 1 and user 2).And two users are not in sudoers file (normal users).



Steps to Reproduce:
1.Create a file using user 1 (file will have all ownership permissions with user 1)
2.Now change the ownership permission to user 2 (include no read,write,excute permissions to others or groups.file should have permission only for user 2)
3.now vim the file with user 1 and try to append the data, it will not allow you to append because user 1 don't have permission to append the data.
4.now press :wq!(forcefully quit from vim)
5.check the file permission it will change the permission from user2 to user1.



Actual results:

changing file permission from user 2 to user 1. 
Expected results:
should not change the permission when we are forcefully quitting.

Additional info:

Comment 2 Kamil Dudka 2017-08-07 08:12:27 UTC
As long as the user running vim has write access to the _directory_ where the edited file resides, vim is able to unlink the existing file and create a new file with the same name.  It does not matter which permission/owner/group the edited file had.  This is just how the file system works, nothing specific to vim.  You can achieve the same behavior with 'cp -f' for example.


Note You need to log in before you can comment on or make changes to this bug.