[augeas-devel] augeas: master - Fstab: allow # in the spec

David Lutterkort lutter at fedoraproject.org
Mon Nov 30 16:04:22 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=65ef4c8021f2530f5d25fb66464a1255415472ed
Commit:        65ef4c8021f2530f5d25fb66464a1255415472ed
Parent:        0ca122e86130aa4638a7ff086739697936dcace8
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Mon Nov 30 07:33:57 2009 -0800
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Mon Nov 30 07:33:57 2009 -0800

Fstab: allow # in the spec

Fixes part of ticket #95
---
 lenses/fstab.aug            |    5 ++---
 lenses/tests/test_fstab.aug |   11 +++++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/lenses/fstab.aug b/lenses/fstab.aug
index 2da16ee..540efff 100644
--- a/lenses/fstab.aug
+++ b/lenses/fstab.aug
@@ -12,13 +12,14 @@ module Fstab =
   let empty   = Util.empty
 
   let word    = Rx.neg1
+  let spec    = /[^,# \n\t][^ \n\t]*/
 
   let comma_sep_list (l:string) =
     let lns = [ label l . store word ] in
        Build.opt_list lns comma
 
   let record = [ seq "mntent" .
-                   [ label "spec" . store  word ] . sep_tab .
+                   [ label "spec" . store spec ] . sep_tab .
                    [ label "file" . store word ] . sep_tab .
                    comma_sep_list "vfstype" . sep_tab .
                    comma_sep_list "opt" .
@@ -33,5 +34,3 @@ module Fstab =
 (* Local Variables: *)
 (* mode: caml *)
 (* End: *)
-
-
diff --git a/lenses/tests/test_fstab.aug b/lenses/tests/test_fstab.aug
index 1235fc5..cf6412c 100644
--- a/lenses/tests/test_fstab.aug
+++ b/lenses/tests/test_fstab.aug
@@ -70,6 +70,17 @@ module Test_fstab =
         { "dump" = "0" }
         { "passno" = "0" } }
 
+  (* Allow # in the spec *)
+  test Fstab.lns get "sshfs#jon at 10.0.0.2:/home    /media/server    fuse    uid=1000,gid=100,port=1022 0 0\n" =
+  { "1"
+    { "spec" = "sshfs#jon at 10.0.0.2:/home" }
+    { "file" = "/media/server" }
+    { "vfstype" = "fuse" }
+    { "opt" = "uid=1000" }
+    { "opt" = "gid=100" }
+    { "opt" = "port=1022" }
+    { "dump" = "0" }
+    { "passno" = "0" } }
 
 (* Local Variables: *)
 (* mode: caml       *)




More information about the augeas-devel mailing list