Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 1 | From e8331a76983e839a3d193446ab8ae9c1b09daa07 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 2 | From: Jackie Huang <jackie.huang@windriver.com> |
| 3 | Date: Wed, 10 Aug 2016 11:19:44 +0800 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 4 | Subject: [PATCH] Fix missing check for permission denied. |
| 5 | |
| 6 | If the path to "ROOT_SYSCONFDIR/mke2fs.conf" has a permission denied problem, |
| 7 | then the get_dirlist() call will return EACCES. But the code in profile_init |
| 8 | will treat that as a fatal error and all executions will fail with: |
| 9 | Couldn't init profile successfully (error: 13). |
| 10 | |
| 11 | Upstream-Status: Pending |
| 12 | |
| 13 | Written-by: Henrik Wallin <henrik.b.wallin@ericsson.com> |
| 14 | |
| 15 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 16 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 17 | --- |
| 18 | lib/support/profile.c | 2 +- |
| 19 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 20 | |
| 21 | diff --git a/lib/support/profile.c b/lib/support/profile.c |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 22 | index 585ed595..810dd66b 100644 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 23 | --- a/lib/support/profile.c |
| 24 | +++ b/lib/support/profile.c |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 25 | @@ -335,7 +335,7 @@ profile_init(const char * const *files, profile_t *ret_profile) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 26 | *last = new_file; |
| 27 | last = &new_file->next; |
| 28 | } |
| 29 | - } else if ((retval != ENOTDIR) && |
| 30 | + } else if ((retval != ENOTDIR) && (retval != EACCES) && |
| 31 | strcmp(*fs, default_filename)) |
| 32 | goto errout; |
| 33 | |