chiark / gitweb /
Verify validity of session name when received from outside
[elogind.git] / src / shared / replace-var.c
index e11c57a43d75d1504fe3d279c3717846d37a050b..478fc43a38858ac34ff38b6564a4e49e04edd71a 100644 (file)
@@ -24,6 +24,7 @@
 #include "macro.h"
 #include "util.h"
 #include "replace-var.h"
+#include "def.h"
 
 /*
  * Generic infrastructure for replacing @FOO@ style variables in
@@ -40,7 +41,7 @@ static int get_variable(const char *b, char **r) {
         if (*b != '@')
                 return 0;
 
-        k = strspn(b + 1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ_");
+        k = strspn(b + 1, UPPERCASE_LETTERS "_");
         if (k <= 0 || b[k+1] != '@')
                 return 0;