core: add credentials logic

Fixes: #15778 #16060
This commit is contained in:
Lennart Poettering
2020-08-25 19:45:35 +02:00
parent 9db59d9283
commit bb0c0d6f29
20 changed files with 1039 additions and 13 deletions
+7
View File
@@ -14,6 +14,7 @@
#include "alloc-util.h"
#include "extract-word.h"
#include "fd-util.h"
#include "fs-util.h"
#include "glob-util.h"
#include "log.h"
@@ -1127,3 +1128,9 @@ bool prefixed_path_strv_contains(char **l, const char *path) {
return false;
}
bool credential_name_valid(const char *s) {
/* We want that credential names are both valid in filenames (since that's our primary way to pass
* them around) and as fdnames (which is how we might want to pass them around eventually) */
return filename_is_valid(s) && fdname_is_valid(s);
}