usertools.c revision 4b0b0bc3f9c4966b9f1a7433803a37c36fcaf285
/*
SSSD
User tools
Copyright (C) Stephen Gallagher <sgallagh@redhat.com> 2009
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pwd.h>
#include <pcre.h>
#include <errno.h>
#include <talloc.h>
#ifdef HAVE_LIBPCRE_LESSER_THAN_7
#define NAME_DOMAIN_PATTERN_OPTIONS (PCRE_EXTENDED)
#else
#endif
{
char *username;
return username;
}
{
}
return 0;
}
{
struct sss_names_ctx *ctx;
const char *errstr;
char *conf_path;
int errval;
int errpos;
int ret;
goto done;
}
goto done;
}
/* If not found in the domain, look in globals */
}
if (!ctx->re_pattern) {
"(?P<name>[^@]+)@?(?P<domain>[^@]*$)");
if (!ctx->re_pattern) {
goto done;
}
#ifdef HAVE_LIBPCRE_LESSER_THAN_7
} else {
"not support non-unique named subpatterns.\n"));
"subpatterns with a unique name and uses "
#endif
}
/* If not found in the domain, look in globals */
}
goto done;
}
}
goto done;
}
done:
}
return ret;
}
struct sss_names_ctx *snctx,
{
const char *result;
int ovec[30];
int origlen;
if (ret == PCRE_ERROR_NOMATCH) {
return EINVAL;
} else if (ret < 0) {
return EINVAL;
}
if (ret == 0) {
}
return EINVAL;
}
} else {
/* ignore "" string */
if (*result) {
} else {
}
}
return EOK;
}
static struct sss_domain_info * match_any_domain_or_subdomain_name (
{
uint32_t i;
return dom;
for (i = 0; i < dom->subdomain_count; i++) {
return dom->subdomains[i];
}
}
return NULL;
}
struct sss_domain_info *domains,
{
bool only_name_seen = false;
bool only_name_mismatch = false;
int code;
return ENOMEM;
/*
* If the name matched without the domain part, make note of it.
* All the other domain expressions must agree on the domain-less
* name.
*/
if (!only_name_seen) {
only_name_mismatch = true;
}
only_name_seen = true;
/*
* If a domain was returned, then it must match the name of the
* domain that this expression was found on, or one of the
* subdomains.
*/
} else {
"domain '%s', user is %s\n",
break;
}
}
/* EINVAL is returned when name doesn't match */
return code;
}
}
}
("name '%s' did not match any domain's expression\n", orig));
return EINVAL;
}
}
}
return EOK;
}
char *
const char *orig_name,
bool case_sensitive)
{
}
bool case_sensitive, const char ***_cased)
{
const char **out;
return EOK;
}
if (num == 0) {
return EOK;
}
return ENOMEM;
}
for (i = 0; i < num; i++) {
return ENOMEM;
}
}
return EOK;
}