[linux-pam] Docfix: pam_prompt() and pam_vprompt() return int.
by Tomáš Mráz
commit 114e54c7050f5b6c7b537edfe1ae4bef91763f71
Author: Tomas Mraz <tmraz(a)fedoraproject.org>
Date: Mon Oct 14 14:09:22 2013 +0200
Docfix: pam_prompt() and pam_vprompt() return int.
doc/man/pam_prompt.3.xml: pam_prompt() and pam_vprompt() return int.
doc/man/pam_prompt.3.xml | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/doc/man/pam_prompt.3.xml b/doc/man/pam_prompt.3.xml
index b526457..8b502a9 100644
--- a/doc/man/pam_prompt.3.xml
+++ b/doc/man/pam_prompt.3.xml
@@ -22,7 +22,7 @@
<funcsynopsis>
<funcsynopsisinfo>#include <security/pam_ext.h></funcsynopsisinfo>
<funcprototype>
- <funcdef>void <function>pam_prompt</function></funcdef>
+ <funcdef>int <function>pam_prompt</function></funcdef>
<paramdef>pam_handle_t *<parameter>pamh</parameter></paramdef>
<paramdef>int <parameter>style</parameter></paramdef>
<paramdef>char **<parameter>response</parameter></paramdef>
@@ -30,7 +30,7 @@
<paramdef><parameter>...</parameter></paramdef>
</funcprototype>
<funcprototype>
- <funcdef>void <function>pam_vprompt</function></funcdef>
+ <funcdef>int <function>pam_vprompt</function></funcdef>
<paramdef>pam_handle_t *<parameter>pamh</parameter></paramdef>
<paramdef>int <parameter>style</parameter></paramdef>
<paramdef>char **<parameter>response</parameter></paramdef>
@@ -75,7 +75,7 @@
<term>PAM_SUCCESS</term>
<listitem>
<para>
- Transaction was successful created.
+ Conversation succeded, response is set.
</para>
</listitem>
</varlistentry>
10 years, 5 months
[linux-pam] Make pam_tty_audit work with old kernels not supporting log_passwd.
by Tomáš Mráz
commit 7d0a74fbab4e413dd115592962e1ae68adbe9e2c
Author: Tomas Mraz <tmraz(a)fedoraproject.org>
Date: Mon Oct 14 14:04:23 2013 +0200
Make pam_tty_audit work with old kernels not supporting log_passwd.
modules/pam_tty_audit/pam_tty_audit.c(nl_recv): Pad result with zeros
if message is short from older kernel.
Signed-off-by: Richard Guy Briggs <rgb(a)redhat.com>
modules/pam_tty_audit/pam_tty_audit.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/modules/pam_tty_audit/pam_tty_audit.c b/modules/pam_tty_audit/pam_tty_audit.c
index cc86255..b6f53be 100644
--- a/modules/pam_tty_audit/pam_tty_audit.c
+++ b/modules/pam_tty_audit/pam_tty_audit.c
@@ -109,7 +109,7 @@ nl_recv (int fd, unsigned type, void *buf, size_t size)
struct msghdr msg;
struct nlmsghdr nlm;
struct iovec iov[2];
- ssize_t res;
+ ssize_t res, resdiff;
again:
iov[0].iov_base = &nlm;
@@ -161,12 +161,17 @@ nl_recv (int fd, unsigned type, void *buf, size_t size)
res = recvmsg (fd, &msg, 0);
if (res == -1)
return -1;
- if ((size_t)res != NLMSG_LENGTH (size)
+ resdiff = NLMSG_LENGTH(size) - (size_t)res;
+ if (resdiff < 0
|| nlm.nlmsg_type != type)
{
errno = EIO;
return -1;
}
+ else if (resdiff > 0)
+ {
+ memset((char *)buf + size - resdiff, 0, resdiff);
+ }
return 0;
}
10 years, 5 months