diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-12-12 04:18:41 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-12-12 04:18:41 (GMT) |
commit | a19f18af10ff791fad73744b025844cc15eb16d3 (patch) | |
tree | cfc01b8a3ce7787945b6ce323e470b94cfbbba92 | |
parent | 4c00b8293c1e3974d818af8022bc858a48733ec4 (diff) |
some thoughts
-rw-r--r-- | fetcher.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -128,6 +128,11 @@ func FetchFileCurl(ctx *ImportContext, uri *url.URL) (err error) { return } +// TODO: check path to import from -> don't touch problematic files like /etc/shadow... +// the daemon shouldn't be running as a user who can do any harm anyway +// still: let's make a special configurable directory the local:/// dir +// and only allow absolute paths here which will be based on the +// 'local' directory func FetchFileLocal(ctx *ImportContext, uri *url.URL) (err error) { rhl.Printf("Local fetcher called for '%s'", ctx.SourceUri) if ctx.ProgressCallBack != nil { @@ -141,6 +146,11 @@ func FetchFileLocal(ctx *ImportContext, uri *url.URL) (err error) { type FetchFunc func(*ImportContext, *url.URL) (err error) + +// TODO: implement fetchers for: +// archiv:// +// public:// +// home:// ????? var ( fetchers = map[string]FetchFunc{ "local": FetchFileLocal, @@ -170,6 +180,7 @@ func fetcher_init() { } } +// TODO: make sure a (partially) fetched file get's deleted on error func FetchFile(ctx *ImportContext) (err error) { var uri *url.URL |