aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorKarl Heuer1998-04-06 22:10:30 +0000
committerKarl Heuer1998-04-06 22:10:30 +0000
commita51623bcfff298ffaa85055ab7e1270093635ce8 (patch)
tree3324146d77ad266c1a0d6654613f0a784f860581 /lib-src
parent757c23325145807e24689595555286c8f2089174 (diff)
downloademacs-a51623bcfff298ffaa85055ab7e1270093635ce8.tar.gz
emacs-a51623bcfff298ffaa85055ab7e1270093635ce8.zip
[MAIL_USE_POP]: Add support for "-g" and "-k"
command-line flags to tell movemail to use GSS-API or Kerberos authentication if they are supported.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/movemail.c45
1 files changed, 37 insertions, 8 deletions
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 7e29ab4150f..64cae0b46a7 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -188,16 +188,43 @@ main (argc, argv)
188 char *spool_name; 188 char *spool_name;
189#endif 189#endif
190 190
191#ifdef MAIL_USE_POP
192 int pop_flags = POP_NO_GETPASS | POP_NO_GSSAPI;
193# define ARGSTR "gkp"
194#else /* ! MAIL_USE_POP */
195# define ARGSTR "p"
196#endif /* MAIL_USE_POP */
197
191 delete_lockname = 0; 198 delete_lockname = 0;
192 199
193 while ((c = getopt (argc, argv, "p")) != EOF) 200 /*
201 'g' enables Kerberos and disables GSS-API.
202 'k' enables GSS-API and disables Kerberos.
203
204 By default, Kerberos is enabled (if it is compiled in) and
205 GSS-API is disabled, i.e., "-k" is the default. However, I'm
206 putting the flag in anyway, in case we decide to add new
207 authentication methods or change the default later.
208 */
209
210 while ((c = getopt (argc, argv, ARGSTR)) != EOF)
194 { 211 {
195 switch (c) { 212 switch (c) {
213#ifdef MAIL_USE_POP
214 case 'g':
215 pop_flags |= POP_NO_KERBEROS;
216 pop_flags &= ~POP_NO_GSSAPI;
217 break;
218 case 'k':
219 pop_flags |= POP_NO_GSSAPI;
220 pop_flags &= ~POP_NO_KERBEROS;
221 break;
222#endif
196 case 'p': 223 case 'p':
197 preserve_mail++; 224 preserve_mail++;
198 break; 225 break;
199 default: 226 default:
200 exit(1); 227 goto usage;
201 } 228 }
202 } 229 }
203 230
@@ -209,11 +236,12 @@ main (argc, argv)
209#endif 236#endif
210 ) 237 )
211 { 238 {
212 fprintf (stderr, "Usage: movemail [-p] inbox destfile%s\n", 239 usage:
240 fprintf (stderr, "Usage: movemail %s[-p] inbox destfile%s\n",
213#ifdef MAIL_USE_POP 241#ifdef MAIL_USE_POP
214 " [POP-password]" 242 "[-g|-k] ", " [POP-password]"
215#else 243#else
216 "" 244 "", ""
217#endif 245#endif
218 ); 246 );
219 exit (1); 247 exit (1);
@@ -254,7 +282,7 @@ main (argc, argv)
254 int status; 282 int status;
255 283
256 status = popmail (inname + 3, outname, preserve_mail, 284 status = popmail (inname + 3, outname, preserve_mail,
257 (argc - optind == 3) ? argv[optind+2] : NULL); 285 (argc - optind == 3) ? argv[optind+2] : NULL, pop_flags);
258 exit (status); 286 exit (status);
259 } 287 }
260 288
@@ -673,11 +701,12 @@ char ibuffer[BUFSIZ];
673char obuffer[BUFSIZ]; 701char obuffer[BUFSIZ];
674char Errmsg[80]; 702char Errmsg[80];
675 703
676popmail (user, outfile, preserve, password) 704popmail (user, outfile, preserve, password, flags)
677 char *user; 705 char *user;
678 char *outfile; 706 char *outfile;
679 int preserve; 707 int preserve;
680 char *password; 708 char *password;
709 int flags;
681{ 710{
682 int nmsgs, nbytes; 711 int nmsgs, nbytes;
683 register int i; 712 register int i;
@@ -686,7 +715,7 @@ popmail (user, outfile, preserve, password)
686 char *getenv (); 715 char *getenv ();
687 popserver server; 716 popserver server;
688 717
689 server = pop_open (0, user, password, POP_NO_GETPASS); 718 server = pop_open (0, user, password, flags);
690 if (! server) 719 if (! server)
691 { 720 {
692 error (pop_error); 721 error (pop_error);