Move hcoop changes to quilt patch
authorClinton Ebadi <clinton@unknownlamer.org>
Sun, 22 Apr 2018 08:13:15 +0000 (04:13 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Sun, 22 Apr 2018 08:13:15 +0000 (04:13 -0400)
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
courier_auth_config.h
debian/patches/0006-hcoop-openafs-changes.patch [new file with mode: 0644]
debian/patches/series
preauthuserdbcommon.c

index 2f2152b..9d40e69 100644 (file)
--- 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)
        {
index 8c11c50..c033328 100644 (file)
 #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 (file)
index 0000000..650cdea
--- /dev/null
@@ -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      <unistd.h>
+ #endif
++#include <sys/types.h>
++#include <sys/wait.h>
+ #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] = "<null>";
++            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);
index 5ec4df0..cff79b5 100644 (file)
@@ -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
index 9fcafe3..e39decb 100644 (file)
 #if    HAVE_UNISTD_H
 #include       <unistd.h>
 #endif
-#include <sys/types.h>
-#include <sys/wait.h>
 
 #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] = "<null>";
-             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);