commit a276243e9afc3e2ab49c5205cc46b1c4719c21eb
parent 16739cb4e61150712be961ccca1390c586a49631
Author: James Prestwood <prestwoj@gmail.com>
Date: Tue, 14 Jun 2022 16:35:29 -0700
storage: warn user on badly named provisioning file
The man pages (iwd.network) have a section about how to name provisioning
files containing non-alphanumeric characters but not everyone reads the
entire man page.
Warning them that the provisioning file was not read and pointing to
'man iwd.network' should lead someone in the right direction.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/storage.c b/src/storage.c
@@ -321,8 +321,12 @@ const char *storage_network_ssid_from_path(const char *path,
if (!isalnum(*c) && !strchr("-_ ", *c))
break;
- if (c < end)
+ if (c < end) {
+ l_warn("Provisioning file %s contains non-alphanumeric "
+ "characters in the name. Please hex-encode. "
+ "See man iwd.network", path);
return NULL;
+ }
memcpy(buf, filename, end - filename);
buf[end - filename] = '\0';