Validate logical disk names in configuration parsing to ensure compatibility with snapraid-daemon

This commit is contained in:
Andrea Mazzoleni 2026-09-17 17:32:19 +02:00
parent 18a95e14a6
commit ecef1944d5
3 changed files with 129 additions and 0 deletions

View file

@ -27,6 +27,18 @@ const char* lev_name(unsigned level);
*/
const char* lev_config_name(unsigned level);
/**
* Maximum byte length of a logical disk name.
*/
#define DISK_NAME_MAX 127
/**
* Validate a logical disk name.
*
* Returns 0 if valid, or a static string error reason if invalid.
*/
const char* disk_name_invalid_reason(const char* name);
/****************************************************************************/
/* state */