]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: consider /etc uninitialized also when /etc/machine-id is present but empty...
authorFranck Bui <fbui@suse.com>
Wed, 10 Jan 2018 22:28:44 +0000 (23:28 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Jan 2018 22:28:44 +0000 (23:28 +0100)
src/tmpfiles/tmpfiles.c

index d69073535c1b8a88d7434b2b6472991b0987fe48..96ffa420895c193306d37c35c66ff33446487412 100644 (file)
@@ -199,12 +199,12 @@ static const Specifier specifier_table[] = {
 static int specifier_machine_id_safe(char specifier, void *data, void *userdata, char **ret) {
         int r;
 
-        /* If /etc/machine_id is missing (e.g. in a chroot environment), returns
-         * a recognizable error so that the caller can skip the rule
+        /* If /etc/machine_id is missing or empty (e.g. in a chroot environment)
+         * return a recognizable error so that the caller can skip the rule
          * gracefully. */
 
         r = specifier_machine_id(specifier, data, userdata, ret);
-        if (r == -ENOENT)
+        if (IN_SET(r, -ENOENT, -ENOMEDIUM))
                 return -ENXIO;
 
         return r;