]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
escape hashes in exports
authorNeil Brown <neilb@suse.de>
Mon, 5 Jun 2006 02:27:35 +0000 (12:27 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 5 Jun 2006 02:27:35 +0000 (12:27 +1000)
  Makes sure any # signs in the printed-out exports file are
  escaped (as with quotes, spaces, etc.), so they won't be treated
  as a comment when they're read back in again.
        "Steinar H. Gunderson" <sesse@debian.org>

ChangeLog
support/nfs/exports.c

index b6df9980617238a7c4ef530e682f0b0ff098bf16..9cca4f9401123b4938d5a117a8677caef854e3fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,7 +4,11 @@
          and multiple entries of the same type for the same patch that matches
          a given client. The entire rationale and problem description can be found
          at http://bugs.debian.org/245449 (fumihiko kakuma <kakmy@mvh.biglobe.ne.jp>)
          and multiple entries of the same type for the same patch that matches
          a given client. The entire rationale and problem description can be found
          at http://bugs.debian.org/245449 (fumihiko kakuma <kakmy@mvh.biglobe.ne.jp>)
-
+        - escape hashes in exports
+         Makes sure any # signs in the printed-out exports file are
+         escaped (as with quotes, spaces, etc.), so they won't be treated
+         as a comment when they're read back in again.
+               "Steinar H. Gunderson" <sesse@debian.org>
        
 2006-04-12 NeilBrown <neilb@suse.de>
        Remove **/Makefile.in, aclocal.m4, configure, and
        
 2006-04-12 NeilBrown <neilb@suse.de>
        Remove **/Makefile.in, aclocal.m4, configure, and
index 5d8cf5e30e871ea99e484bf289d8eb3ad9036c3e..18ce2c58a7bb124e942b81a35f007821b01200d5 100644 (file)
@@ -167,7 +167,7 @@ putexportent(struct exportent *ep)
 
        fp = efp->x_fp;
        for (i=0; esc[i]; i++)
 
        fp = efp->x_fp;
        for (i=0; esc[i]; i++)
-               if (iscntrl(esc[i]) || esc[i] == '"' || esc[i] == '\\'|| isspace(esc[i]))
+               if (iscntrl(esc[i]) || esc[i] == '"' || esc[i] == '\\' || esc[i] == '#' || isspace(esc[i]))
                        fprintf(fp, "\\%03o", esc[i]);
                else
                        fprintf(fp, "%c", esc[i]);
                        fprintf(fp, "\\%03o", esc[i]);
                else
                        fprintf(fp, "%c", esc[i]);