update from krb4
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3612 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -229,18 +229,17 @@ init_words (int argc, char **argv)
|
|||||||
errx (1, "cannot allocate memory for message");
|
errx (1, "cannot allocate memory for message");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
appres.text = strdup("");
|
int j;
|
||||||
|
int len = 1;
|
||||||
|
for(j = i; argv[j]; j++)
|
||||||
|
len += strlen(argv[j]) + 1;
|
||||||
|
appres.text = malloc(len);
|
||||||
if (appres.text == NULL)
|
if (appres.text == NULL)
|
||||||
errx (1, "cannot allocate memory for message");
|
errx (1, "cannot allocate memory for message");
|
||||||
while (argv[i]) {
|
appres.text[0] = 0;
|
||||||
int n = strlen (argv[i]);
|
for(; i < j; i++){
|
||||||
char *tmp = realloc(appres.text,
|
strcat(appres.text, argv[i]);
|
||||||
strlen(appres.text) + n + 2);
|
strcat(appres.text, " ");
|
||||||
if (tmp == NULL)
|
|
||||||
errx (1, "cannot allocate memory for message");
|
|
||||||
strcat (appres.text, argv[i]);
|
|
||||||
strcat (appres.text, " ");
|
|
||||||
++i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -545,6 +544,7 @@ countdown(XtPointer _t, XtIntervalId *_d)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef KRB5
|
||||||
static int
|
static int
|
||||||
verify_krb5(const char *name, const char *inst, const char *realm,
|
verify_krb5(const char *name, const char *inst, const char *realm,
|
||||||
const char *password)
|
const char *password)
|
||||||
@@ -578,7 +578,7 @@ verify_krb5(const char *name, const char *inst, const char *realm,
|
|||||||
krb5_free_context(context);
|
krb5_free_context(context);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
verify(char *password)
|
verify(char *password)
|
||||||
@@ -620,11 +620,13 @@ verify(char *password)
|
|||||||
if (unix_verify_user(name, password) == 0)
|
if (unix_verify_user(name, password) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#ifdef KRB5
|
||||||
/*
|
/*
|
||||||
* Try to verify as user with kerberos 5.
|
* Try to verify as user with kerberos 5.
|
||||||
*/
|
*/
|
||||||
if(verify_krb5(name, inst, realm, password) == 0)
|
if(verify_krb5(name, inst, realm, password) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to verify as user with kerberos 4.
|
* Try to verify as user with kerberos 4.
|
||||||
|
Reference in New Issue
Block a user