From 29752834fbf3a19e4e117668abfce4e4c7c48ee4 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Tue, 23 Feb 2010 09:43:51 +0100 Subject: Add expandable sequences to krb5_ccachedir As with krb5_ccname_template sequences like %u can be used in the krb5_ccachedir parameter which are expanded at runtime. If the directory does not exist, it will be created. Depending on the used sequences it is created as a public or private directory. --- src/providers/krb5/krb5_init.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/providers/krb5/krb5_init.c') diff --git a/src/providers/krb5/krb5_init.c b/src/providers/krb5/krb5_init.c index 43cbc1bc7..4d2123815 100644 --- a/src/providers/krb5/krb5_init.c +++ b/src/providers/krb5/krb5_init.c @@ -53,6 +53,9 @@ int sssm_krb5_auth_init(struct be_ctx *bectx, FILE *debug_filep; const char *krb5_servers; const char *krb5_realm; + const char *errstr; + int errval; + int errpos; if (krb5_options == NULL) { krb5_options = talloc_zero(bectx, struct krb5_options); @@ -135,6 +138,15 @@ int sssm_krb5_auth_init(struct be_ctx *bectx, fcntl(ctx->child_debug_fd, F_SETFD, v & ~FD_CLOEXEC); } + ctx->illegal_path_re = pcre_compile2(ILLEGAL_PATH_PATTERN, 0, + &errval, &errstr, &errpos, NULL); + if (ctx->illegal_path_re == NULL) { + DEBUG(1, ("Invalid Regular Expression pattern at position %d. " + "(Error: %d [%s])\n", errpos, errval, errstr)); + ret = EFAULT; + goto fail; + } + *ops = &krb5_auth_ops; *pvt_auth_data = ctx; return EOK; -- cgit