The string validation should always be done correctly, and not fail just
because EFI is turned off. After all an EFI loader entry name string
remains properly formatted regardless if EFI is on or off...
Fixes: #11948
return 0;
}
-bool efi_loader_entry_name_valid(const char *s) {
- if (isempty(s))
- return false;
-
- if (strlen(s) > FILENAME_MAX) /* Make sure entry names fit in filenames */
- return false;
-
- return in_charset(s, ALPHANUMERICAL "-_.");
-}
-
int efi_loader_get_entries(char ***ret) {
_cleanup_free_ char16_t *entries = NULL;
_cleanup_strv_free_ char **l = NULL;
#endif
+bool efi_loader_entry_name_valid(const char *s) {
+ if (isempty(s))
+ return false;
+
+ if (strlen(s) > FILENAME_MAX) /* Make sure entry names fit in filenames */
+ return false;
+
+ return in_charset(s, ALPHANUMERICAL "-_.");
+}
+
char *efi_tilt_backslashes(char *s) {
char *p;
int efi_loader_get_entries(char ***ret);
-bool efi_loader_entry_name_valid(const char *s);
-
int efi_loader_get_features(uint64_t *ret);
#else
return -EOPNOTSUPP;
}
-static inline bool efi_loader_entry_name_valid(const char *s) {
- return false;
-}
-
static inline int efi_loader_get_features(uint64_t *ret) {
return -EOPNOTSUPP;
}
#endif
+bool efi_loader_entry_name_valid(const char *s);
+
char *efi_tilt_backslashes(char *s);