chiark / gitweb /
condition: always follow symlinks for condition checks, to mimic test
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Sep 2011 23:07:25 +0000 (01:07 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Sep 2011 23:07:25 +0000 (01:07 +0200)
man/systemd.unit.xml
src/condition.c

index 4e2590d00636c778350e964b887e98595ee54949..4437510df7c08fcba821aba97416df3e50ee5ff7 100644 (file)
                                 is prefixed with an exclamation mark
                                 (!), the test is negated, and the unit
                                 is only started if the path does not
                                 is prefixed with an exclamation mark
                                 (!), the test is negated, and the unit
                                 is only started if the path does not
-                                exist. The test follows symlinks.
+                                exist.
                                 <varname>ConditionPathExistsGlob=</varname>
                                 works in a similar way, but checks for
                                 the existence of at least one file or
                                 <varname>ConditionPathExistsGlob=</varname>
                                 works in a similar way, but checks for
                                 the existence of at least one file or
                                 is similar to
                                 <varname>ConditionPathExists=</varname>
                                 but verifies whether a certain path
                                 is similar to
                                 <varname>ConditionPathExists=</varname>
                                 but verifies whether a certain path
-                                exists and is a directory. It does not
-                                follow
-                                symlinks. <varname>ConditionPathIsMountPoint=</varname>
+                                exists and is a
+                                directory. <varname>ConditionPathIsMountPoint=</varname>
                                 is similar to
                                 <varname>ConditionPathExists=</varname>
                                 but verifies whether a certain path
                                 is similar to
                                 <varname>ConditionPathExists=</varname>
                                 but verifies whether a certain path
                                 <varname>ConditionPathExists=</varname>
                                 but verifies whether a certain path
                                 exists, is a regular file and marked
                                 <varname>ConditionPathExists=</varname>
                                 but verifies whether a certain path
                                 exists, is a regular file and marked
-                                executable. It follows symlinks.
+                                executable.
                                 <varname>ConditionDirectoryNotEmpty=</varname>
                                 is similar to
                                 <varname>ConditionPathExists=</varname>
                                 <varname>ConditionDirectoryNotEmpty=</varname>
                                 is similar to
                                 <varname>ConditionPathExists=</varname>
                                 prefix an argument with the pipe
                                 symbol and an exclamation mark the
                                 pipe symbol must be passed first, the
                                 prefix an argument with the pipe
                                 symbol and an exclamation mark the
                                 pipe symbol must be passed first, the
-                                exclamation second.</para></listitem>
+                                exclamation second. All path checks
+                                follow symlinks.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
                         </varlistentry>
 
                         <varlistentry>
index 131b456806c2282cc9ef7a96a2073ed086f8dc7c..7f8564966a22cdc39dcce79eaa693c445da9d2f3 100644 (file)
@@ -162,7 +162,7 @@ bool condition_test(Condition *c) {
         case CONDITION_PATH_IS_DIRECTORY: {
                 struct stat st;
 
         case CONDITION_PATH_IS_DIRECTORY: {
                 struct stat st;
 
-                if (lstat(c->parameter, &st) < 0)
+                if (stat(c->parameter, &st) < 0)
                         return !c->negate;
                 return S_ISDIR(st.st_mode) == !c->negate;
         }
                         return !c->negate;
                 return S_ISDIR(st.st_mode) == !c->negate;
         }