]>
Commit | Line | Data |
---|---|---|
9367af8a LP |
1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | ||
3 | #include "capsule-util.h" | |
4 | #include "path-util.h" | |
5 | #include "user-util.h" | |
6 | ||
7 | int capsule_name_is_valid(const char *name) { | |
8 | ||
9 | if (!filename_is_valid(name)) | |
10 | return false; | |
11 | ||
12 | _cleanup_free_ char *prefixed = strjoin("c-", name); | |
13 | if (!prefixed) | |
14 | return -ENOMEM; | |
15 | ||
16 | return valid_user_group_name(prefixed, /* flags= */ 0); | |
17 | } |