[Bug 232657] usr.sbin/sysrc: Return code 0 after failing to modify a file
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Oct 24 18:39:13 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=232657
Bug ID: 232657
Summary: usr.sbin/sysrc: Return code 0 after failing to modify
a file
Product: Base System
Version: 11.2-STABLE
Hardware: Any
OS: Any
Status: New
Severity: Affects Many People
Priority: ---
Component: misc
Assignee: bugs at FreeBSD.org
Reporter: kwiat3k at panic.pl
To reproduce try to modify file in non existing directory:
$ sysrc -f ./nonexistent/testfile foo="bar"
/usr/sbin/sysrc: cannot create ./nonexistent/testfile: No such file or
directory
$ echo $?
0
The exit code is 0 while I was expecting to see ENOENT (2).
It's the same when I try to modify file that is not accessible:
$ sysrc -f /etc/rc.conf foo=bar
/usr/sbin/sysrc: cannot create /etc/rc.conf: Permission denied
$ echo $?
0
In this case EACCESS (13) should be returned.
I don't think that distinguishing these errors is needed. Returning anything
different than 0 should do the job.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list