MrLoick / fire-hostadmin

Automatically exported from code.google.com/p/fire-hostadmin
0 stars 0 forks source link

Feature request + patch (set hosts-file path in about:config) #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Reason for this change is that I think that giving write access to world for 
/etc/hosts is bad. And I still want to use hostadmin functionality. 
I've already got my on resolver that reads different file from /etc/hosts for 
ip:s so this change gives me power to use/extend it from firefox.

the push("/etc/dns-extension/hosts"); is just an example how you can chain 
filepaths  

Added this to prefs.js
// defaults/preferences/prefs.js
pref("extensions.hostadmin.hostsfilepath", "default");

What version of the product are you using? On what operating system?
Linux 64bit ubuntu
firefox 4

Please provide any additional information below.

Changes: 
var file_name str -> array
check that file_name exists before using, fallbacks to the next value in the 
array

added extensions.hostadmin.hostsfilepath config options so that future file 
location changes do not have to be hardcoded 

ps. 
If you make that change I do not need any credit. It'll just ease my use of 
this add-on

Original issue reported on code.google.com by tee...@gmail.com on 26 Apr 2011 at 9:14

Attachments:

GoogleCodeExporter commented 8 years ago
This is _not_ a Defect (missed or could not change that)

Original comment by tee...@gmail.com on 26 Apr 2011 at 9:32

GoogleCodeExporter commented 8 years ago
write access is  a bad idea indeed
options to host file will add to next version of hostadmin

i am interest in how your resolver work
will plz show me that?

Original comment by farmer1...@gmail.com on 26 Apr 2011 at 9:32

GoogleCodeExporter commented 8 years ago
I did not check that I got all the options and scripts
basically I'm using dnsmasq as a resolver with these options
addn-hosts=/etc/dns-extensions/hosts-firefox-hostadmin
resolv-file=/etc/dns-extensions/dhcp-resolv.conf

the script+cron stuff in the zip are for reloading dnsmasq when the 
/etc/dns-extensions/hosts-firefox-hostadmin file changes..

scripts are quite quick and dirty.. and were never meant for anyone else.. 
I hope you find these helpful because your add-on was what I was looking and 
almost started coding it myself.. 

Cheers

Original comment by tee...@gmail.com on 26 Apr 2011 at 10:39

Attachments:

GoogleCodeExporter commented 8 years ago
thanks 
merge your patch to trunk @revision 28.

key extensions.hostadmin.hostsfilepath

Original comment by farmer1...@gmail.com on 26 Jan 2012 at 6:57