diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-06-11 07:35:39 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-06-11 07:35:39 +0200 |
commit | f8eaeee4571358afa5fb0d9e6374d095c7531c96 (patch) | |
tree | 40e37b7eb56c4f6f43273c07b58f310e68cfc2a6 /common | |
parent | 91649f1065d735bb4bcc6bb1a8067e670dcbbead (diff) | |
parent | 34d18aaa2a47522a8b607fb2e61c79f5b10ecb9a (diff) | |
download | barebox-f8eaeee4571358afa5fb0d9e6374d095c7531c96.tar.gz barebox-f8eaeee4571358afa5fb0d9e6374d095c7531c96.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'common')
-rw-r--r-- | common/blspec.c | 12 | ||||
-rw-r--r-- | common/password.c | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/common/blspec.c b/common/blspec.c index 1a6d581f5a..9e1036c834 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -298,6 +298,18 @@ static struct blspec_entry *blspec_entry_open(struct bootentries *bootentries, val = end; + if (!strcmp(name, "options")) { + /* If there was a previous "options" key given, prepend its value + * (as per spec). */ + const char *prev_val = blspec_entry_var_get(entry, name); + if (prev_val) { + char *opts = xasprintf("%s %s", prev_val, val); + blspec_entry_var_set(entry, name, opts); + free(opts); + continue; + } + } + blspec_entry_var_set(entry, name, val); } diff --git a/common/password.c b/common/password.c index a2a9c4cd6c..3c08ab782e 100644 --- a/common/password.c +++ b/common/password.c @@ -161,6 +161,9 @@ static int read_default_passwd(unsigned char *sum, size_t length) unsigned char *buf = (unsigned char *)default_passwd; unsigned char c; + if (ARRAY_SIZE(default_passwd) == 1) + return -ENOSYS; + if (!sum || length < 1) return -EINVAL; @@ -179,7 +182,6 @@ static int read_default_passwd(unsigned char *sum, size_t length) return 0; } -EXPORT_SYMBOL(read_default_passwd); static int read_env_passwd(unsigned char *sum, size_t length) { |