nfs-utils-susv3-legacy.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Switch legacy index() in favour of strchr()
  2. Updated for 1.2.6 from the previous patch by Frederik Pasch.
  3. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  4. diff -Nura nfs-utils-1.2.6.orig/support/nfs/nfs_mntent.c nfs-utils-1.2.6/support/nfs/nfs_mntent.c
  5. --- nfs-utils-1.2.6.orig/support/nfs/nfs_mntent.c 2012-05-29 10:06:37.901255998 -0300
  6. +++ nfs-utils-1.2.6/support/nfs/nfs_mntent.c 2012-05-29 10:06:45.726312410 -0300
  7. @@ -9,7 +9,7 @@
  8. */
  9. #include <stdio.h>
  10. -#include <string.h> /* for index */
  11. +#include <string.h> /* for strchr */
  12. #include <ctype.h> /* for isdigit */
  13. #include <sys/stat.h> /* for umask */
  14. #include <unistd.h> /* for ftruncate */
  15. @@ -172,7 +172,7 @@
  16. return NULL;
  17. mfp->mntent_lineno++;
  18. - s = index (buf, '\n');
  19. + s = strchr (buf, '\n');
  20. if (s == NULL) {
  21. /* Missing final newline? Otherwise extremely */
  22. /* long line - assume file was corrupted */
  23. @@ -180,7 +180,7 @@
  24. fprintf(stderr, _("[mntent]: warning: no final "
  25. "newline at the end of %s\n"),
  26. mfp->mntent_file);
  27. - s = index (buf, 0);
  28. + s = strchr (buf, 0);
  29. } else {
  30. mfp->mntent_errs = 1;
  31. goto err;
  32. diff -Nura nfs-utils-1.2.6.orig/utils/mount/error.c nfs-utils-1.2.6/utils/mount/error.c
  33. --- nfs-utils-1.2.6.orig/utils/mount/error.c 2012-05-29 10:06:37.946256325 -0300
  34. +++ nfs-utils-1.2.6/utils/mount/error.c 2012-05-29 10:06:45.727312416 -0300
  35. @@ -62,7 +62,7 @@
  36. char *tmp;
  37. if (estr) {
  38. - if ((ptr = index(estr, ':')))
  39. + if ((ptr = strchr(estr, ':')))
  40. estr = ++ptr;
  41. tmp = &errbuf[spos];
  42. diff -Nura nfs-utils-1.2.6.orig/utils/mountd/fsloc.c nfs-utils-1.2.6/utils/mountd/fsloc.c
  43. --- nfs-utils-1.2.6.orig/utils/mountd/fsloc.c 2012-05-29 10:06:37.911256072 -0300
  44. +++ nfs-utils-1.2.6/utils/mountd/fsloc.c 2012-05-29 10:07:11.140322564 -0300
  45. @@ -127,7 +127,7 @@
  46. bool v6esc = false;
  47. xlog(L_NOTICE, "method_list(%s)", data);
  48. - for (ptr--, listsize=1; ptr; ptr=index(ptr, ':'), listsize++)
  49. + for (ptr--, listsize=1; ptr; ptr=strchr(ptr, ':'), listsize++)
  50. ptr++;
  51. list = malloc(listsize * sizeof(char *));
  52. copy = strdup(data);