b10_resolver_SOURCES = resolver.cc resolver.h
b10_resolver_SOURCES += resolver_log.cc resolver_log.h
b10_resolver_SOURCES += response_scrubber.cc response_scrubber.h
-b10_resolver_SOURCES += $(top_builddir)/src/bin/auth/change_user.h
b10_resolver_SOURCES += $(top_builddir)/src/bin/auth/common.h
b10_resolver_SOURCES += main.cc
b10_resolver_LDADD += $(top_builddir)/src/lib/cache/libcache.la
b10_resolver_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
b10_resolver_LDADD += $(top_builddir)/src/lib/resolve/libresolve.la
-b10_resolver_LDADD += $(top_builddir)/src/bin/auth/change_user.o
b10_resolver_LDFLAGS = -pthread
# TODO: config.h.in is wrong because doesn't honor pkgdatadir
<refsynopsisdiv>
<cmdsynopsis>
<command>b10-resolver</command>
- <arg><option>-u <replaceable>username</replaceable></option></arg>
<arg><option>-v</option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<variablelist>
- <varlistentry>
- <term><option>-u <replaceable>username</replaceable></option></term>
- <listitem>
- <para>
- The user name of the <command>b10-resolver</command> daemon.
- If specified, the daemon changes the process owner to the
- specified user.
- The <replaceable>username</replaceable> must be either a
- valid numeric user ID or a valid user name.
- By default the daemon runs as the user who invokes it.
- </para>
- </listitem>
- </varlistentry>
-
<!-- TODO: this needs to be fixed as -v on command line
should imply stdout or stderr output also -->
<!-- TODO: can this -v be overidden by configuration or bindctl? -->
#include <xfr/xfrout_client.h>
-#include <auth/change_user.h>
#include <auth/common.h>
#include <resolver/spec_config.h>
void
usage() {
cerr << "Usage: b10-resolver [-u user] [-v]" << endl;
- cerr << "\t-u: change process UID to the specified user" << endl;
cerr << "\t-v: verbose output" << endl;
exit(1);
}
main(int argc, char* argv[]) {
bool verbose = false;
int ch;
- const char* uid = NULL;
while ((ch = getopt(argc, argv, "u:v")) != -1) {
switch (ch) {
- case 'u':
- uid = optarg;
- break;
case 'v':
verbose = true;
break;
my_command_handler);
LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIG_CHANNEL);
- // FIXME: This does not belong here, but inside Boss
- if (uid != NULL) {
- changeUser(uid);
- }
-
resolver->setConfigSession(config_session);
// Install all initial configurations. If loading configuration
// fails, it will be logged, but we start the server anyway, giving