Menu

#4479 Missing permission in export dir not detected

Latest_Git
fixed
None
5
2014-06-29
2014-06-27
No

In current master (af1a674d255ec45615d373e6e632a3601c314498), a permission problem on the directory defined in $cfg['SaveDir'] is not detected. Works fine in 4.2.5.

Discussion

  • Marc Delisle

    Marc Delisle - 2014-06-28
    • assigned_to: Marc Delisle
     
  • Marc Delisle

    Marc Delisle - 2014-06-28
    • assigned_to: Marc Delisle --> nobody
     
  • Chirayu Chiripal

    Hi,
    It seems that following global vars are not in scope because include is inside the function causing the redirect to home page by some scripts (libraries/db_common.inc.php, libraries/db_table_exists.lib.php):

        global $db, $table, $cfg, $url_query, $userlink;
    

    Adding the above line will fix this issue (see https://github.com/D-storm/phpmyadmin/commit/13a13dd483e547ed683770ba04156e701a23fb00) but I am not sure whether its a good solution or not.

     
  • Marc Delisle

    Marc Delisle - 2014-06-29
    • assigned_to: Marc Delisle
     
  • Marc Delisle

    Marc Delisle - 2014-06-29

    Hi Chirayu,
    good catch. It's a good idea to add "global $cfg". For db and table, it's better to pass them as parameters to the function. For url_query, I'm not sure, because at the point of calling the function, it's not defined, so it does not seem necessary. For userlink, I tried without and it worked; any particular reason you want to declare this global?

    Also, do you want to prepare a final patch or do you want me to complete the work, following my suggestions?

     
  • Chirayu Chiripal

    Hi Marc,
    For url_query I get a missing parameter error (See attachment) & for userlink, I get a undefined variable message, both at server level export if I dont declare it.

    And yes, I can prepare a final patch.

     
    • Marc Delisle

      Marc Delisle - 2014-06-29

      Ok, so it seems that declaring url_query as global is the best thing to do.

       
  • Chirayu Chiripal

    For userlink the error is:

        Notice in ./libraries/server_common.inc.php#39
        Undefined variable: userlink
    
        Backtrace
    
        ./server_export.php#13: require_once(./libraries/server_common.inc.php)
        ./libraries/export.lib.php#768: include_once(./server_export.php)
        ./export.php#317: PMA_showExportPage(string 'server')
    

    maybe we can replace userlink with $GLOBALS['userlink'] at that line.

     
    • Marc Delisle

      Marc Delisle - 2014-06-29

      Good idea to use $GLOBALS['userlink'], this is what we are supposed to do anyway, plus it clarifies its origin.

       
  • Marc Delisle

    Marc Delisle - 2014-06-29
    • status: open --> fixed