sysctl: do not error out showing write-only data. Closes 6386
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 24 Feb 2014 16:28:43 +0000 (17:28 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 24 Feb 2014 16:28:43 +0000 (17:28 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
procps/sysctl.c

index c6a1de21dc2988d04bd081a487dea42eaf6e3373..f0883f05405a0a2d92c37d7b9211e28596061f20 100644 (file)
@@ -129,6 +129,9 @@ static int sysctl_act_on_setting(char *setting)
 
        if (fd < 0) {
                switch (errno) {
+               case EACCES:
+                       /* Happens for write-only settings, e.g. net.ipv6.route.flush */
+                       goto end;
                case ENOENT:
                        if (option_mask32 & FLAG_SHOW_KEY_ERRORS)
                                bb_error_msg("error: '%s' is an unknown key", outname);