Browse code

FOLLOWURL: Set a default username and password for password protected pages

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@918 77e5149b-7576-45b1-b177-96237e5ba77b

Nigel Horne authored on 2004/09/22 05:50:11
Showing 2 changed files
... ...
@@ -1,3 +1,9 @@
1
+Tue Sep 21 21:49:06 BST 2004 (njh)
2
+----------------------------------
3
+  * libclamav/mbox.c:	FOLLOWURL: Set a default username and password for
4
+				password protected sites to avoid the password
5
+				prompt bug with older versions of libcurl
6
+
1 7
 Tue Sep 21 19:01:32 CEST 2004 (tk)
2 8
 ----------------------------------
3 9
   * libclamav/filetypes.c: fix PK00PK zip rule (thanks to <steveb*webtribe.net>)
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: mbox.c,v $
20
+ * Revision 1.137  2004/09/21 20:47:38  nigelhorne
21
+ * FOLLOWURL: Set a default username and password for password protected pages
22
+ *
20 23
  * Revision 1.136  2004/09/21 12:18:52  nigelhorne
21 24
  * Fallback to CURLOPT_FILE if CURLOPT_WRITEDATA isn't defined
22 25
  *
... ...
@@ -396,7 +399,7 @@
396 396
  * Compilable under SCO; removed duplicate code with message.c
397 397
  *
398 398
  */
399
-static	char	const	rcsid[] = "$Id: mbox.c,v 1.136 2004/09/21 12:18:52 nigelhorne Exp $";
399
+static	char	const	rcsid[] = "$Id: mbox.c,v 1.137 2004/09/21 20:47:38 nigelhorne Exp $";
400 400
 
401 401
 #if HAVE_CONFIG_H
402 402
 #include "clamav-config.h"
... ...
@@ -2734,6 +2737,13 @@ getURL(struct arg *arg)
2734 2734
 #ifdef  CL_THREAD_SAFE
2735 2735
 	curl_easy_setopt(curl, CURLOPT_DNS_USE_GLOBAL_CACHE, 0);
2736 2736
 #endif
2737
+
2738
+	/*
2739
+	 * Prevent password: prompting with older versions
2740
+	 * FIXME: a better username?
2741
+	 */
2742
+	curl_easy_settop(curl, CURLOPT_USERPWD, "username:password");
2743
+
2737 2744
 	/*
2738 2745
 	 * FIXME: valgrind reports "pthread_mutex_unlock: mutex is not locked"
2739 2746
 	 * from gethostbyaddr_r within this. It may be a bug in libcurl