summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clients/zmailnotify/zmailnotify.c12
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]);