2
1

busybox-1.13.2-mdev.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. --- busybox-1.13.2/testsuite/mdev.tests Sun Nov 9 18:28:19 2008
  2. +++ busybox-1.13.2-mdev/testsuite/mdev.tests Mon Jan 12 08:59:15 2009
  3. @@ -111,6 +111,22 @@
  4. # continuing to use directory structure from prev test
  5. rm -rf mdev.testdir/dev/*
  6. +echo "sda 0:0 644 =block/ @echo @echo TEST" >mdev.testdir/etc/mdev.conf
  7. +testing "mdev move and command" \
  8. + "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
  9. + ls -lnR mdev.testdir/dev | $FILTER_LS2" \
  10. +"\
  11. +@echo TEST
  12. +mdev.testdir/dev:
  13. +drwxr-xr-x 2 0 0 block
  14. +
  15. +mdev.testdir/dev/block:
  16. +brw-r--r-- 1 0 0 sda
  17. +" \
  18. + "" ""
  19. +
  20. +# continuing to use directory structure from prev test
  21. +rm -rf mdev.testdir/dev/*
  22. echo "@8,0 :1 644" >mdev.testdir/etc/mdev.conf
  23. testing "mdev #maj,min and no explicit uid" \
  24. "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
  25. --- busybox-1.13.2/util-linux/mdev.c Sun Nov 9 18:28:22 2008
  26. +++ busybox-1.13.2-mdev/util-linux/mdev.c Mon Jan 12 08:59:15 2009
  27. @@ -179,8 +179,9 @@
  28. unsigned i, n;
  29. #endif
  30. char *a = val;
  31. - s = strchr(val, ' ');
  32. - val = (s && s[1]) ? s+1 : NULL;
  33. + s = strchrnul(val, ' ');
  34. + val = (s[0] && s[1]) ? s+1 : NULL;
  35. + s[0] = '\0';
  36. #if ENABLE_FEATURE_MDEV_RENAME_REGEXP
  37. /* substitute %1..9 with off[1..9], if any */
  38. n = 0;