The branch, master has been updated
       via  3508ad2 Accept whole range of supported pids
      from  88b9921 cmake: Silence warning with gcc version >= 8

https://git.samba.org/?p=pam_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 3508ad2704103e863fca8c45ecda25021850befc
Author: Jakub Jelen <jje...@redhat.com>
Date:   Thu Jun 24 10:24:31 2021 +0200

    Accept whole range of supported pids
    
    Signed-off-by: Jakub Jelen <jje...@redhat.com>
    Reviewed-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 src/pam_wrapper.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/src/pam_wrapper.c b/src/pam_wrapper.c
index 6801d7b..efa7cbb 100644
--- a/src/pam_wrapper.c
+++ b/src/pam_wrapper.c
@@ -791,14 +791,20 @@ static void pwrap_clean_stale_dirs(const char *dir)
        buf[sizeof(buf) - 1] = '\0';
 
        tmp = strtol(buf, NULL, 10);
-       if (tmp == 0 || tmp > 0xFFFF || errno == ERANGE) {
+       if (tmp == 0 || errno == ERANGE) {
                PWRAP_LOG(PWRAP_LOG_ERROR,
                          "Failed to parse pid, buf=%s",
                          buf);
                return;
        }
 
-       pid = (pid_t)(tmp & 0xFFFF);
+       pid = (pid_t)tmp;
+       /* Check if we are out of pid_t range on this system */
+       if ((long)pid != tmp) {
+               PWRAP_LOG(PWRAP_LOG_ERROR,
+                         "pid out of range: %ld", tmp);
+               return;
+       }
 
        rc = kill(pid, 0);
        if (rc == -1) {


-- 
pam wrapper repository

Reply via email to