[Pkg-cyrus-sasl2-commits] [cyrus-sasl2] 04/44: Rebase patches on top of 2.1.26-69-g4c8e3f2
Ondřej Surý
ondrej at debian.org
Sat Dec 31 13:07:09 UTC 2016
This is an automated email from the git hooks/post-receive script.
ondrej pushed a commit to branch master
in repository cyrus-sasl2.
commit de2fa48b0b83e37cd3f522a60b6c1880b2dd033c
Author: Ondřej Surý <ondrej at sury.org>
Date: Fri Jul 1 09:44:44 2016 +0200
Rebase patches on top of 2.1.26-69-g4c8e3f2
---
...Handle-NULL-returns-from-glibc-2.17-crypt.patch | 119 ---------------------
...map-infinite-loop-hang-when-IMAP-server-c.patch | 31 ------
2 files changed, 150 deletions(-)
diff --git a/debian/patches/0034-Handle-NULL-returns-from-glibc-2.17-crypt.patch b/debian/patches/0034-Handle-NULL-returns-from-glibc-2.17-crypt.patch
deleted file mode 100644
index b2e1552..0000000
--- a/debian/patches/0034-Handle-NULL-returns-from-glibc-2.17-crypt.patch
+++ /dev/null
@@ -1,119 +0,0 @@
-From: mancha <mancha1 at hush.com>
-Date: Thu, 11 Jul 2013 10:08:07 +0100
-Subject: Handle NULL returns from glibc 2.17+ crypt()
-
-Starting with glibc 2.17 (eglibc 2.17), crypt() fails with EINVAL
-(w/ NULL return) if the salt violates specifications. Additionally,
-on FIPS-140 enabled Linux systems, DES/MD5-encrypted passwords
-passed to crypt() fail with EPERM (w/ NULL return).
-
-When using glibc's crypt(), check return value to avoid a possible
-NULL pointer dereference.
-
-Patch by mancha1 at hush.com.
----
- pwcheck/pwcheck_getpwnam.c | 3 ++-
- pwcheck/pwcheck_getspnam.c | 4 +++-
- saslauthd/auth_getpwent.c | 4 +++-
- saslauthd/auth_shadow.c | 8 +++-----
- 4 files changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/pwcheck/pwcheck_getpwnam.c b/pwcheck/pwcheck_getpwnam.c
-index 4b34222..400289c 100644
---- a/pwcheck/pwcheck_getpwnam.c
-+++ b/pwcheck/pwcheck_getpwnam.c
-@@ -32,6 +32,7 @@ char *userid;
- char *password;
- {
- char* r;
-+ char* crpt_passwd;
- struct passwd *pwd;
-
- pwd = getpwnam(userid);
-@@ -41,7 +42,7 @@ char *password;
- else if (pwd->pw_passwd[0] == '*') {
- r = "Account disabled";
- }
-- else if (strcmp(pwd->pw_passwd, crypt(password, pwd->pw_passwd)) != 0) {
-+ else if (!(crpt_passwd = crypt(password, pwd->pw_passwd)) || strcmp(pwd->pw_passwd, (const char *)crpt_passwd) != 0) {
- r = "Incorrect password";
- }
- else {
-diff --git a/pwcheck/pwcheck_getspnam.c b/pwcheck/pwcheck_getspnam.c
-index 2b11286..6d607bb 100644
---- a/pwcheck/pwcheck_getspnam.c
-+++ b/pwcheck/pwcheck_getspnam.c
-@@ -32,13 +32,15 @@ char *userid;
- char *password;
- {
- struct spwd *pwd;
-+ char *crpt_passwd;
-
- pwd = getspnam(userid);
- if (!pwd) {
- return "Userid not found";
- }
-
-- if (strcmp(pwd->sp_pwdp, crypt(password, pwd->sp_pwdp)) != 0) {
-+ crpt_passwd = crypt(password, pwd->sp_pwdp);
-+ if (!crpt_passwd || strcmp(pwd->sp_pwdp, (const char *)crpt_passwd) != 0) {
- return "Incorrect password";
- }
- else {
-diff --git a/saslauthd/auth_getpwent.c b/saslauthd/auth_getpwent.c
-index fc8029d..d4ebe54 100644
---- a/saslauthd/auth_getpwent.c
-+++ b/saslauthd/auth_getpwent.c
-@@ -77,6 +77,7 @@ auth_getpwent (
- {
- /* VARIABLES */
- struct passwd *pw; /* pointer to passwd file entry */
-+ char *crpt_passwd; /* encrypted password */
- int errnum;
- /* END VARIABLES */
-
-@@ -105,7 +106,8 @@ auth_getpwent (
- }
- }
-
-- if (strcmp(pw->pw_passwd, (const char *)crypt(password, pw->pw_passwd))) {
-+ crpt_passwd = crypt(password, pw->pw_passwd);
-+ if (!crpt_passwd || strcmp(pw->pw_passwd, (const char *)crpt_passwd)) {
- if (flags & VERBOSE) {
- syslog(LOG_DEBUG, "DEBUG: auth_getpwent: %s: invalid password", login);
- }
-diff --git a/saslauthd/auth_shadow.c b/saslauthd/auth_shadow.c
-index d0efa9a..c00faa3 100644
---- a/saslauthd/auth_shadow.c
-+++ b/saslauthd/auth_shadow.c
-@@ -211,8 +211,8 @@ auth_shadow (
- RETURN("NO Insufficient permission to access NIS authentication database (saslauthd)");
- }
-
-- cpw = strdup((const char *)crypt(password, sp->sp_pwdp));
-- if (strcmp(sp->sp_pwdp, cpw)) {
-+ cpw = crypt(password, sp->sp_pwdp);
-+ if (!cpw || strcmp(sp->sp_pwdp, (const char *)cpw)) {
- if (flags & VERBOSE) {
- /*
- * This _should_ reveal the SHADOW_PW_LOCKED prefix to an
-@@ -222,10 +222,8 @@ auth_shadow (
- syslog(LOG_DEBUG, "DEBUG: auth_shadow: pw mismatch: '%s' != '%s'",
- sp->sp_pwdp, cpw);
- }
-- free(cpw);
- RETURN("NO Incorrect password");
- }
-- free(cpw);
-
- /*
- * The following fields will be set to -1 if:
-@@ -287,7 +285,7 @@ auth_shadow (
- RETURN("NO Invalid username");
- }
-
-- if (strcmp(upw->upw_passwd, crypt(password, upw->upw_passwd)) != 0) {
-+ if (!(cpw = crypt(password, upw->upw_passwd)) || (strcmp(upw->upw_passwd, (const char *)cpw) != 0)) {
- if (flags & VERBOSE) {
- syslog(LOG_DEBUG, "auth_shadow: pw mismatch: %s != %s",
- password, upw->upw_passwd);
diff --git a/debian/patches/0035-Fix-auth_rimap-infinite-loop-hang-when-IMAP-server-c.patch b/debian/patches/0035-Fix-auth_rimap-infinite-loop-hang-when-IMAP-server-c.patch
deleted file mode 100644
index 0ec867f..0000000
--- a/debian/patches/0035-Fix-auth_rimap-infinite-loop-hang-when-IMAP-server-c.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Jered Floyd <jered at convivian.com>
-Date: Thu, 24 Mar 2016 11:36:07 +0100
-Subject: Fix auth_rimap infinite loop (hang) when IMAP server closes
- connection
-
----
- saslauthd/auth_rimap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/saslauthd/auth_rimap.c b/saslauthd/auth_rimap.c
-index 06341d7..03584ac 100644
---- a/saslauthd/auth_rimap.c
-+++ b/saslauthd/auth_rimap.c
-@@ -494,7 +494,7 @@ auth_rimap (
- while( select (fds, &perm, NULL, NULL, &timeout ) >0 ) {
- if ( FD_ISSET(s, &perm) ) {
- ret = read(s, rbuf+rc, sizeof(rbuf)-rc);
-- if ( ret<0 ) {
-+ if ( ret<=0 ) {
- rc = ret;
- break;
- } else {
-@@ -607,7 +607,7 @@ auth_rimap (
- while( select (fds, &perm, NULL, NULL, &timeout ) >0 ) {
- if ( FD_ISSET(s, &perm) ) {
- ret = read(s, rbuf+rc, sizeof(rbuf)-rc);
-- if ( ret<0 ) {
-+ if ( ret<=0 ) {
- rc = ret;
- break;
- } else {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-cyrus-sasl2/cyrus-sasl2.git
More information about the Pkg-cyrus-sasl2-commits
mailing list