[systemd-commits] 2 commits - man/systemd.exec.xml src/load-fragment.c src/locale-setup.c TODO

Lennart Poettering lennart at kemper.freedesktop.org
Wed Jan 5 16:39:32 PST 2011


 TODO                 |    4 ++--
 man/systemd.exec.xml |    9 +++++++--
 src/load-fragment.c  |   14 +++++++++++++-
 src/locale-setup.c   |   20 ++++++++++----------
 4 files changed, 32 insertions(+), 15 deletions(-)

New commits:
commit e624abf77784438913fff448f0f243e71f35297f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jan 6 01:39:25 2011 +0100

    locale: fix variable names

diff --git a/src/locale-setup.c b/src/locale-setup.c
index b3375e9..086647b 100644
--- a/src/locale-setup.c
+++ b/src/locale-setup.c
@@ -51,16 +51,16 @@ static const char * const variable_names[_VARIABLE_MAX] = {
         [VARIABLE_LANG] = "LANG",
         [VARIABLE_LC_CTYPE] = "LC_CTYPE",
         [VARIABLE_LC_NUMERIC] = "LC_NUMERIC",
-        [VARIABLE_LC_TIME] = "TIME",
-        [VARIABLE_LC_COLLATE] = "COLLATE",
-        [VARIABLE_LC_MONETARY] = "MONETARY",
-        [VARIABLE_LC_MESSAGES] = "MESSAGE",
-        [VARIABLE_LC_PAPER] = "PAPER",
-        [VARIABLE_LC_NAME] = "NAME",
-        [VARIABLE_LC_ADDRESS] = "ADDRESS",
-        [VARIABLE_LC_TELEPHONE] = "TELEPHONE",
-        [VARIABLE_LC_MEASUREMENT] = "MEASUREMENT",
-        [VARIABLE_LC_IDENTIFICATION] = "IDENTIFICATION"
+        [VARIABLE_LC_TIME] = "LC_TIME",
+        [VARIABLE_LC_COLLATE] = "LC_COLLATE",
+        [VARIABLE_LC_MONETARY] = "LC_MONETARY",
+        [VARIABLE_LC_MESSAGES] = "LC_MESSAGE",
+        [VARIABLE_LC_PAPER] = "LC_PAPER",
+        [VARIABLE_LC_NAME] = "LC_NAME",
+        [VARIABLE_LC_ADDRESS] = "LC_ADDRESS",
+        [VARIABLE_LC_TELEPHONE] = "LC_TELEPHONE",
+        [VARIABLE_LC_MEASUREMENT] = "LC_MEASUREMENT",
+        [VARIABLE_LC_IDENTIFICATION] = "LC_IDENTIFICATION"
 };
 
 int locale_setup(void) {

commit afe4bfe2c1ed28a3e75c627edf458d2f40ff16f8
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jan 6 01:39:08 2011 +0100

    fragment: allow prefixing of the EnvironmentFile= path with - to ignore errors

diff --git a/TODO b/TODO
index fb23de9..7f3ae5f 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,5 @@
+* dbus should run with oom adjust set
+
 * support caching password questions in plymouth and on the console
   https://bugzilla.redhat.com/show_bug.cgi?id=655538
 
@@ -119,8 +121,6 @@
 
 * global defaults for StandardOuput=xxx
 
-* Make EnvironmentFile=-/fooobar/waldo ingnore errors while reading /foobar/waldo
-
 * mkswap/mke2fs is called on wrong devices in crypto devices.
 
 Fedora:
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
index b24792b..d6ac5ae 100644
--- a/man/systemd.exec.xml
+++ b/man/systemd.exec.xml
@@ -275,8 +275,13 @@
                                 contain new-line separated variable
                                 assignments. Empty lines and lines
                                 starting with ; or # will be ignored,
-                                which may be used for
-                                commenting.</para></listitem>
+                                which may be used for commenting. The
+                                argument passed should be an absolute
+                                file name, optionally prefixed with
+                                "-", which indicates that if the file
+                                does not exist it won't be read and no
+                                error or warning message is
+                                logged.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
diff --git a/src/load-fragment.c b/src/load-fragment.c
index 2818632..334dd68 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -1348,14 +1348,26 @@ static int config_parse_env_file(
         FILE *f;
         int r;
         char ***env = data;
+        bool ignore = false;
 
         assert(filename);
         assert(lvalue);
         assert(rvalue);
         assert(data);
 
+        if (rvalue[0] == '-') {
+                ignore = true;
+                rvalue++;
+        }
+
+        if (!path_is_absolute(rvalue)) {
+                log_error("[%s:%u] Path '%s' is not absolute, ignoring.", filename, line, rvalue);
+                return 0;
+        }
+
         if (!(f = fopen(rvalue, "re"))) {
-                log_error("[%s:%u] Failed to open environment file '%s', ignoring: %m", filename, line, rvalue);
+                if (!ignore)
+                        log_error("[%s:%u] Failed to open environment file '%s', ignoring: %m", filename, line, rvalue);
                 return 0;
         }
 



More information about the systemd-commits mailing list