Index: modules/system/system.module
===================================================================
RCS file: /Users/wright/drupal/local_repo/drupal/modules/system/system.module,v
retrieving revision 1.827
diff -u -p -r1.827 system.module
--- modules/system/system.module	27 Oct 2009 04:16:39 -0000	1.827
+++ modules/system/system.module	27 Oct 2009 07:21:07 -0000
@@ -1450,14 +1450,15 @@ function _system_themes_access($theme) {
 }
 
 /**
- * Invoke a given callback via authorize.php to run with elevated privileges.
+ * Setup a given callback to run via authorize.php with elevated privileges.
  *
- * To use authorize.php, certain variables must be stashed into
- * $_SESSION. This function sets up all the necessary $_SESSION variables,
- * then redirects to authorize.php to initiate the workflow that will
- * eventually lead to the callback being invoked. The callback will be invoked
- * at a low bootstrap level, without all modules being invoked, so it needs to
- * be careful not to assume any code exists.
+ * To use authorize.php, certain variables must be stashed into $_SESSION.
+ * This function sets up all the necessary $_SESSION variables, then returns
+ * the full path to authorize.php so the caller can redirect to authorize.php.
+ * That initiates the workflow that will eventually lead to the callback being
+ * invoked. The callback will be invoked at a low bootstrap level, without all
+ * modules being invoked, so it needs to be careful not to assume any code
+ * exists.
  *
  * @param $callback
  *   The name of the function to invoke one the user authorizes the operation.
@@ -1470,9 +1471,9 @@ function _system_themes_access($theme) {
  * @param $page_title
  *   Optional string to use as the page title once redirected to authorize.php.
  * @return
- *   Nothing. This function redirects to authorize.php and does not return.
+ *   The path to authorize.php that the caller should redirect to.
  */
-function system_run_authorized($callback, $file, $arguments = array(), $page_title = NULL) {
+function system_setup_authorized($callback, $file, $arguments = array(), $page_title = NULL) {
   global $base_url;
 
   // First, figure out what file transfer backends the site supports, and put
@@ -1491,8 +1492,8 @@ function system_run_authorized($callback
     $_SESSION['authorize_operation']['page_title'] = $page_title;
   }
 
-  // Finally, redirect to authorize.php.
-  drupal_goto($base_url . '/authorize.php');
+  // Return the path to authorize.php so the caller can redirect as needed.
+  return $base_url . '/authorize.php';
 }
 
 /**
Index: modules/update/update.manager.inc
===================================================================
RCS file: /Users/wright/drupal/local_repo/drupal/modules/update/update.manager.inc,v
retrieving revision 1.8
diff -u -p -r1.8 update.manager.inc
--- modules/update/update.manager.inc	27 Oct 2009 03:34:01 -0000	1.8
+++ modules/update/update.manager.inc	27 Oct 2009 07:20:01 -0000
@@ -396,9 +396,9 @@ function update_manager_confirm_update_f
  * update, do so now. Otherwise, pull information about all the required
  * updates out of the SESSION, figure out what Updater class is needed for
  * each one, generate an array of update operations to perform, and hand it
- * all off to system_run_authorized() where we redirect to authorize.php.
+ * all off to system_setup_authorized(), then redirect to authorize.php.
  *
- * @see system_run_authorized()
+ * @see system_setup_authorized()
  */
 function update_manager_confirm_update_form_submit($form, &$form_state) {
   if ($form_state['values']['site_offline'] == TRUE) {
@@ -440,7 +440,7 @@ function update_manager_confirm_update_f
     // credentials and invoke update_authorize_run_update() indirectly with
     // whatever FileTransfer object authorize.php creates for us.
     else {
-      system_run_authorized('update_authorize_run_update', drupal_get_path('module', 'update') . '/update.authorize.inc', array($updates));
+      $form_state['redirect'] = system_setup_authorized('update_authorize_run_update', drupal_get_path('module', 'update') . '/update.authorize.inc', array($updates));
     }
   }
 }
@@ -616,7 +616,7 @@ function update_manager_install_form_sub
   // credentials and invoke update_authorize_run_install() indirectly with
   // whatever FileTransfer object authorize.php creates for us.
   else {
-    system_run_authorized('update_authorize_run_install', drupal_get_path('module', 'update') . '/update.authorize.inc', $arguments);
+    $form_state['redirect'] = system_setup_authorized('update_authorize_run_install', drupal_get_path('module', 'update') . '/update.authorize.inc', $arguments);
   }
 }
 
