Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 1 | Subject: [PATCH] Fix missing check for permission denied. |
| 2 | |
| 3 | If the path to "ROOT_SYSCONFDIR/mke2fs.conf" has a permission denied problem, |
| 4 | then the get_dirlist() call will return EACCES. But the code in profile_init |
| 5 | will treat that as a fatal error and all executions will fail with: |
| 6 | Couldn't init profile successfully (error: 13). |
| 7 | |
| 8 | Upstream-Status: Pending |
| 9 | |
| 10 | Written-by: Henrik Wallin <henrik.b.wallin@ericsson.com> |
| 11 | |
| 12 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> |
| 13 | --- |
| 14 | lib/support/profile.c | 2 +- |
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/lib/support/profile.c b/lib/support/profile.c |
| 18 | index 51a3314..1c1039f 100644 |
| 19 | --- a/lib/support/profile.c |
| 20 | +++ b/lib/support/profile.c |
| 21 | @@ -335,7 +335,7 @@ profile_init(const char **files, profile_t *ret_profile) |
| 22 | *last = new_file; |
| 23 | last = &new_file->next; |
| 24 | } |
| 25 | - } else if ((retval != ENOTDIR) && |
| 26 | + } else if ((retval != ENOTDIR) && (retval != EACCES) && |
| 27 | strcmp(*fs, default_filename)) |
| 28 | goto errout; |
| 29 | |
| 30 | -- |
| 31 | 2.7.4 |
| 32 | |