From b0c9c92627769e7eb436d4a37d4cb718d4228f2f Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Mon, 4 Oct 2021 11:50:55 +0100 Subject: [PATCH 1/2] Fixed cppcheck 2.6 warnings --- xrdp/xrdp_mm.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index 67b8d10e..704745ea 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -2191,9 +2191,6 @@ getPAMError(const int pamError, char *text, int text_bytes) return "Error connecting to PAM"; case 32 + 3: return "Username okey but group problem"; - default: - g_snprintf(text, text_bytes, "Not defined PAM error:%d", pamError); - return text; #elif defined(OPENPAM) case PAM_SUCCESS: /* 0 */ return "Success"; @@ -2255,10 +2252,10 @@ getPAMError(const int pamError, char *text, int text_bytes) return "Module is unknown"; case PAM_DOMAIN_UNKNOWN: /* 29 */ return "Unknown authentication domain"; +#endif default: g_snprintf(text, text_bytes, "Not defined PAM error:%d", pamError); return text; -#endif } } @@ -2309,8 +2306,6 @@ getPAMAdditionalErrorInfo(const int pamError, struct xrdp_mm *self) { return "Authentication error - Verify that user/password is valid"; } - default: - return "No expected error"; #elif defined(OPENPAM) case PAM_SUCCESS: /* 0 */ return NULL; @@ -2351,9 +2346,9 @@ getPAMAdditionalErrorInfo(const int pamError, struct xrdp_mm *self) { return "Authentication error - Verify that user/password is valid"; } +#endif default: return "No expected error"; -#endif } } #endif From cda6c6074874a9b99d129c41579141a7749c2a07 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Mon, 4 Oct 2021 11:51:45 +0100 Subject: [PATCH 2/2] Bump CI version of cppcheck to 2.6 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f398636..d91f1dff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -127,7 +127,7 @@ jobs: CC: gcc # This is required to use a version of cppcheck other than that # supplied with the operating system - CPPCHECK_VER: 2.5 + CPPCHECK_VER: 2.6 CPPCHECK_REPO: https://github.com/danmar/cppcheck.git steps: # This is currently the only way to get a version into