fd9abdda70912b99b24e3bf1a38f26fde908a74cnd Utility functions related to ID information
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor Copyright (C) Jan Zeleny <jzeleny@redhat.com> 2012
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor This program is free software; you can redistribute it and/or modify
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor it under the terms of the GNU General Public License as published by
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc the Free Software Foundation; either version 3 of the License, or
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor (at your option) any later version.
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen This program is distributed in the hope that it will be useful,
2e545ce2450a9953665f701bb05350f0d3f26275nd but WITHOUT ANY WARRANTY; without even the implied warranty of
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen GNU General Public License for more details.
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor You should have received a copy of the GNU General Public License
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor along with this program. If not, see <http://www.gnu.org/licenses/>.
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor const char *template,
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor DEBUG(SSSDBG_CRIT_FAILURE, "Missing home directory data.\n");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed.\n");
f4cbda69df0490c6deaacb8d04f103d200ddd183nd *n = '\0';
f4cbda69df0490c6deaacb8d04f103d200ddd183nd if ( *n == '\0' ) {
f4cbda69df0490c6deaacb8d04f103d200ddd183nd DEBUG(SSSDBG_CRIT_FAILURE, "format error, single %% at the end of "
f4cbda69df0490c6deaacb8d04f103d200ddd183nd "the template.\n");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor switch( *n ) {
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor "Cannot expand user name template because user name "
1e8959e8dfe29a452d93cb8c5dfdf4686f522fc1nd "is empty.\n");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor username = sss_output_name(tmp_ctx, homedir_ctx->username,
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor result = talloc_asprintf_append(result, "%s%s", p, username);
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand uid template "
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor "because uid is invalid.\n");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand domain name "
4aa603e6448b99f9371397d439795c91a93637eand "template because domain name "
4aa603e6448b99f9371397d439795c91a93637eand "is empty.\n");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand fully qualified "
e3e52ec6993de04bb0100e098ce0a569c7001382lgentis "name template because domain "
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor "or user name is empty.\n");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor username = sss_output_name(tmp_ctx, homedir_ctx->username,
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor result = talloc_asprintf_append(result, "%s%s@%s", p,
d5d58e8346ef3553dfd7d5f51078a9b268729b3frbowen "Original home directory for %s is not available, "
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor result = talloc_asprintf_append(result, "%s%s", p, orig);
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand domain name "
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor "template because domain flat "
e3e52ec6993de04bb0100e098ce0a569c7001382lgentis "name is empty.\n");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor "Cannot expand home directory substring template "
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor "substring is empty.\n");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor "Cannot expand user principal name template "
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor "string is empty.\n");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor DEBUG(SSSDBG_CRIT_FAILURE, "format error, unknown template "
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor "[%%%c].\n", *n);
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf_append failed.\n");
fbad7185dd78ec6e09c5b191693deda9d4bfa08cgryzor DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf_append failed.\n");