]> git.sesse.net Git - vlc/commitdiff
FTP cleartext authentication from Petr Vacek.
authorRémi Denis-Courmont <rem@videolan.org>
Fri, 9 Jun 2006 14:17:26 +0000 (14:17 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Fri, 9 Jun 2006 14:17:26 +0000 (14:17 +0000)
THANKS
modules/access/ftp.c

diff --git a/THANKS b/THANKS
index fb35388caafaccc73ca63e28b1cabe3d15cb2b5d..951e983119a45fa5020b16da724bbfb56a8d498b 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -110,6 +110,7 @@ Ondrej Kuda aka Albert <kuda at natur dot cuni dot cz> - HTTP interface tips and
 Patrick Horn <patrickd0thorn at mindspring d0t com> - DirectShow patch
 Paul Mackerras <paulus at linuxcare.com.au> - AltiVec IDCT and motion
 Pavlov Konstantin “thresh” - several Linux build system fixes
+Petr Vacek - FTP cleartext authentication
 Philippe Van Hecke <philippe at belnet dot be> - SAP header hash patch
 Pierre Marc Dumuid <pierre.dumuid at adelaide dot edu dot au> - Playlist patches
 Régis Duchesne <regis at via.ecp.fr> - original VLC code
index db37a0a31c347134a8f76bd3e707b3ce1f96bf60..c1737e0ada3f97dd46ee872aa288cc6874c203c5 100644 (file)
@@ -122,8 +122,12 @@ static int Connect( access_t *p_access, access_sys_t *p_sys )
     }
 
     msg_Dbg( p_access, "connection accepted (%d)", i_answer );
+    
+    if( p_sys->url.psz_username && *p_sys->url.psz_username )
+        psz = strdup( p_sys->url.psz_username );
+    else
+        psz = var_CreateGetString( p_access, "ftp-user" );
 
-    psz = var_CreateGetString( p_access, "ftp-user" );
     if( ftp_SendCommand( p_access, "USER %s", psz ) < 0 ||
         ftp_ReadCommand( p_access, &i_answer, NULL ) < 0 )
     {
@@ -139,7 +143,11 @@ static int Connect( access_t *p_access, access_sys_t *p_sys )
             break;
         case 3:
             msg_Dbg( p_access, "password needed" );
-            psz = var_CreateGetString( p_access, "ftp-pwd" );
+            if( p_sys->url.psz_password && *p_sys->url.psz_password )
+                psz = strdup( p_sys->url.psz_password );
+           else
+                psz = var_CreateGetString( p_access, "ftp-pwd" );
+
             if( ftp_SendCommand( p_access, "PASS %s", psz ) < 0 ||
                 ftp_ReadCommand( p_access, &i_answer, NULL ) < 0 )
             {