From 94f68efe7c406b6a4921bd2cc479c3a8c2e2d587 Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Thu, 7 Nov 1996 21:43:14 +0000 Subject: * svr_iters.c (glob_to_regexp): a principal glob with no @ defaults to @*, not @LOCAL.REAM [krb5-admin/161] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9337 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm5/srv/svr_iters.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/lib/kadm5/srv/svr_iters.c') diff --git a/src/lib/kadm5/srv/svr_iters.c b/src/lib/kadm5/srv/svr_iters.c index 19c9000212..706e778212 100644 --- a/src/lib/kadm5/srv/svr_iters.c +++ b/src/lib/kadm5/srv/svr_iters.c @@ -59,7 +59,7 @@ struct iter_data { * regexp is filled in with allocated memory contained a regular * expression to be used with re_comp/compile that matches what the * shell-style glob would match. If glob does not contain an "@" - * character and realm is not NULL, "@" is appended to the regexp. + * character and realm is not NULL, "@*" is appended to the regexp. * * Conversion algorithm: * @@ -85,8 +85,7 @@ kadm5_ret_t glob_to_regexp(char *glob, char *realm, char **regexp) /* and trailing null. If glob has no @, also allocate space for */ /* the realm. */ append_realm = (realm != NULL) && (strchr(glob, '@') == NULL); - p = (char *) malloc(strlen(glob)*2+ 3 + - (append_realm ? (strlen(realm)+1) : 0)); + p = (char *) malloc(strlen(glob)*2+ 3 + (append_realm ? 2 : 0)); if (p == NULL) return ENOMEM; *regexp = p; @@ -120,8 +119,7 @@ kadm5_ret_t glob_to_regexp(char *glob, char *realm, char **regexp) if (append_realm) { *p++ = '@'; - strcpy(p, realm); - p += strlen(realm); + *p++ = '*'; } *p++ = '$'; -- cgit