/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2015 Red Hat
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 <talloc.h>
#include <stdlib.h>
#include <string.h>
#include <popt.h>
#include "config.h"
#include "confdb/confdb_setup.h"
#include "tools/common/sss_tools.h"
struct sss_cmdline {
const char **argv;
};
{
_("The debug level to run with"));
_("Show this for a command"));
_("Show brief usage message for a command"));
}
{
};
return common_opts;
}
{
int opt;
0, _("The debug level to run with"), NULL },
};
/* do nothing */
}
/* Strip common options from arguments. We will discard_const here,
* since it is not worth the trouble to convert it back and forth. */
}
struct confdb_ctx **_confdb)
{
char *path;
return ENOMEM;
}
&confdb);
return ret;
}
}
return EOK;
}
struct confdb_ctx *confdb,
struct sss_domain_info **_domains)
{
return ret;
}
"Could not initialize connection to the sysdb\n");
return ret;
}
if (!IS_SUBDOMAIN(dom)) {
/* Get flat name and domain ID (SID) from the cache
* if available */
}
/* Update list of subdomains for this domain */
"Failed to update subdomains for domain %s.\n",
}
}
}
return ret;
}
}
return ret;
}
struct sss_tool_ctx **_tool_ctx)
{
return ENOMEM;
}
return EOK;
}
{
return true;
}
return false;
}
{
return true;
}
}
{
int i;
if (sss_tool_is_delimiter(&commands[i])) {
continue;
}
}
}
return max;
}
{
int min_len;
int i;
if (sss_tool_is_delimiter(&commands[i])) {
continue;
}
} else {
}
}
}
struct sss_route_cmd *command)
{
int ret;
return EOK;
}
/* Connect to confdb. */
goto done;
}
/* Setup domains. */
goto done;
}
goto done;
}
done:
return ret;
}
struct sss_tool_ctx *tool_ctx,
struct sss_route_cmd *commands,
void *pvt)
{
const char *cmd;
int i;
int ret;
return EINVAL;
}
if (argc < 2) {
return EINVAL;
}
if (sss_tool_is_delimiter(&commands[i])) {
continue;
}
"Command %s does not handle initialization error [%d] %s\n",
}
"Command initialization failed [%d] %s\n",
return ret;
}
}
}
return EINVAL;
}
{
};
return empty;
}
return options;
}
struct poptOption *options,
enum sss_tool_opt require_option,
void *popt_fn_pvt,
const char *fopt_name,
const char *fopt_help,
const char **_fopt,
bool *_opt_set)
{
0, _("Command options:"), NULL },
0, _("Common options:"), NULL },
};
const char *fopt;
char *help;
bool opt_set;
int ret;
/* Create help option string. We always need to append command name since
* we use POPT_CONTEXT_KEEP_FIRST. */
} else {
}
return ENOMEM;
}
/* Create popt context. This function is supposed to be called on
* command argv which does not contain executable (argv[0]), therefore
* we need to use KEEP_FIRST that ensures argv[0] is also processed. */
/* Parse options. Invoke custom function if provided. If no parsing
* function is provided, print error on unknown option. */
goto done;
}
} else {
goto done;
}
}
/* Parse free option which is always required if requested. */
goto done;
}
/* No more arguments expected. If something follows it is an error. */
if (poptGetArg(pc)) {
goto done;
}
/* Unexpected free argument. */
goto done;
}
opt_set = true;
opt_set = false;
/* If at least one option is required and not provided, print error. */
if (require_option == SSS_TOOL_OPT_REQUIRED) {
goto done;
}
}
}
done:
return ret;
}
struct poptOption *options,
enum sss_tool_opt require_option,
void *popt_fn_pvt)
{
}
struct sss_route_cmd *commands,
void *pvt)
{
if (uid != 0) {
return EXIT_FAILURE;
}
if (ret == ERR_SYSDB_VERSION_TOO_OLD) {
return EXIT_FAILURE;
}
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
struct sss_tool_ctx *tool_ctx,
const char *input,
const char **_username,
struct sss_domain_info **_domain)
{
int ret;
"be a subdomain that was not yet found.\n");
goto done;
goto done;
}
done:
}
return ret;
}