Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom prompt crashes pam #8

Open
bastischubert opened this issue Jan 10, 2019 · 1 comment
Open

Custom prompt crashes pam #8

bastischubert opened this issue Jan 10, 2019 · 1 comment

Comments

@bastischubert
Copy link

Hi,

we compiled the current HEAD and noticed that setting a custom prompt (prompt=2FA-Token:) the pam plugin crashes.

last famous words from strace:

[pid 3555] 10:44:40.730946 writev(2</dev/null>, [{"*** Error in `", 14}, {"sshd: adm [pam]", 15}, {"': ", 3}, {"free(): invalid pointer", 23}, {": 0x", 4}, {"000055e8ab1f6ecf", 16}, {" ***\n", 5}], 7) = 80 <0.000044>
[pid 3555] 10:44:40.731118 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faf2ef24000 <0.000046>

@floh116 @cron2

@beckerr-rzht
Copy link

This patch should fix the "free(): invalid pointer" crash:

--- a/src/pam_linotp.c
+++ b/src/pam_linotp.c
@@ -784,7 +784,7 @@ int pam_linotp_get_config(int argc, const char *argv[], LinOTPConfig * config, i
                 log_error("Your prompt definition is to long: %s [%]", argv[i], RESMAXLEN);
                 return (PAM_AUTH_ERR);
             } else {
-                config->prompt = temp;
+                config->prompt = strdup(temp);
             }
         }
         else {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants