Annotation of embedaddon/curl/docs/libcurl/opts/CURLOPT_NETRC.3, revision 1.1
1.1 ! misho 1: .\" **************************************************************************
! 2: .\" * _ _ ____ _
! 3: .\" * Project ___| | | | _ \| |
! 4: .\" * / __| | | | |_) | |
! 5: .\" * | (__| |_| | _ <| |___
! 6: .\" * \___|\___/|_| \_\_____|
! 7: .\" *
! 8: .\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
! 9: .\" *
! 10: .\" * This software is licensed as described in the file COPYING, which
! 11: .\" * you should have received as part of this distribution. The terms
! 12: .\" * are also available at https://curl.haxx.se/docs/copyright.html.
! 13: .\" *
! 14: .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
! 15: .\" * copies of the Software, and permit persons to whom the Software is
! 16: .\" * furnished to do so, under the terms of the COPYING file.
! 17: .\" *
! 18: .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
! 19: .\" * KIND, either express or implied.
! 20: .\" *
! 21: .\" **************************************************************************
! 22: .\"
! 23: .TH CURLOPT_NETRC 3 "March 23, 2020" "libcurl 7.70.0" "curl_easy_setopt options"
! 24:
! 25: .SH NAME
! 26: CURLOPT_NETRC \- request that .netrc is used
! 27: .SH SYNOPSIS
! 28: #include <curl/curl.h>
! 29:
! 30: CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NETRC, long level);
! 31: .SH DESCRIPTION
! 32: This parameter controls the preference \fIlevel\fP of libcurl between using
! 33: user names and passwords from your \fI~/.netrc\fP file, relative to user names
! 34: and passwords in the URL supplied with \fICURLOPT_URL(3)\fP. On Windows,
! 35: libcurl will use the file as \fI%HOME%/_netrc\fP, but you can also tell
! 36: libcurl a different file name to use with \fICURLOPT_NETRC_FILE(3)\fP.
! 37:
! 38: libcurl uses a user name (and supplied or prompted password) supplied with
! 39: \fICURLOPT_USERPWD(3)\fP or \fICURLOPT_USERNAME(3)\fP in preference to any of
! 40: the options controlled by this parameter.
! 41:
! 42: Only machine name, user name and password are taken into account (init macros
! 43: and similar things aren't supported).
! 44:
! 45: libcurl does not verify that the file has the correct properties set (as the
! 46: standard Unix ftp client does). It should only be readable by user.
! 47:
! 48: \fIlevel\fP should be set to one of the values described below.
! 49:
! 50: .IP CURL_NETRC_OPTIONAL
! 51: The use of the \fI~/.netrc\fP file is optional, and information in the URL is
! 52: to be preferred. The file will be scanned for the host and user name (to find
! 53: the password only) or for the host only, to find the first user name and
! 54: password after that \fImachine\fP, which ever information is not specified.
! 55:
! 56: Undefined values of the option will have this effect.
! 57: .IP CURL_NETRC_IGNORED
! 58: The library will ignore the \fI~/.netrc\fP file.
! 59:
! 60: This is the default.
! 61: .IP CURL_NETRC_REQUIRED
! 62: The use of the \fI~/.netrc\fP file is required, and information in the URL is
! 63: to be ignored. The file will be scanned for the host and user name (to find
! 64: the password only) or for the host only, to find the first user name and
! 65: password after that \fImachine\fP, which ever information is not specified.
! 66: .SH DEFAULT
! 67: CURL_NETRC_IGNORED
! 68: .SH PROTOCOLS
! 69: Most
! 70: .SH EXAMPLE
! 71: .nf
! 72: CURL *curl = curl_easy_init();
! 73: if(curl) {
! 74: CURLcode ret;
! 75: curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/");
! 76: curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
! 77: ret = curl_easy_perform(curl);
! 78: }
! 79: .fi
! 80: .SH AVAILABILITY
! 81: Always
! 82: .SH RETURN VALUE
! 83: Returns CURLE_OK
! 84: .SH "SEE ALSO"
! 85: .BR CURLOPT_USERPWD "(3), " CURLOPT_USERNAME "(3), " CURLOPT_NETRC_FILE "(3), "
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>