From b4a27cf49efddd6ccfa214e5e0240d73095e4ce9 Mon Sep 17 00:00:00 2001 From: Clinton Ebadi Date: Sun, 22 Apr 2018 04:13:15 -0400 Subject: [PATCH] Move hcoop changes to quilt patch Since this is a normal fork and not a native package, we need to keep changes from upstream in quilt or buildpackage barfs --- authpam.c | 7 +- courier_auth_config.h | 2 +- .../patches/0006-hcoop-openafs-changes.patch | 82 +++++++++++++++++++ debian/patches/series | 1 + preauthuserdbcommon.c | 25 +----- 5 files changed, 88 insertions(+), 29 deletions(-) create mode 100644 debian/patches/0006-hcoop-openafs-changes.patch diff --git a/authpam.c b/authpam.c index 2f2152b..9d40e69 100644 --- a/authpam.c +++ b/authpam.c @@ -128,20 +128,19 @@ static int dopam(pam_handle_t **pamh, int *started) } } +#if 0 #if HAVE_PAM_SETCRED - fprintf(stderr, "pam_setcred...\n"); if (retval == PAM_SUCCESS) { retval=pam_setcred(*pamh, PAM_ESTABLISH_CRED); if (retval != PAM_SUCCESS) { - fprintf(stderr, "pam_setcred failed, result %d\n", retval); + DPRINTF("pam_setcred failed, result %d", retval); } - fprintf(stderr, "pam_setcred done\n"); } #endif - +#endif if (retval == PAM_SUCCESS) { diff --git a/courier_auth_config.h b/courier_auth_config.h index 8c11c50..c033328 100644 --- a/courier_auth_config.h +++ b/courier_auth_config.h @@ -256,7 +256,7 @@ #define STDC_HEADERS 1 /* Location of the userdb database */ -#define USERDB "/etc/courier/userdb" +#define USERDB "/usr/local/etc/authlib/userdb" /* Version number of package */ /* #undef VERSION */ diff --git a/debian/patches/0006-hcoop-openafs-changes.patch b/debian/patches/0006-hcoop-openafs-changes.patch new file mode 100644 index 0000000..650cdea --- /dev/null +++ b/debian/patches/0006-hcoop-openafs-changes.patch @@ -0,0 +1,82 @@ +--- a/authpam.c ++++ b/authpam.c +@@ -128,19 +128,20 @@ + } + } + +-#if 0 + + #if HAVE_PAM_SETCRED ++ fprintf(stderr, "pam_setcred...\n"); + if (retval == PAM_SUCCESS) + { + retval=pam_setcred(*pamh, PAM_ESTABLISH_CRED); + if (retval != PAM_SUCCESS) + { +- DPRINTF("pam_setcred failed, result %d", retval); ++ fprintf(stderr, "pam_setcred failed, result %d\n", retval); + } ++ fprintf(stderr, "pam_setcred done\n"); + } + #endif +-#endif ++ + + if (retval == PAM_SUCCESS) + { +--- a/courier_auth_config.h ++++ b/courier_auth_config.h +@@ -256,7 +256,7 @@ + #define STDC_HEADERS 1 + + /* Location of the userdb database */ +-#define USERDB "/usr/local/etc/authlib/userdb" ++#define USERDB "/etc/courier/userdb" + + /* Version number of package */ + /* #undef VERSION */ +--- a/preauthuserdbcommon.c ++++ b/preauthuserdbcommon.c +@@ -14,11 +14,13 @@ + #if HAVE_UNISTD_H + #include + #endif ++#include ++#include + + #include "auth.h" + #include "courierauthdebug.h" + #include "userdb/userdb.h" +- ++#include "numlib/numlib.h" + + int auth_userdb_pre_common(const char *userid, const char *service, + int needpass, +@@ -105,6 +107,27 @@ + auth.maildir=udb->udb_mailbox; + auth.quota=udb->udb_quota; + ++ /* Get tokens for AFS */ ++ { ++ if (auth.sysuserid) ++ { ++ pid_t pid = fork (); ++ ++ if (pid == 0) ++ { ++ char uidstr[32] = ""; ++ snprintf(uidstr, sizeof(uidstr), "%ld", (long)*auth.sysuserid); ++ ++ libmail_changeuidgid (*auth.sysuserid, auth.sysgroupid); ++ execl ("/etc/courier/get-token", "get-token", uidstr, NULL); ++ } ++ else ++ { ++ waitpid (pid, NULL, 0); ++ } ++ } ++ } ++ + courier_authdebug_authinfo("DEBUG: authuserdb: ", &auth, 0, passwords); + rc= (*callback)(&auth, arg); + if (passwords) free(passwords); diff --git a/debian/patches/series b/debian/patches/series index 5ec4df0..cff79b5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ 0003-Fix-authdaemondprog-linking-missing-libcourierauth.l.patch 0004-Reorder-libs-on-pkglib_LTLIBRARIES-to-help-libtool-f.patch 0005-libcourierauth-libraries-are-normal-shared-libraries.patch +0006-hcoop-openafs-changes.patch diff --git a/preauthuserdbcommon.c b/preauthuserdbcommon.c index 9fcafe3..e39decb 100644 --- a/preauthuserdbcommon.c +++ b/preauthuserdbcommon.c @@ -14,13 +14,11 @@ #if HAVE_UNISTD_H #include #endif -#include -#include #include "auth.h" #include "courierauthdebug.h" #include "userdb/userdb.h" -#include "numlib/numlib.h" + int auth_userdb_pre_common(const char *userid, const char *service, int needpass, @@ -107,27 +105,6 @@ int rc; auth.maildir=udb->udb_mailbox; auth.quota=udb->udb_quota; - /* Get tokens for AFS */ - { - if (auth.sysuserid) - { - pid_t pid = fork (); - - if (pid == 0) - { - char uidstr[32] = ""; - snprintf(uidstr, sizeof(uidstr), "%ld", (long)*auth.sysuserid); - - libmail_changeuidgid (*auth.sysuserid, auth.sysgroupid); - execl ("/etc/courier/get-token", "get-token", uidstr, NULL); - } - else - { - waitpid (pid, NULL, 0); - } - } - } - courier_authdebug_authinfo("DEBUG: authuserdb: ", &auth, 0, passwords); rc= (*callback)(&auth, arg); if (passwords) free(passwords); -- 2.20.1