From ae1912cb0d494b48d514d937826c9fe83ec96c4d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 29 Dec 1999 14:20:26 +0000 Subject: Initial revision --- lib/netrc.h | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 lib/netrc.h (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h new file mode 100644 index 000000000..2875cbc53 --- /dev/null +++ b/lib/netrc.h @@ -0,0 +1,70 @@ +#ifndef __NETRC_H +#define __NETRC_H +/***************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is Curl. + * + * The Initial Developer of the Original Code is Daniel Stenberg. + * + * Portions created by the Initial Developer are Copyright (C) 1998. + * All Rights Reserved. + * + * Contributor(s): + * Rafael Sagula + * Sampo Kellomaki + * Linas Vepstas + * Bjorn Reese + * Johan Anderson + * Kjell Ericson + * Troy Engel + * Ryan Nelson + * Bjorn Stenberg + * Angus Mackay + * + * ------------------------------------------------------------ + * Main author: + * - Daniel Stenberg + * + * http://curl.haxx.nu + * + * $Source$ + * $Revision$ + * $Date$ + * $Author$ + * $State$ + * $Locker$ + * + * ------------------------------------------------------------ + * $Log$ + * Revision 1.1 1999-12-29 14:21:35 bagder + * Initial revision + * + * Revision 1.3 1999/09/06 06:59:41 dast + * Changed email info + * + * Revision 1.2 1999/08/13 07:34:48 dast + * Changed the URL in the header + * + * Revision 1.1.1.1 1999/03/11 22:23:34 dast + * Imported sources + * + ****************************************************************************/ +int ParseNetrc(char *host, + char *login, + char *password); +#endif -- cgit v1.2.1 From 26e8ccc63151a1c12db709cef4051803afd21189 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Jan 2000 23:36:14 +0000 Subject: syncing with local edit --- lib/netrc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index 2875cbc53..ffbd4794b 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -51,8 +51,8 @@ * * ------------------------------------------------------------ * $Log$ - * Revision 1.1 1999-12-29 14:21:35 bagder - * Initial revision + * Revision 1.2 2000-01-10 23:36:15 bagder + * syncing with local edit * * Revision 1.3 1999/09/06 06:59:41 dast * Changed email info -- cgit v1.2.1 From 1ef3600a0731fef8f59563a1e49981f1b64b9746 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 20 Jun 2000 15:31:26 +0000 Subject: haxx.nu => haxx.se --- lib/netrc.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index ffbd4794b..2ad9c200a 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -30,17 +30,17 @@ * Linas Vepstas * Bjorn Reese * Johan Anderson - * Kjell Ericson + * Kjell Ericson * Troy Engel * Ryan Nelson - * Bjorn Stenberg + * Bjorn Stenberg * Angus Mackay * * ------------------------------------------------------------ * Main author: - * - Daniel Stenberg + * - Daniel Stenberg * - * http://curl.haxx.nu + * http://curl.haxx.se * * $Source$ * $Revision$ @@ -51,7 +51,10 @@ * * ------------------------------------------------------------ * $Log$ - * Revision 1.2 2000-01-10 23:36:15 bagder + * Revision 1.3 2000-06-20 15:31:26 bagder + * haxx.nu => haxx.se + * + * Revision 1.2 2000/01/10 23:36:15 bagder * syncing with local edit * * Revision 1.3 1999/09/06 06:59:41 dast -- cgit v1.2.1 From 24dee483e9e925c2ab79dd582f70c9a55ab9ba4d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 3 Jan 2001 09:29:33 +0000 Subject: dual-license fix --- lib/netrc.h | 67 ++++++++++--------------------------------------------------- 1 file changed, 11 insertions(+), 56 deletions(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index 2ad9c200a..cb043707d 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -7,66 +7,21 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * The contents of this file are subject to the Mozilla Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ + * Copyright (C) 2000, Daniel Stenberg, , et al. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. + * In order to be useful for every potential user, curl and libcurl are + * dual-licensed under the MPL and the MIT/X-derivate licenses. * - * The Original Code is Curl. + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the MPL or the MIT/X-derivate + * licenses. You may pick one of these licenses. * - * The Initial Developer of the Original Code is Daniel Stenberg. + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. * - * Portions created by the Initial Developer are Copyright (C) 1998. - * All Rights Reserved. - * - * Contributor(s): - * Rafael Sagula - * Sampo Kellomaki - * Linas Vepstas - * Bjorn Reese - * Johan Anderson - * Kjell Ericson - * Troy Engel - * Ryan Nelson - * Bjorn Stenberg - * Angus Mackay - * - * ------------------------------------------------------------ - * Main author: - * - Daniel Stenberg - * - * http://curl.haxx.se - * - * $Source$ - * $Revision$ - * $Date$ - * $Author$ - * $State$ - * $Locker$ - * - * ------------------------------------------------------------ - * $Log$ - * Revision 1.3 2000-06-20 15:31:26 bagder - * haxx.nu => haxx.se - * - * Revision 1.2 2000/01/10 23:36:15 bagder - * syncing with local edit - * - * Revision 1.3 1999/09/06 06:59:41 dast - * Changed email info - * - * Revision 1.2 1999/08/13 07:34:48 dast - * Changed the URL in the header - * - * Revision 1.1.1.1 1999/03/11 22:23:34 dast - * Imported sources - * - ****************************************************************************/ + * $Id$ + *****************************************************************************/ int ParseNetrc(char *host, char *login, char *password); -- cgit v1.2.1 From 4031104404c6ceed5e57134125dcdb6cac51c564 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Jan 2001 10:11:41 +0000 Subject: Internal symbols that aren't static are now prefixed with 'Curl_' --- lib/netrc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index cb043707d..de9539040 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -22,7 +22,7 @@ * * $Id$ *****************************************************************************/ -int ParseNetrc(char *host, - char *login, - char *password); +int Curl_parsenetrc(char *host, + char *login, + char *password); #endif -- cgit v1.2.1 From 974f314f5785156af6983675aeb28313cc8ba2ea Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 19 Mar 2002 07:54:55 +0000 Subject: copyright string (year) update --- lib/netrc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index de9539040..5c98571e7 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2000, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. * * In order to be useful for every potential user, curl and libcurl are * dual-licensed under the MPL and the MIT/X-derivate licenses. -- cgit v1.2.1 From 105ec79b2b754f31ea75606f8246533e2d47a74e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 21 May 2002 22:17:19 +0000 Subject: James Cone's efforts to add another netrc parsing "mode" --- lib/netrc.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index 5c98571e7..4aa3c953c 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -25,4 +25,9 @@ int Curl_parsenetrc(char *host, char *login, char *password); + /* Assume: password[0]=0, host[0] != 0. + * If login[0] = 0, search for login and password within a machine section + * in the netrc. + * If login[0] != 0, search for password within machine and login. + */ #endif -- cgit v1.2.1 From ba4e69bebc8f7f32f3bc7faa1e13e7580754075b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Sep 2002 11:52:59 +0000 Subject: updated source code boilerplate/header --- lib/netrc.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index 4aa3c953c..bbafb3dac 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -1,6 +1,6 @@ #ifndef __NETRC_H #define __NETRC_H -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | @@ -9,19 +9,19 @@ * * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. * - * In order to be useful for every potential user, curl and libcurl are - * dual-licensed under the MPL and the MIT/X-derivate licenses. - * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the MPL or the MIT/X-derivate - * licenses. You may pick one of these licenses. + * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id$ - *****************************************************************************/ + ***************************************************************************/ int Curl_parsenetrc(char *host, char *login, char *password); -- cgit v1.2.1 From f26a338a54e04d0a6907f5d2479d8b0fa9daf297 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 16 Jan 2003 21:08:12 +0000 Subject: copyright year update in the source header --- lib/netrc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index bbafb3dac..8b5bdc1a5 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From ad77f760cf8223548cd214b361591dfde5443dea Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 11 Nov 2003 14:30:43 +0000 Subject: Added CURLOPT_NETRC_FILE. --- lib/netrc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index 8b5bdc1a5..ef066b4c3 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -24,7 +24,8 @@ ***************************************************************************/ int Curl_parsenetrc(char *host, char *login, - char *password); + char *password, + char *filename); /* Assume: password[0]=0, host[0] != 0. * If login[0] = 0, search for login and password within a machine section * in the netrc. -- cgit v1.2.1 From 053f6c85efd0bf698f73343989474d672d0563a8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 Jan 2004 09:19:33 +0000 Subject: updated year in the copyright string --- lib/netrc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index ef066b4c3..939c552df 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From bdf1157d55ce24ac966d8bc2f76c0ec70ab22fa6 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 1 Aug 2008 00:49:29 +0000 Subject: Made a parameter const --- lib/netrc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index 939c552df..a82b3fc35 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -22,7 +22,7 @@ * * $Id$ ***************************************************************************/ -int Curl_parsenetrc(char *host, +int Curl_parsenetrc(const char *host, char *login, char *password, char *filename); -- cgit v1.2.1 From a07bc79117971b96ebf3188c0a34a73ee0a3609b Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 14 Feb 2010 19:40:18 +0000 Subject: removed trailing whitespace --- lib/netrc.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index a82b3fc35..e6df41941 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -1,18 +1,18 @@ -#ifndef __NETRC_H -#define __NETRC_H +#ifndef HEADER_CURL_NETRC_H +#define HEADER_CURL_NETRC_H /*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. - * + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. @@ -31,4 +31,5 @@ int Curl_parsenetrc(const char *host, * in the netrc. * If login[0] != 0, search for password within machine and login. */ -#endif + +#endif /* HEADER_CURL_NETRC_H */ -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- lib/netrc.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index e6df41941..5406d4c5d 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -20,7 +20,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ int Curl_parsenetrc(const char *host, char *login, -- cgit v1.2.1 From 39d0d787d20b29ed57b10477340c7d000041d31d Mon Sep 17 00:00:00 2001 From: Julien Chaffraix Date: Mon, 7 Feb 2011 22:12:37 -0800 Subject: test1304: Added some unit tests for Curl_parsenetrc. Moved some definitons into the header file so that we can reuse them. --- lib/netrc.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/netrc.h') diff --git a/lib/netrc.h b/lib/netrc.h index 5406d4c5d..4db764df2 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -21,6 +21,12 @@ * KIND, either express or implied. * ***************************************************************************/ + +/* Make sure we have room for at least this size: */ +#define LOGINSIZE 64 +#define PASSWORDSIZE 64 + +/* returns -1 on failure, 0 if the host is found, 1 is the host isn't found */ int Curl_parsenetrc(const char *host, char *login, char *password, -- cgit v1.2.1