mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 15:54:56 +00:00
sysctl: sysctl -a was still misbehaving, fix it
This commit is contained in:
parent
9299305756
commit
a9c3f7a19e
@ -235,8 +235,11 @@ static int sysctl_display_all(const char *path)
|
|||||||
|
|
||||||
static void sysctl_dots_to_slashes(char *name)
|
static void sysctl_dots_to_slashes(char *name)
|
||||||
{
|
{
|
||||||
char *cptr, *last_good;
|
char *cptr, *last_good, *end;
|
||||||
char *end = name + strlen(name) - 1;
|
|
||||||
|
/* It can be good as-is! */
|
||||||
|
if (access(name, F_OK) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Example from bug 3894:
|
/* Example from bug 3894:
|
||||||
* net.ipv4.conf.eth0.100.mc_forwarding ->
|
* net.ipv4.conf.eth0.100.mc_forwarding ->
|
||||||
@ -246,6 +249,7 @@ static void sysctl_dots_to_slashes(char *name)
|
|||||||
* we replaced even one . -> /, start over again,
|
* we replaced even one . -> /, start over again,
|
||||||
* but never replace dots before the position
|
* but never replace dots before the position
|
||||||
* where replacement occurred. */
|
* where replacement occurred. */
|
||||||
|
end = name + strlen(name) - 1;
|
||||||
last_good = name - 1;
|
last_good = name - 1;
|
||||||
again:
|
again:
|
||||||
cptr = end;
|
cptr = end;
|
||||||
|
Loading…
Reference in New Issue
Block a user