]> diplodocus.org Git - nmh/commitdiff
Protected call of mh_oauth_do_xoauth() with #ifdef OAUTH_SUPPORT to
authorDavid Levine <levinedl@acm.org>
Tue, 6 Sep 2016 21:49:59 +0000 (17:49 -0400)
committerDavid Levine <levinedl@acm.org>
Tue, 6 Sep 2016 21:49:59 +0000 (17:49 -0400)
allow post(1) to link when configured without it.

mts/smtp/smtp.c
uip/sendsbr.c

index 75e59f6f57d7c36a22a3dd96a984a2a88d426821..d407877cc21e2878abbe1663250482106dcc7b52 100644 (file)
@@ -1160,11 +1160,16 @@ sm_auth_xoauth2(const char *user, const char *oauth_svc, int snoop)
     const char *xoauth_client_res;
     int status;
 
     const char *xoauth_client_res;
     int status;
 
+#ifdef OAUTH_SUPPORT
     xoauth_client_res = mh_oauth_do_xoauth(user, oauth_svc,
                                           snoop ? stderr : NULL);
 
     if (xoauth_client_res == NULL)
     xoauth_client_res = mh_oauth_do_xoauth(user, oauth_svc,
                                           snoop ? stderr : NULL);
 
     if (xoauth_client_res == NULL)
-       return sm_ierror("Internal error: oauth_do_xoauth() returned NULL");
+       return sm_ierror("Internal error: mh_oauth_do_xoauth() returned NULL");
+#else
+                adios(NULL, "sendfrom built without OAUTH_SUPPORT, "
+                      "so oauth_svc %s is not supported", oauth_svc);
+#endif /* OAUTH_SUPPORT */
 
     status = smtalk(SM_AUTH, "AUTH XOAUTH2 %s", xoauth_client_res);
     if (status == 235) {
 
     status = smtalk(SM_AUTH, "AUTH XOAUTH2 %s", xoauth_client_res);
     if (status == 235) {
index 3b7299703a464ca4b3b938da4e50f3fdf2077e05..ddce3a45d6b0a0f69351dfd8b21c5382cae2c782 100644 (file)
@@ -135,7 +135,7 @@ sendsbr (char **vec, int vecp, char *program, char *draft, struct stat *st,
                        adios(NULL, errmsg);
                }
 #else
                        adios(NULL, errmsg);
                }
 #else
-                adios(NULL, "sendfrom built without OAUTH_SUPPORT, "
+                adios(NULL, "send built without OAUTH_SUPPORT, "
                       "so auth_svc %s is not supported", auth_svc);
 #endif /* OAUTH_SUPPORT */
        }
                       "so auth_svc %s is not supported", auth_svc);
 #endif /* OAUTH_SUPPORT */
        }
@@ -770,7 +770,7 @@ handle_sendfrom(char **vec, int *vecp, char *draft, const char *auth_svc) {
                 }
                 break;
 #else
                 }
                 break;
 #else
-                adios(NULL, "sendfrom built without OAUTH_SUPPORT, "
+                adios(NULL, "send built without OAUTH_SUPPORT, "
                       "so -saslmech xoauth2 is not supported");
 #endif /* OAUTH_SUPPORT */
             }
                       "so -saslmech xoauth2 is not supported");
 #endif /* OAUTH_SUPPORT */
             }
@@ -820,7 +820,7 @@ setup_oauth_params(char *vec[], int *vecp, const char *auth_svc,
                                            sizeof(errbuf)))
                adios(NULL, "Unable to retrieve oauth profile entries: %s",
                      errbuf);
                                            sizeof(errbuf)))
                adios(NULL, "Unable to retrieve oauth profile entries: %s",
                      errbuf);
-           
+
            vec[(*vecp)++] = getcpy("-authservice");
            vec[(*vecp)++] = getcpy(auth_svc);
            vec[(*vecp)++] = getcpy("-oauthcredfile");
            vec[(*vecp)++] = getcpy("-authservice");
            vec[(*vecp)++] = getcpy(auth_svc);
            vec[(*vecp)++] = getcpy("-oauthcredfile");