Page MenuHomeFreeBSD

D61842.1795296400.diff
No OneTemporary

Authored By
Unknown
Size
788 B
Referenced Files
None
Subscribers
None

D61842.1795296400.diff

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

Mime Type
text/plain
Expires
Sat, Nov 21, 9:26 PM (19 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41894690
Default Alt Text
D61842.1795296400.diff (788 B)

Event Timeline