diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-22 03:57:15 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-22 04:02:07 +0100 |
commit | 3d7415f43f0fe6a821d7bc4a341ba371e8a30ef3 (patch) | |
tree | d79e54dec69645a894a4ec12d6abf765515d245f /src/import/import-dkr.c | |
parent | f4c135bf2f0abcf79c89efbeae51f03bacba5f2f (diff) |
import: introduce new mini-daemon systemd-importd, and make machinectl a client to it
The old "systemd-import" binary is now an internal tool. We still use it
as asynchronous backend for systemd-importd. Since the import tool might
require some IO and CPU resources (due to qcow2 explosion, and
decompression), and because we might want to run it with more minimal
priviliges we still keep it around as the worker binary to execute as
child process of importd.
machinectl now has verbs for pulling down images, cancelling them and
listing them.
Diffstat (limited to 'src/import/import-dkr.c')
-rw-r--r-- | src/import/import-dkr.c | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/src/import/import-dkr.c b/src/import/import-dkr.c index 1a6cd4eaff..0e99275090 100644 --- a/src/import/import-dkr.c +++ b/src/import/import-dkr.c @@ -28,10 +28,11 @@ #include "btrfs-util.h" #include "utf8.h" #include "mkdir.h" +#include "import-util.h" #include "curl-util.h" #include "aufs-util.h" -#include "import-util.h" #include "import-job.h" +#include "import-common.h" #include "import-dkr.h" struct DkrImport { @@ -854,34 +855,3 @@ int dkr_import_pull(DkrImport *i, const char *name, const char *tag, const char return import_job_begin(i->images_job); } - -bool dkr_name_is_valid(const char *name) { - const char *slash, *p; - - if (isempty(name)) - return false; - - slash = strchr(name, '/'); - if (!slash) - return false; - - if (!filename_is_valid(slash + 1)) - return false; - - p = strndupa(name, slash - name); - if (!filename_is_valid(p)) - return false; - - return true; -} - -bool dkr_id_is_valid(const char *id) { - - if (!filename_is_valid(id)) - return false; - - if (!in_charset(id, "0123456789abcdef")) - return false; - - return true; -} |