Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Feb 2018 18:47:22 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 40572] vipw(8) prints silly message if $EDITOR fails
Message-ID:  <bug-40572-8-zCPhoZh20Y@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-40572-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-40572-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=40572

fernando.apesteguia@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fernando.apesteguia@gmail.c
                   |                            |om

--- Comment #2 from fernando.apesteguia@gmail.com ---
Created attachment 190815
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=190815&action=edit
patch to lib/libutil/pw_util.c

With this patch, we have a nicer output. The point is to return 0 (file not
modified) if the processes exited abnormally. I think it is pretty much the
correct behavior. With this patch, on -CURRENT, this is the output:

# export EDITOR=false
# vipw
'false' failed with error code 1: Operation not permitted
vipw: no changes made

# export EDITOR=/home/test/idontexist
# vipw
'/home/test/idontexist' failed with error code 2: No such file or directory
vipw: no changes made

# export EDITOR=vim
# vipw
(I write the file)
vipw: password list updated

# vipw
(I do not write the file)
vipw: no changes made

The patch can me MFC'd to 11 cleanly.

-- 
You are receiving this mail because:
You are the assignee for the bug.


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-40572-8-zCPhoZh20Y>