Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177793533
D61842.1795297828.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
788 B
Referenced Files
None
Subscribers
None
D61842.1795297828.diff
View Options
diff --git a/stand/libsa/environment.c b/stand/libsa/environment.c
--- a/stand/libsa/environment.c
+++ b/stand/libsa/environment.c
@@ -260,6 +260,7 @@
NULL,
};
const char **cp;
+ size_t len;
int ok = -1;
for (cp = restricted; *cp; cp++) {
@@ -270,7 +271,20 @@
}
if (!ok) {
for (cp = allowed; *cp; cp++) {
- if (strncmp(name, *cp, strlen(*cp)) == 0) {
+ len = strlen(*cp);
+ if (strncmp(name, *cp, len) == 0) {
+ ok = 1;
+ break;
+ }
+
+ /*
+ * We may also be given just the name, e.g., from
+ * boot_setenv() or unset, so an entry ending in '='
+ * must also match the name alone.
+ */
+ if (len > 0 && (*cp)[len - 1] == '=' &&
+ strncmp(name, *cp, len - 1) == 0 &&
+ name[len - 1] == '\0') {
ok = 1;
break;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 21, 9:50 PM (19 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41894690
Default Alt Text
D61842.1795297828.diff (788 B)
Attached To
Mode
D61842: libsa: let the restricted variable allow-list match bare names
Attached
Detach File
Event Timeline