diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-10-02 08:33:08 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-04-24 13:24:57 +0200 |
commit | 49b2ae70344bc3212aa268576cb15d903b32558e (patch) | |
tree | 33bcab6833dd5c3d6fbbb25e5bae3468052f10b8 /fs/ubifs/ubifs.c | |
parent | ea569a0afd6a2e9a84418cd18ddeaeefaa5eae39 (diff) | |
download | barebox-49b2ae70344bc3212aa268576cb15d903b32558e.tar.gz barebox-49b2ae70344bc3212aa268576cb15d903b32558e.tar.xz |
fs: ubifs: Add authentication support
This adds UBIFS authentication support. For now, we do not do
any authentication even on authenticated UBIFS images. Since
this behaviour is not what the user normally expects when mounting
authenticated images we only do this when the user explicitly allows
it in "global.ubifs.allow_authenticated_unauthenticated". If the
flag is false then we refuse mounting such an image and return -EPERM
instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/ubifs/ubifs.c')
-rw-r--r-- | fs/ubifs/ubifs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index 494b1f2614..fd35619246 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -496,6 +496,7 @@ static int zlib_decomp_init(void) } int ubifs_allow_encrypted; +int ubifs_allow_authenticated_unauthenticated; static int ubifs_init(void) { @@ -508,6 +509,8 @@ static int ubifs_init(void) } globalvar_add_simple_bool("ubifs.allow_encrypted", &ubifs_allow_encrypted); + globalvar_add_simple_bool("ubifs.allow_authenticated_unauthenticated", + &ubifs_allow_authenticated_unauthenticated); return register_fs_driver(&ubifs_driver); } @@ -516,3 +519,6 @@ coredevice_initcall(ubifs_init); BAREBOX_MAGICVAR_NAMED(global_ubifs_allow_encrypted, global.ubifs.allow_encrypted, "If true, allow to mount UBIFS with encrypted files"); +BAREBOX_MAGICVAR_NAMED(global_ubifs_allow_authenticated_unauthenticated, + global.ubifs.allow_authenticated_unauthenticated, + "If true, allow to mount authenticated UBIFS images without doing authentication"); |