commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-666-g27b6965


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-666-g27b6965
Date: Tue, 04 Feb 2014 11:19:13 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=27b6965a55e7b81eeb4029748b38f207fea75c2a

The branch, master has been updated
       via  27b6965a55e7b81eeb4029748b38f207fea75c2a (commit)
       via  baad429501ce8e3d2e5d2d00d71b660e396f8908 (commit)
      from  b5b49d266063e4b6f1f5809b3b9f9a30eb335e47 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 27b6965a55e7b81eeb4029748b38f207fea75c2a
Author: Sergey Poznyakoff <address@hidden>
Date:   Tue Feb 4 13:17:32 2014 +0200

    Fix coredump if crypt returns NULL.
    
    * libmailutils/auth/system.c: Check return from crypt before passing it
    to strcmp.
    * libmu_auth/sql.c: Likewise.

commit baad429501ce8e3d2e5d2d00d71b660e396f8908
Author: Sergey Poznyakoff <address@hidden>
Date:   Tue Feb 4 13:08:00 2014 +0200

    Issue a deprecation warning if tls-required is used in pop3d or imap4d 
config

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

Summary of changes:
 imap4d/imap4d.c            |   14 ++++++++++++--
 libmailutils/auth/system.c |   13 +++++++++----
 libmu_auth/sql.c           |    8 ++++++--
 pop3d/pop3d.c              |   12 +++++++++++-
 4 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/imap4d/imap4d.c b/imap4d/imap4d.c
index 143219f..2e82a04 100644
--- a/imap4d/imap4d.c
+++ b/imap4d/imap4d.c
@@ -288,13 +288,23 @@ static int
 cb_tls_required (void *data, mu_config_value_t *val)
 {
   int bv;
-  
+
   if (mu_cfg_assert_value_type (val, MU_CFG_STRING))
     return 1;
   if (mu_cfg_parse_boolean (val->v.string, &bv))
     mu_error (_("Not a boolean value"));
   else if (bv)
-    tls_mode = tls_required;
+    {
+      tls_mode = tls_required;
+      mu_diag_output (MU_DIAG_WARNING,
+                     "the \"tls-required\" statement is deprecated, "
+                     "use \"tls required\" instead");
+    }
+  else
+    mu_diag_output (MU_DIAG_WARNING,
+                   "the \"tls-required\" statement is deprecated, "
+                   "use \"tls\" instead");
+    
   return 0;
 }
 
diff --git a/libmailutils/auth/system.c b/libmailutils/auth/system.c
index 0da805a..2fc050f 100644
--- a/libmailutils/auth/system.c
+++ b/libmailutils/auth/system.c
@@ -100,12 +100,14 @@ mu_authenticate_generic (struct mu_auth_data 
**return_data MU_ARG_UNUSED,
 {
   const struct mu_auth_data *auth_data = key;
   char *pass = call_data;
+  char *crypt_pass;
 
   if (!auth_data || !pass)
     return EINVAL;
   
-  return auth_data->passwd
-         && strcmp (auth_data->passwd, crypt (pass, auth_data->passwd)) == 0 ?
+  return auth_data->passwd &&
+         (crypt_pass = crypt (pass, auth_data->passwd)) != NULL &&
+         strcmp (auth_data->passwd, crypt_pass) == 0 ? 
           0 : MU_ERR_AUTH_FAILURE;
 }
 
@@ -124,10 +126,13 @@ mu_authenticate_system (struct mu_auth_data **return_data 
MU_ARG_UNUSED,
   if (auth_data)
     {
       struct spwd *spw;
+      char *crypt_pass;
+
       spw = getspnam (auth_data->name);
       if (spw)
-       return strcmp (spw->sp_pwdp, crypt (pass, spw->sp_pwdp)) == 0 ?
-               0 : MU_ERR_AUTH_FAILURE;
+       return (crypt_pass = crypt (pass, spw->sp_pwdp)) != NULL &&
+               strcmp (spw->sp_pwdp, crypt_pass) == 0 ?
+              0 : MU_ERR_AUTH_FAILURE;
     }
 #endif
   return MU_ERR_AUTH_FAILURE;
diff --git a/libmu_auth/sql.c b/libmu_auth/sql.c
index 782508e..7894d8a 100644
--- a/libmu_auth/sql.c
+++ b/libmu_auth/sql.c
@@ -627,7 +627,7 @@ mu_sql_authenticate (struct mu_auth_data **return_data 
MU_ARG_UNUSED,
 {
   const struct mu_auth_data *auth_data = key;
   char *pass = call_data;
-  char *sql_pass;
+  char *sql_pass, *crypt_pass;
   int rc;
   
   if (!auth_data)
@@ -639,7 +639,11 @@ mu_sql_authenticate (struct mu_auth_data **return_data 
MU_ARG_UNUSED,
   switch (mu_sql_module_config.password_type)
     {
     case password_hash:
-      rc = strcmp (sql_pass, crypt (pass, sql_pass));
+      crypt_pass = crypt (pass, sql_pass);
+      if (!crypt_pass)
+        rc = 1;
+      else
+        rc = strcmp (sql_pass, crypt_pass);
       break;
 
     case password_scrambled:
diff --git a/pop3d/pop3d.c b/pop3d/pop3d.c
index c8026e6..3e307f7 100644
--- a/pop3d/pop3d.c
+++ b/pop3d/pop3d.c
@@ -183,7 +183,17 @@ cb_tls_required (void *data, mu_config_value_t *val)
   if (mu_cfg_parse_boolean (val->v.string, &bv))
     mu_error (_("Not a boolean value"));
   else if (bv)
-    tls_mode = tls_required;
+    {
+      tls_mode = tls_required;
+      mu_diag_output (MU_DIAG_WARNING,
+                     "the \"tls-required\" statement is deprecated, "
+                     "use \"tls required\" instead");
+    }
+  else
+    mu_diag_output (MU_DIAG_WARNING,
+                   "the \"tls-required\" statement is deprecated, "
+                   "use \"tls\" instead");
+
   return 0;
 }
 


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]