Repository: ranger Updated Branches: refs/heads/master 47ff1cc20 -> d1c1e5421
RANGER-2172: Fixing minor issue with the no. of characters read using sscanf Project: http://git-wip-us.apache.org/repos/asf/ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/d1c1e542 Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/d1c1e542 Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/d1c1e542 Branch: refs/heads/master Commit: d1c1e54216f228e6400d17ec463dd14efe31e49e Parents: 47ff1cc Author: Sailaja Polavarapu <[email protected]> Authored: Thu Aug 2 12:33:24 2018 -0700 Committer: Sailaja Polavarapu <[email protected]> Committed: Thu Aug 2 12:33:24 2018 -0700 ---------------------------------------------------------------------- unixauthnative/src/main/c/credValidator.c | 2 +- unixauthpam/src/main/c/pamCredValidator.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ranger/blob/d1c1e542/unixauthnative/src/main/c/credValidator.c ---------------------------------------------------------------------- diff --git a/unixauthnative/src/main/c/credValidator.c b/unixauthnative/src/main/c/credValidator.c index 189c2ca..e426bdd 100644 --- a/unixauthnative/src/main/c/credValidator.c +++ b/unixauthnative/src/main/c/credValidator.c @@ -35,7 +35,7 @@ int main(int ac, char **av, char **ev) struct spwd *spwd ; fgets(line,512,stdin) ; - sprintf(format, "LOGIN:%%%ds %%%ds", STRLEN, STRLEN); + sprintf(format, "LOGIN:%%%ds %%%ds", STRLEN-1, STRLEN-1); sscanf(line, format, username,password) ; pwp = getpwnam(username) ; http://git-wip-us.apache.org/repos/asf/ranger/blob/d1c1e542/unixauthpam/src/main/c/pamCredValidator.c ---------------------------------------------------------------------- diff --git a/unixauthpam/src/main/c/pamCredValidator.c b/unixauthpam/src/main/c/pamCredValidator.c index 8e36903..60d38ae 100644 --- a/unixauthpam/src/main/c/pamCredValidator.c +++ b/unixauthpam/src/main/c/pamCredValidator.c @@ -66,7 +66,7 @@ int main(int ac, char **av, char **ev) int retval; pam_handle_t *pamh = NULL; - sprintf(format, "LOGIN:%%%ds %%%ds", STRLEN, STRLEN); + sprintf(format, "LOGIN:%%%ds %%%ds", STRLEN-1, STRLEN-1); fgets(line,512,stdin) ; sscanf(line, format, username,password) ; conv.appdata_ptr = (char *) password;
