]> git.ipfire.org Git - thirdparty/util-linux.git/commit
vipw: make vim writebackup mode work
authorSami Kerola <kerolasa@iki.fi>
Sat, 4 Aug 2012 07:33:40 +0000 (09:33 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 6 Aug 2012 12:53:02 +0000 (14:53 +0200)
commit69a826f187cbef2acf3fda2512f28ea31c42933c
treefefcc0d2ae73efa47f4ddd3b1fc7982aa548a4c9
parent7c289c7c79207b9672b598236c77439227cec041
vipw: make vim writebackup mode work

Some editors, such as Vim with 'writebackup' mode enabled, use "atomic
save" in which the old file is deleted and a new one with the same name
created in its place.  The vipw tries to detect if such happen by
looking hard temporary file link count, when it is zero reopen
temporary file by using it's path.

Reported-by: Mantas Mikulėnas <grawity@gmail.com>
References: http://www.spinics.net/lists/util-linux-ng/msg06666.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
login-utils/vipw.c