|
From: Rene <re...@gr...> - 2002-07-14 18:59:13
|
On Sun, 2002-07-14 at 04:10, Joe zacky wrote: > I don't understand where these filenames with embedded newlines are > coming from? I haven't ever seen a filename with an embedded newline. Is > this a problem in class_restore.php? It breaks some things. And I know that it is not an illegal filename. I'm just trying to make sure that bobs does not break. But right now there should only be _very_ few names that will break bobs. > > I'm planning to look at the configuration editor admin.php tonight to > see if I can figure out what needs to be reworked. Please keep in mind > I'm not familiar with the functioning of the php pages and classes > you've written, so it takes me a while to get my head into it. More > specifics on what I should work on would help, like which files or > classes, what should change on admin.php, etc. > Well. I don't really know what to do with admin.php. I would probably tear it apart and start over. It's not as good as I would like it. Basically it needs to handle several types of configuration setups. A better way to do it would be to introduce configuration options as needed. eg. a user selects "smb share" and "static ip" as options. Then the following options show up: "servername" "ip address" Smb share name" "login" "password". 1. Handling and checking of options. 2. A way of linking options. eg. smb_share depends on backup_type=smb admin.php and class_config are the only php related to configuration so don't be afraid of breaking stuff. I looked at the server.definitions.ini and been trying to figure out how to make a better editor. I think we should drop the file and go with a php file instead. That way we could use arrays to hold the information we need. Like type, name, descriptions, selection lists and what depends on what. example definitions array [smb_share][type] = text [smb_share][desc] = "name of smb share" [smb_share][help] = "more detail about this option ......" [smb_share][depend][name][0] = "backup_method" [smb_share][depend][name][1] = "restore_method" [smb_share][depend][value][0] = "smb" [smb_share][depend][value][1] = "smb" so if $backup_method or $restore_method has a value of "smb" we should display this option. In case of options depending on more than on value we could add something like this. [smb_share][depend][rule][0] = "0|TRUE:1|TRUE" where the "0" refers to "[smb_share][depend][name][0]" which is "backup_method" and TRUE means that this dependency must be satisfied multiple rules could be made that way and if one of them match a configuration then the options will be displayed. So most of class_config could be redone in a much nicer way than the hacks I put in there. Another thing people might want is a user login list which is not the same as the server/share login.. Hope I'm making sense here.. Rene > I hope I can get some stuff done this weekend. It's over 100 degrees > here (37.7 celsius), and I'm still lazy from vacationing. > > Joe > > Rene wrote: > > >Damn filenames... > > > >Filenames including newlines will not work properly. That much is sure. > > > >I'm going examine possible solutions, like use a NULL as an end-of-line > >seperator. I read somewhere that NULL's aren't accepted by shell > >programs like grep so that might be a problem. > >Maybe maybe an end-of-line marker like "///FF" would work if NULL is not > >usefull. > > > >What is your opinion about using flat text files instead of databases? > >Any suggestion on better ways to do it? > > > >Rene > > > > > >On Sat, 2002-07-13 at 18:11, Rene Rask wrote: > > > > > >>I've finally been able to get some useful results. > >> > >>This is not a perfect solution as far as I can see. > >> > >>Basically it involves changing the $IFS value in bash to be a newline. > >>And changing it to the original value after use. > >> > >>The problem is (or will be) that filenames cannot contain newlines. > >>I might be able to escape newlines in filenames. > >> > >>Anyway. This solution is better than the old one so I'm going to update > >>the cvs with it. > >> > >>I'll see if I can test the newline problem and find a solution. > >> > >> > >>Rene > >> > >> > >> > >>Joe zacky wrote: > >> > >> > >>>Have you tried escaping single quotes like this, where $filename is the > >>>variable containing the name of the file: > >>> \'$filename\' > >>> > >>>Joe > >>> > >>>Rene Rask wrote: > >>> > >>> > >>> > >>>>The names are quoted. I've tried both double and single quoting. > >>>>If I can get bash to accept the names as "literal" instead of "glob" it > >>>>should solve the problem. > >>>> > >>>>A name like "some name^Mtest" does not behave well. > >>>>Only working solution I've found was this way: > >>>>$'some name^Mtest' > >>>>But I can't figure out how that is useful in a script. > >>>> > >>>> > >>>>I'll keep trying. > >>>> > >>>>-Rene > >>>> > >>>> > >>>>On Fri, 2002-07-12 at 07:26, Joe zacky wrote: > >>>> > >>>> > >>>> > >>>> > >>>>>Rene Rask wrote: > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>>>I've been looking into the filename problems. > >>>>>> > >>>>>>It seems to me that escaping filenames in PHP will ony lead to a > >>>>>>constant headache (which is not what I need right now ;) > >>>>>> > >>>>>>I've found a few Bash tricks that look really promising but I haven't > >>>>>>cracked the problem yet. I'm able to make Bash escape a filename with > >>>>>>weird characters in it. But I'm still not able to do it with input > >>>>>> > >>>>>> > >>>>>>from a list. > >>>>> > >>>>> > >>>>>>When (if?) I get this working we should be able to stop worrying about > >>>>>>filenames. > >>>>>>If you know any Bash experts please ask if they can help. > >>>>>> > >>>>>>-Rene > >>>>>> > >>>>>> > >>>>>> > >>>>>>------------------------------------------------------- > >>>>>>This sf.net email is sponsored by:ThinkGeek > >>>>>>Two, two, TWO treats in one. > >>>>>>http://thinkgeek.com/sf > >>>>>>_______________________________________________ > >>>>>>Bobs-devel mailing list > >>>>>>Bob...@li... > >>>>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>Have you tried "quoting the filenames?" That also works in bash. > >>>>> > >>>>> > >>>>> > >>>>>------------------------------------------------------- > >>>>>This sf.net email is sponsored by:ThinkGeek > >>>>>Gadgets, caffeine, t-shirts, fun stuff. > >>>>>http://thinkgeek.com/sf > >>>>>_______________________________________________ > >>>>>Bobs-devel mailing list > >>>>>Bob...@li... > >>>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >>>>> > >>>>> > >>>>> > >>>>> > >>>> > >>>> > >>>>------------------------------------------------------- > >>>>This sf.net email is sponsored by:ThinkGeek > >>>>Gadgets, caffeine, t-shirts, fun stuff. > >>>>http://thinkgeek.com/sf > >>>>_______________________________________________ > >>>>Bobs-devel mailing list > >>>>Bob...@li... > >>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >>>> > >>>> > >>>> > >>>> > >>>> > >> > >> > >> > >>------------------------------------------------------- > >>This sf.net email is sponsored by:ThinkGeek > >>Welcome to geek heaven. > >>http://thinkgeek.com/sf > >>_______________________________________________ > >>Bobs-devel mailing list > >>Bob...@li... > >>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >> > >> > > > > > > > > > >------------------------------------------------------- > >This sf.net email is sponsored by:ThinkGeek > >Welcome to geek heaven. > >http://thinkgeek.com/sf > >_______________________________________________ > >Bobs-devel mailing list > >Bob...@li... > >https://lists.sourceforge.net/lists/listinfo/bobs-devel > > > > > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Bobs-devel mailing list > Bob...@li... > https://lists.sourceforge.net/lists/listinfo/bobs-devel |