Page MenuHomeFreeBSD

Make vipw error message less cryptic
ClosedPublic

Authored by pstef on Jun 20 2020, 1:10 AM.
Tags
None
Referenced Files
F171053478: D25369.id73366.diff
Tue, Sep 8, 10:31 AM
F171004130: D25369.id73361.diff
Tue, Sep 8, 3:31 AM
Unknown Object (File)
Sat, Sep 5, 4:39 AM
Unknown Object (File)
Wed, Sep 2, 8:07 AM
Unknown Object (File)
Wed, Sep 2, 4:55 AM
Unknown Object (File)
Wed, Sep 2, 3:16 AM
Unknown Object (File)
Mon, Aug 31, 3:22 AM
Unknown Object (File)
Mon, Aug 31, 3:19 AM
Subscribers

Details

Summary

Unable to find an editor, vipw would give this error:

# env EDITOR=fnord vipw
vipw: pw_edit(): No such file or directory

vigr or crontab do better:

# env EDITOR=fnord crontab -e
crontab: no crontab for root - using an empty one
crontab: fnord: No such file or directory
crontab: "fnord" exited with status 1

After this change, vipw behaves more like vigr or crontab:

# env EDITOR=fnord vipw
vipw: fnord: No such file or directory
vipw: "fnord" exited with status 1

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

pstef requested review of this revision.Jun 20 2020, 1:10 AM
pstef created this revision.
pstef edited the summary of this revision. (Show Details)
rpokala added a subscriber: rpokala.

Seems reasonable.

This revision is now accepted and ready to land.Jun 20 2020, 1:18 AM
emaste added a subscriber: emaste.
emaste added inline comments.
lib/libutil/pw_util.c
312 ↗(On Diff #73361)

this seems slightly unusual, typical would be err(1, "setgid"); I think

This revision was automatically updated to reflect the committed changes.