sysctl: possible bug

Denys Vlasenko vda.linux at googlemail.com
Thu Jan 8 03:35:01 UTC 2009


On Wednesday 07 January 2009 20:37, xmaks at email.cz wrote:
> Привет Денис,
> 
> прозьба пересмотреть функцию 'sysctl_dots_to_slashes'
> учитвая вызов с параметром 'net.ipv4.conf.eth0.100'.
> Правильный результат 'net/ipv4/conf/eth0.100'
> но она сейчас изготовит 'net/ipv4/conf/eth0/100'.   

Fixed:

@@ -245,8 +251,8 @@
                        *cptr = '\0';
                        //bb_error_msg("trying:'%s'", name);
                        if (access(name, F_OK) == 0) {
-                               *cptr = '/';
-                               *end = '\0'; /* prevent trailing '/' */
+                               if (cptr != end) /* prevent trailing '/' */
+                                       *cptr = '/';
                                //bb_error_msg("replaced:'%s'", name);
                                last_good = cptr;
                                goto again;


Thanks!
--
vda


More information about the busybox mailing list