int sss_ncache_check_sid(struct sss_nc_ctx *ctx, int ttl, const char *sid) { char *str; int ret; str = talloc_asprintf(ctx, "%s/%s", NC_SID_PREFIX, sid); if (!str) return ENOMEM; ret = sss_ncache_check_str(ctx, str, ttl); talloc_free(str); return ret; }
static int sss_ncache_check_netgr_int(struct sss_nc_ctx *ctx, int ttl, const char *domain, const char *name) { char *str; int ret; if (!name || !*name) return EINVAL; str = talloc_asprintf(ctx, "%s/%s/%s", NC_NETGROUP_PREFIX, domain, name); if (!str) return ENOMEM; ret = sss_ncache_check_str(ctx, str, ttl); talloc_free(str); return ret; }
int sss_ncache_check_gid(struct sss_nc_ctx *ctx, int ttl, struct sss_domain_info *dom, gid_t gid) { char *str; int ret; if (dom != NULL) { str = talloc_asprintf(ctx, "%s/%s/%"SPRIgid, NC_GID_PREFIX, dom->name, gid); } else { str = talloc_asprintf(ctx, "%s/%"SPRIgid, NC_GID_PREFIX, gid); } if (!str) return ENOMEM; ret = sss_ncache_check_str(ctx, str, ttl); talloc_free(str); return ret; }