On Thu, 29 Mar 2012 11:33:30 +0200 "Michal Filka" <michal.filka@suse.cz> wrote:
Well, that is not exactly true, as for this specific purpose I plan to create third agent - directory agent, which have permission to create/read/modify/delete any file in directory ( read and modify have almost identical interface as FileAgent ) So you can have permission for directory "/etc/sysconfig/network/" and then you can handle all files in this directory. For me it is still low-level operation and don't need any logic from upper layer. We just need to ensure, that we handle correctly paths ( no path escaping anywhere ).
There is second part of the problem. There can be many ifcfg-* files, you never know which ones.
I think that method read should return list of files, so you should know it.
Moreover, all those files can be processed by one lens (as almost all sysconfig files). So, the discussion was also about "How to create config file agent which is not fixed to particular file"
There should be always some restriction. All /etc/sysconfig is just sysconfigs, but permission to this files can be really various. My idea is that inside of add/edit action you have something ( you have ruby, so various nice ways ) that map file to lense. And then you just pass map to augeas with given lense. So in code of directory agent can be something like lense = case file when /ifcfg-.*/ then "sysconfig.lense" when /scrips/ then "bash.lense" else raise "unsuported File" end Pepa
Michal
-- Josef Reidinger Software Engineer Appliance Department SUSE LINUX, s. r. o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic jreidinger@suse.com SUSE -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org