48 # NcFTP firewall preferences\n\ 49 # ==========================\n\ 54 # If you need to use a proxy for FTP, you can configure it below.\n\ 55 # If you do not need one, leave the ``firewall-type'' variable set\n\ 56 # to 0. Any line that does not begin with the ``#'' character is\n\ 57 # considered a configuration command line.\n\ 61 # NOTE: NcFTP does NOT support HTTP proxies that do FTP, such as \"squid\"\n\ 62 # or Netscape Proxy Server. Why? Because you have to communicate with\n\ 63 # them using HTTP, and this is a FTP only program.\n\ 67 # Types of firewalls:\n\ 68 # ------------------\n\ 70 # type 1: Connect to firewall host, but send \"USER user@real.host.name\"\n\ 74 # type 2: Connect to firewall, login with \"USER fwuser\" and\n\ 75 # \"PASS fwpassword\", and then \"USER user@real.host.name\"\n\ 77 # type 3: Connect to and login to firewall, and then use\n\ 78 # \"SITE real.host.name\", followed by the regular USER and PASS.\n\ 82 # type 4: Connect to and login to firewall, and then use\n\ 83 # \"OPEN real.host.name\", followed by the regular USER and PASS.\n\ 85 # type 5: Connect to firewall host, but send\n\ 86 # \"USER user@fwuser@real.host.name\" and\n\ 87 # \"PASS pass@fwpass\" to login.\n\ 91 # type 6: Connect to firewall host, but send\n\ 92 # \"USER fwuser@real.host.name\" and\n\ 93 # \"PASS fwpass\" followed by a regular\n\ 94 # \"USER user\" and\n\ 95 # \"PASS pass\" to complete the login.\n\ 99 # type 7: Connect to firewall host, but send\n\ 100 # \"USER user@real.host.name fwuser\" and\n\ 101 # \"PASS pass\" followed by\n\ 102 # \"ACCT fwpass\" to complete the login.\n\ 104 # type 0: Do NOT use a firewall (most users will choose this).\n\ 112 # The ``firewall-host'' variable should be the IP address or hostname of\n\ 113 # your firewall server machine.\n\ 118 (
void)
fprintf(fp,
"firewall-host=firewall.domain.com\n");
127 # The ``firewall-user'' variable tells NcFTP what to use as the user ID\n\ 128 # when it logs in to the firewall before connecting to the outside world.\n\ 136 # The ``firewall-password'' variable is the password associated with\n\ 137 # the firewall-user ID. If you set this here, be sure to change the\n\ 138 # permissions on this file so that no one (except the superuser) can\n\ 139 # see your password. You may also leave this commented out, and then\n\ 140 # NcFTP will prompt you each time for the password.\n\ 144 firewall-password=fwpass\n\ 148 # Your firewall may require you to connect to a non-standard port for\n\ 149 # outside FTP services, instead of the internet standard port number (21).\n\ 157 # You probably do not want to FTP to the firewall for hosts on your own\n\ 158 # domain. You can set ``firewall-exception-list'' to a list of domains\n\ 159 # or hosts where the firewall should not be used. For example, if your\n\ 160 # domain was ``probe.net'' you could set this to ``.probe.net''.\n\ 164 # If you leave this commented out, the default behavior is to attempt to\n\ 165 # lookup the current domain, and exclude hosts for it. Otherwise, set it\n\ 166 # to a list of comma-delimited domains or hostnames. The special token\n\ 167 # ``localdomain'' is used for unqualified hostnames, so if you want hosts\n\ 168 # without explicit domain names to avoid the firewall, be sure to include\n\ 169 # that in your list.\n\ 174 (
void)
fprintf(fp,
"firewall-exception-list=%s,localhost,localdomain\n",
cp);
176 (
void)
fprintf(fp,
"firewall-exception-list=.probe.net,localhost,foo.bar.com,localdomain\n");
183 # You may also specify passive mode here. Normally this is set in the\n\ 184 # regular $HOME/.ncftp/prefs file. This must be set to one of\n\ 185 # \"on\", \"off\", or \"optional\", which mean always use PASV,\n\ 186 # always use PORT, and try PASV then PORT, respectively.\n\ 195 # NOTE: This file was created for you on %s\ 196 # by NcFTP %.5s. Removing this file will cause the next run of NcFTP\n\ 197 # to generate a new one, possibly with more configurable options.\n",
202 # ALSO: A %s file, if present, is processed before this file,\n\ 203 # and a %s file, if present, is processed after.\n",
223 if ((tok1 ==
NULL) || (tok1[0] ==
'#'))
228 if (
ISTREQ(tok1,
"firewall-type")) {
232 }
else if (
ISTREQ(tok1,
"firewall-host")) {
234 }
else if (
ISTREQ(tok1,
"firewall-port")) {
238 }
else if (
ISTREQ(tok1,
"firewall-user")) {
240 }
else if (
ISTREQ(tok1,
"firewall-pass")) {
242 }
else if (
ISTREQ(tok1,
"firewall-password")) {
244 }
else if (
ISTREQ(tok1,
"firewall-exception-list")) {
246 }
else if (
ISTREQ(tok1,
"passive")) {
247 if (
ISTREQ(tok2,
"optional")) {
249 }
else if (
ISTREQ(tok2,
"on")) {
251 }
else if (
ISTREQ(tok2,
"off")) {
253 }
else if ((
int)
isdigit(tok2[0])) {
316 if ((userFile == 0) && (sysFile == 0)) {
#define kFirewallLastType
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
void WriteDefaultFirewallPrefs(FILE *fp)
char * OurDirectoryPath(char *const dst, const size_t siz, const char *const fname)
#define STRNCPY(dst, src, n)
#define kFirewallNotInUse
void FTPInitializeOurHostName(const FTPLIPtr)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define kFallBackToSendPortMode
_Check_return_ _CRTIMP int __cdecl _chmod(_In_z_ const char *_Filename, _In_ int _Mode)
#define kFirewallPrefFileName
void LoadFirewallPrefs(int forceReload)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
void ProcessFirewallPrefFile(FILE *fp)
char gFirewallExceptionList[256]
char * strtok(char *String, const char *Delimiters)
char * strchr(const char *String, int ch)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
#define kGlobalFirewallPrefFileName
#define kGlobalFixedFirewallPrefFileName
unsigned int gFirewallPort
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *