summaryrefslogtreecommitdiff
path: root/source3/libsmb/clikrb5.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-07 17:32:32 -0800
committerJeremy Allison <jra@samba.org>2007-12-07 17:32:32 -0800
commit42cfffae80480eae4381902fff3f7c61f858a933 (patch)
tree2fc1bc486fa988a4f2854310bcf91943db1aa566 /source3/libsmb/clikrb5.c
parent25288b0e4472c728fc5a3a70c6c3e1f621ffae5f (diff)
downloadsamba-42cfffae80480eae4381902fff3f7c61f858a933.tar.gz
samba-42cfffae80480eae4381902fff3f7c61f858a933.tar.bz2
samba-42cfffae80480eae4381902fff3f7c61f858a933.zip
Remove next_token - all uses must now be next_token_talloc.
No more temptations to use static length strings. Jeremy. (This used to be commit ec003f39369910dee852b7cafb883ddaa321c2de)
Diffstat (limited to 'source3/libsmb/clikrb5.c')
-rw-r--r--source3/libsmb/clikrb5.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index d996d61a48..549574caad 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -1592,6 +1592,7 @@ done:
krb5_error_code ret = 0;
TALLOC_CTX *mem_ctx;
char keytab_string[MAX_KEYTAB_NAME_LEN];
+ char *kt_str = NULL;
bool found_valid_name = False;
const char *pragma = "FILE";
const char *tmp = NULL;
@@ -1654,29 +1655,27 @@ done:
ret = ENOMEM;
goto out;
}
-
+
if (strncmp(tmp, "ANY:", 4) == 0) {
tmp += 4;
}
memset(&keytab_string, '\0', sizeof(keytab_string));
- while (next_token(&tmp, keytab_string, ",", sizeof(keytab_string))) {
-
- if (strncmp(keytab_string, "WRFILE:", 7) == 0) {
+ while (next_token_talloc(mem_ctx, &tmp, &kt_str, ",")) {
+ if (strncmp(kt_str, "WRFILE:", 7) == 0) {
found_valid_name = True;
- tmp = keytab_string;
+ tmp = kt_str;
tmp += 7;
}
- if (strncmp(keytab_string, "FILE:", 5) == 0) {
+ if (strncmp(kt_str, "FILE:", 5) == 0) {
found_valid_name = True;
- tmp = keytab_string;
+ tmp = kt_str;
tmp += 5;
}
if (found_valid_name) {
-
if (tmp[0] != '/') {
ret = KRB5_KT_BADNAME;
goto out;
@@ -1690,7 +1689,7 @@ done:
break;
}
}
-
+
if (!found_valid_name) {
ret = KRB5_KT_UNKNOWN_TYPE;
goto out;