Modify smbspool_krb5_wrapper to just fall through to smbspool if AUTH_INFO_REQUIRED...
authorBryan Mason <bmason@redhat.com>
Thu, 16 Feb 2017 06:57:42 +0000 (22:57 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 17 Feb 2017 03:27:26 +0000 (04:27 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12575

Signed-off-by: Bryan Mason <bmason@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Feb 17 04:27:26 CET 2017 on sn-devel-144

source3/client/smbspool_krb5_wrapper.c

index d26a7a6a128ae441e4a3f90f411e0dea70b0fed2..bf97d82115a639caebfdf13a9f249e5fbce04833 100644 (file)
@@ -90,27 +90,29 @@ int main(int argc, char *argv[])
        int cmp;
        int rc;
 
-       uid = getuid();
-
-       CUPS_SMB_DEBUG("Started with uid=%d\n", uid);
-       if (uid != 0) {
-               goto smbspool;
-       }
-
        /* Check if AuthInfoRequired is set to negotiate */
        env = getenv("AUTH_INFO_REQUIRED");
+
+        /* If not set, then just call smbspool. */
        if (env == NULL) {
                CUPS_SMB_ERROR("AUTH_INFO_REQUIRED is not set");
-               fprintf(stderr, "ATTR: auth-info-required=negotiate\n");
-               return CUPS_BACKEND_AUTH_REQUIRED;
+                goto smbspool;
+       } else {
+                CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED=%s", env);
+                cmp = strcmp(env, "negotiate");
+                /* If AUTH_INFO_REQUIRED != "negotiate" then call smbspool. */
+                if (cmp != 0) {
+                          CUPS_SMB_ERROR(
+                            "AUTH_INFO_REQUIRED is not set to negotiate");
+                          goto smbspool;
+                }
        }
 
-       CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED=%s", env);
-       cmp = strcmp(env, "negotiate");
-       if (cmp != 0) {
-               CUPS_SMB_ERROR("AUTH_INFO_REQUIRED is not set to negotiate");
-               fprintf(stderr, "ATTR: auth-info-required=negotiate\n");
-               return CUPS_BACKEND_AUTH_REQUIRED;
+       uid = getuid();
+
+       CUPS_SMB_DEBUG("Started with uid=%d\n", uid);
+       if (uid != 0) {
+               goto smbspool;
        }
 
        /*