diff options
author | Craig Fields <cfields@mit.edu> | 1994-11-11 23:57:33 +0000 |
---|---|---|
committer | Craig Fields <cfields@mit.edu> | 1994-11-11 23:57:33 +0000 |
commit | 5c24b7f058c0ae317beda219780952f09af0396d (patch) | |
tree | 2c3390a32b1d293c62434a80e4fc520775c4dd6c | |
parent | cfe07cd0561e359949112dbee849afe3cc6d1e9f (diff) |
Picked up from p4a.
-rw-r--r-- | clients/zmailnotify/zmailnotify.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clients/zmailnotify/zmailnotify.c b/clients/zmailnotify/zmailnotify.c index f398630..7c5a746 100644 --- a/clients/zmailnotify/zmailnotify.c +++ b/clients/zmailnotify/zmailnotify.c @@ -97,6 +97,8 @@ main(argc, argv) if (!dir) dir = pwd->pw_dir; } + if (argc > 1) + user = argv[1]; (void) sprintf(lockfile,"%s/.maillock",dir); @@ -391,6 +393,7 @@ char *host; KTEXT ticket = (KTEXT)NULL; int rem; long authopts; + char *host_save; #endif char *get_errmsg(); char *svc_name; @@ -449,10 +452,17 @@ char *host; #else authopts = 0L; #endif - rem = krb_sendauth(authopts, s, ticket, "pop", hp->h_name, (char *)0, + host_save = malloc(strlen(hp->h_name) + 1); + if (!host_save) { + sprintf(Errmsg, "Out of memory."); + return(NOTOK); + } + strcpy(host_save, hp->h_name); + rem = krb_sendauth(authopts, s, ticket, "pop", host_save, (char *)0, 0, (MSG_DAT *) 0, (CREDENTIALS *) 0, (bit_64 *) 0, (struct sockaddr_in *)0, (struct sockaddr_in *)0,"ZMAIL0.0"); + free(host_save); free(ticket); if (rem != KSUCCESS) { (void) sprintf(Errmsg, "kerberos error: %s",krb_err_txt[rem]); |