diff options
author | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-05-06 17:03:30 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-08-06 14:08:33 +1000 |
commit | acc5ace6e58db2f3dceb1f7a27d0fc1fb29c4a27 (patch) | |
tree | d5577259029ad08d93de57e0a3560b6271627e8a /lib/pb-protocol | |
parent | 79bfd11f662fcf46bd4ae58a0aab993cbe158dbe (diff) | |
download | petitboot-acc5ace6e58db2f3dceb1f7a27d0fc1fb29c4a27.zip petitboot-acc5ace6e58db2f3dceb1f7a27d0fc1fb29c4a27.tar.gz |
Make read-only guarantee user-settable
Create a new Petitboot option 'petitboot,write?' that specifies whether
the system is allowed to mount devices read-write. The option can be
toggled by the user in the nc-config screen.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'lib/pb-protocol')
-rw-r--r-- | lib/pb-protocol/pb-protocol.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/pb-protocol/pb-protocol.c b/lib/pb-protocol/pb-protocol.c index 69ea35d..7d45f51 100644 --- a/lib/pb-protocol/pb-protocol.c +++ b/lib/pb-protocol/pb-protocol.c @@ -290,6 +290,8 @@ int pb_protocol_config_len(const struct config *config) len += 4 + 4; /* ipmi_bootdev, ipmi_bootdev_persistent */ + len += 4; /* allow_writes */ + len += 4 + optional_strlen(config->lang); return len; @@ -502,6 +504,9 @@ int pb_protocol_serialise_config(const struct config *config, *(uint32_t *)pos = config->ipmi_bootdev_persistent; pos += 4; + *(uint32_t *)pos = config->allow_writes; + pos += 4; + pos += pb_protocol_serialise_string(pos, config->lang); assert(pos <= buf + buf_len); @@ -958,6 +963,10 @@ int pb_protocol_deserialise_config(struct config *config, goto out; config->ipmi_bootdev_persistent = !!tmp; + if (read_u32(&pos, &len, &tmp)) + goto out; + config->allow_writes = !!tmp; + if (read_string(config, &pos, &len, &str)) goto out; |