summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-06-05 12:27:35 +1000
committerNeil Brown <neilb@suse.de>2006-06-05 12:27:35 +1000
commitae821dcebb67784c59011f3113ba840d81ca6a45 (patch)
tree01f1ea9d337616a19679230890e10056cff2d24b
parent0f548e3b10e30a20a53ec26df106fc7a9c918ed5 (diff)
downloadnfs-utils-ae821dcebb67784c59011f3113ba840d81ca6a45.tar.gz
nfs-utils-ae821dcebb67784c59011f3113ba840d81ca6a45.tar.xz
nfs-utils-ae821dcebb67784c59011f3113ba840d81ca6a45.zip
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>
-rw-r--r--ChangeLog6
-rw-r--r--support/nfs/exports.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b6df998..9cca4f9 100644
--- 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>)
-
+ - 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
diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index 5d8cf5e..18ce2c5 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -167,7 +167,7 @@ putexportent(struct exportent *ep)
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]);