summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-06-28 18:12:15 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-07-07 10:29:42 +0200
commit393306307bd908fcec8858f665226ac56238a21b (patch)
tree6f7cfa017cef1c9bdcd04019d8d1c9afa0f320a1 /src/util
parent1f5f330f02a95abf76b46f42ce853d2a5a1f2a61 (diff)
downloadsssd-393306307bd908fcec8858f665226ac56238a21b.tar.gz
sssd-393306307bd908fcec8858f665226ac56238a21b.tar.xz
sssd-393306307bd908fcec8858f665226ac56238a21b.zip
UTIL: Remove unused functions
The conversion to sysdb made several functions obsolete. Remove them. Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/domain_info_utils.c72
-rw-r--r--src/util/usertools.c59
-rw-r--r--src/util/util.h13
3 files changed, 0 insertions, 144 deletions
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c
index f07d7e98b..360f70376 100644
--- a/src/util/domain_info_utils.c
+++ b/src/util/domain_info_utils.c
@@ -739,78 +739,6 @@ done:
return ret;
}
-errno_t fix_domain_in_name_list(TALLOC_CTX *mem_ctx,
- struct sss_domain_info *dom,
- char **in, char ***_out)
-{
- int ret;
- size_t c;
- TALLOC_CTX *tmp_ctx;
- char **out;
- struct sss_domain_info *head;
- struct sss_domain_info *out_domain;
- char *in_name;
- char *in_domain;
-
- head = get_domains_head(dom);
-
- tmp_ctx = talloc_new(NULL);
- if (tmp_ctx == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n");
- return ENOMEM;
- }
-
- /* count elements */
- for (c = 0; in[c] != NULL; c++);
-
- out = talloc_zero_array(tmp_ctx, char *, c + 1);
- if (out == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, "talloc_array failed.\n");
- ret = ENOMEM;
- goto done;
- }
-
- for (c = 0; in[c] != NULL; c++) {
- ret = sss_parse_name(tmp_ctx, head->names, in[c], &in_domain,
- &in_name);
- if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE, "sss_parse_name failed for [%s].\n",
- in[c]);
- goto done;
- }
-
- if (in_domain == NULL) {
- out[c] = talloc_strdup(out, in_name);
- } else {
- out_domain = find_domain_by_name(head, in_domain, true);
- if (out_domain == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE,
- "Cannot find domain with name [%s].\n", in_domain);
- ret = EINVAL;
- goto done;
- }
-
- out[c] = sss_get_domain_name(out, in_name, out_domain);
- }
-
- if (out[c] == NULL) {
- DEBUG(SSSDBG_OP_FAILURE, "%s failed.\n",
- in_domain == NULL ? "talloc_strdup" : "sss_tc_fqname");
- ret = ENOMEM;
- goto done;
- }
- }
-
- *_out = talloc_steal(mem_ctx, out);
-
- ret = EOK;
-
-done:
- talloc_free(tmp_ctx);
-
- return ret;
-}
-
enum sss_domain_state sss_domain_get_state(struct sss_domain_info *dom)
{
return dom->state;
diff --git a/src/util/usertools.c b/src/util/usertools.c
index 8e5be9788..e0d520ad1 100644
--- a/src/util/usertools.c
+++ b/src/util/usertools.c
@@ -365,30 +365,6 @@ int sss_parse_name(TALLOC_CTX *memctx,
return EOK;
}
-int sss_parse_name_const(TALLOC_CTX *memctx,
- struct sss_names_ctx *snctx, const char *orig,
- const char **_domain, const char **_name)
-{
- char *domain;
- char *name;
- int ret;
-
- ret = sss_parse_name(memctx, snctx, orig,
- (_domain == NULL) ? NULL : &domain,
- (_name == NULL) ? NULL : &name);
- if (ret == EOK) {
- if (_domain != NULL) {
- *_domain = domain;
- }
-
- if (_name != NULL) {
- *_name = name;
- }
- }
-
- return ret;
-}
-
static struct sss_domain_info * match_any_domain_or_subdomain_name(
struct sss_domain_info *dom,
const char *dmatch)
@@ -641,41 +617,6 @@ sss_fqname(char *str, size_t size, struct sss_names_ctx *nctx,
name, domain->name, calc_flat_name (domain), NULL);
}
-char *
-sss_get_domain_name(TALLOC_CTX *mem_ctx,
- const char *orig_name,
- struct sss_domain_info *dom)
-{
- char *user_name;
- char *domain = NULL;
- int ret;
-
- /* check if the name already contains domain part */
- if (dom->names != NULL) {
- ret = sss_parse_name(mem_ctx, dom->names, orig_name, &domain, NULL);
- if (ret == ERR_REGEX_NOMATCH) {
- DEBUG(SSSDBG_TRACE_FUNC,
- "sss_parse_name could not parse domain from [%s]. "
- "Assuming it is not FQDN.\n", orig_name);
- } else if (ret != EOK) {
- DEBUG(SSSDBG_TRACE_FUNC,
- "sss_parse_name failed [%d]: %s\n", ret, sss_strerror(ret));
- return NULL;
- }
- }
-
- if (IS_SUBDOMAIN(dom) && dom->fqnames && domain == NULL) {
- /* we always use the fully qualified name for subdomain users */
- user_name = sss_tc_fqname(mem_ctx, dom->names, dom, orig_name);
- } else {
- user_name = talloc_strdup(mem_ctx, orig_name);
- }
-
- talloc_free(domain);
-
- return user_name;
-}
-
errno_t sss_user_by_name_or_uid(const char *input, uid_t *_uid, gid_t *_gid)
{
uid_t uid;
diff --git a/src/util/util.h b/src/util/util.h
index 3ed8444b5..8a5caa52c 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -221,10 +221,6 @@ int sss_parse_name(TALLOC_CTX *memctx,
struct sss_names_ctx *snctx,
const char *orig, char **_domain, char **_name);
-int sss_parse_name_const(TALLOC_CTX *memctx,
- struct sss_names_ctx *snctx, const char *orig,
- const char **_domain, const char **_name);
-
int sss_parse_name_for_domains(TALLOC_CTX *memctx,
struct sss_domain_info *domains,
const char *default_domain,
@@ -265,12 +261,6 @@ int
sss_fqname(char *str, size_t size, struct sss_names_ctx *nctx,
struct sss_domain_info *domain, const char *name);
-/* Subdomains use fully qualified names in the cache while primary domains use
- * just the name. Return either of these for a specified domain or subdomain
- */
-char *
-sss_get_domain_name(TALLOC_CTX *mem_ctx, const char *orig_name,
- struct sss_domain_info *dom);
/* Accepts fqname in the format shortname@domname only. */
errno_t sss_parse_internal_fqname(TALLOC_CTX *mem_ctx,
@@ -559,9 +549,6 @@ errno_t get_dom_names(TALLOC_CTX *mem_ctx,
char ***_dom_names,
int *_dom_names_count);
-errno_t fix_domain_in_name_list(TALLOC_CTX *mem_ctx,
- struct sss_domain_info *dom,
- char **in, char ***_out);
/* from util_lock.c */
errno_t sss_br_lock_file(int fd, size_t start, size_t len,
int num_tries, useconds_t wait);