diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-02-20 17:05:51 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-02-20 17:05:51 +0000 |
commit | 1d531f550dc91548443d90ed04899c9b16a1ce50 (patch) | |
tree | 130e7334952219fe34d5a6a69af6f1563a04e1ac | |
parent | 3549d8465cd3c41462114aac57dce8a4dfa53c80 (diff) | |
download | fetchmail-1d531f550dc91548443d90ed04899c9b16a1ce50.tar.gz fetchmail-1d531f550dc91548443d90ed04899c9b16a1ce50.tar.bz2 fetchmail-1d531f550dc91548443d90ed04899c9b16a1ce50.zip |
Check NETSEC string at .fetchmailrc parse time.
svn path=/trunk/; revision=1661
-rw-r--r-- | rcfile_y.y | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -22,6 +22,10 @@ #endif #include <string.h> +#if NET_SECURITY +#include <net/security.h> +#endif /* NET_SECURITY */ + #include "fetchmail.h" /* parser reads these */ @@ -41,6 +45,10 @@ static struct query current; /* current server record */ static int prc_errflag; static struct hostdata *leadentry; static flag trailer; +#if NET_SECURITY +static net_security_operation request[NET_SECURITY_OPERATION_MAX]; +static int requestlen = NET_SECURITY_OPERATION_MAX; +#endif /* NET_SECURITY */ static void record_current(); static void user_reset(); @@ -165,10 +173,13 @@ serv_option : AKA alias_list | QVIRTUAL STRING {current.server.qvirtual=xstrdup($2);} | NETSEC STRING { #ifdef NET_SECURITY - current.server.netsec = - xstrdup($2); + if (net_security_strtorequest(options, request, &requestlen)) + yyerror("invalid security request"); + else + current.server.netsec = + xstrdup($2); #else - yyerror("Network-security support disabled") + yyerror("network-security support disabled") #endif /* NET_SECURITY */ } | INTERFACE STRING { |