[augeas-devel] sshd lens bugfix

Dominique Dumont dominique.dumont at hp.com
Tue Feb 2 09:58:36 UTC 2010


On Monday 01 February 2010 23:59:23 David Lutterkot wrote:
> While we're at it, should we split the arguments out from the
> 
> command ? I.e., rather than parsing "Subsystem foo cmd arg1 arg2\n" into
> 
>   { "Subsystem" { "foo" = "cmd arg1 arg2" } }
> 
> parse it into
> 
>   { "Subsystem" { "foo" = "cmd" { "arg" = "arg1" } { "arg" = "arg2" } } }
> 

Hmm, can the "foo" lens stores a value and other lenses ?

Let's say this should parse into:

  { "Subsystem" { "foo" { "arg"="cmd"} { "arg" = "arg1" } { "arg" = "arg2" }}}

Anyway, let's see what this means from a user's point of view.

For augtool, this would means from:

  set /files/etc/ssh/sshd_config/Subsystem/foo="cmd arg1 arg2"

to something like:

  set /files/etc/ssh/sshd_config/Subsystem/foo/arg[0]="cmd"
  set /files/etc/ssh/sshd_config/Subsystem/foo/arg[1]="arg1"
  set /files/etc/ssh/sshd_config/Subsystem/foo/arg[2]="arg2"

which is somewhat more complex and split a single command into several 
statements. Not to mention that augeas print command will yield less readable 
dump since the subsystem command will be spreas on several lines, whereas the 
user deal with a command on a single line.

>From a config-model point of view (when used on top of Augeas), the command 
would change from:

  config-edit-sshd Subsystem:foo="cmd arg1 arg2"

to

  config-edit-sshd Subsystem:foo arg=cmd,arg1,arg2

which is counter-intuitive since people are used to separate command arg by 
white spaces...

So I vote against this idea and (humbly) suggests to keep Subsystem value as a 
string.

All the best

Note: I've omitted config-edit-sshd option "-ui none" for clarity  

Dominique
--
http://config-model.wiki.sourceforge.net/ -o- http://search.cpan.org/~ddumont/
http://www.ohloh.net/accounts/ddumont




More information about the augeas-devel mailing list