1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

cmdline: Remove dynconfig hooks in command line processing

This removes the ability to set paths like the sbindir, bindir, and changes the tool for setting lockdir
statedir etc to be via --option="lock dir=/var/lock".

These were originally added by commit 90a6873b0570f2691ba8d8fd11154c856bdd4415
by James Peach <jpeach@samba.org>

The important use case, qemu, does not use these options, but specifies these directories via an smb.conf.

They are being removed to remove a layer from the loadparm system, now that options
can be specified from the command line.  It will also make it easier to generate the affected
parameters from the XML documentation if this layer of indirection is removed.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Feb 12 16:42:14 CET 2014 on sn-devel-104
This commit is contained in:
Andrew Bartlett 2014-01-08 13:35:34 +13:00 committed by Stefan Metzmacher
parent 276b233c00
commit e02c94d13b
2 changed files with 0 additions and 146 deletions

View File

@ -200,151 +200,6 @@ struct poptOption popt_common_option[] = {
POPT_TABLEEND POPT_TABLEEND
}; };
/* Handle command line options:
* --sbindir
* --bindir
* --lmhostsfile
* --libdir
* --modulesdir
* --shlibext
* --lockdir
* --statedir
* --cachedir
* --piddir
* --smb-passwd-file
* --private-dir
*/
enum dyn_item{
DYN_SBINDIR = 1,
DYN_BINDIR,
DYN_LMHOSTSFILE,
DYN_LIBDIR,
DYN_MODULESDIR,
DYN_SHLIBEXT,
DYN_LOCKDIR,
DYN_STATEDIR,
DYN_CACHEDIR,
DYN_PIDDIR,
DYN_SMB_PASSWD_FILE,
DYN_PRIVATE_DIR,
};
static void popt_dynconfig_callback(poptContext con,
enum poptCallbackReason reason,
const struct poptOption *opt,
const char *arg, const void *data)
{
switch (opt->val) {
case DYN_SBINDIR:
if (arg) {
set_dyn_SBINDIR(arg);
}
break;
case DYN_BINDIR:
if (arg) {
set_dyn_BINDIR(arg);
}
break;
case DYN_LMHOSTSFILE:
if (arg) {
set_dyn_LMHOSTSFILE(arg);
}
break;
case DYN_LIBDIR:
if (arg) {
set_dyn_LIBDIR(arg);
}
break;
case DYN_MODULESDIR:
if (arg) {
set_dyn_MODULESDIR(arg);
}
break;
case DYN_SHLIBEXT:
if (arg) {
set_dyn_SHLIBEXT(arg);
}
break;
case DYN_LOCKDIR:
if (arg) {
set_dyn_LOCKDIR(arg);
}
break;
case DYN_STATEDIR:
if (arg) {
set_dyn_STATEDIR(arg);
}
break;
case DYN_CACHEDIR:
if (arg) {
set_dyn_CACHEDIR(arg);
}
break;
case DYN_PIDDIR:
if (arg) {
set_dyn_PIDDIR(arg);
}
break;
case DYN_SMB_PASSWD_FILE:
if (arg) {
set_dyn_SMB_PASSWD_FILE(arg);
}
break;
case DYN_PRIVATE_DIR:
if (arg) {
set_dyn_PRIVATE_DIR(arg);
}
break;
}
}
const struct poptOption popt_common_dynconfig[] = {
{ NULL, '\0', POPT_ARG_CALLBACK, (void *)popt_dynconfig_callback },
{ "sbindir", '\0' , POPT_ARG_STRING, NULL, DYN_SBINDIR,
"Path to sbin directory", "SBINDIR" },
{ "bindir", '\0' , POPT_ARG_STRING, NULL, DYN_BINDIR,
"Path to bin directory", "BINDIR" },
{ "lmhostsfile", '\0' , POPT_ARG_STRING, NULL, DYN_LMHOSTSFILE,
"Path to lmhosts file", "LMHOSTSFILE" },
{ "libdir", '\0' , POPT_ARG_STRING, NULL, DYN_LIBDIR,
"Path to shared library directory", "LIBDIR" },
{ "modulesdir", '\0' , POPT_ARG_STRING, NULL, DYN_MODULESDIR,
"Path to shared modules directory", "MODULESDIR" },
{ "shlibext", '\0' , POPT_ARG_STRING, NULL, DYN_SHLIBEXT,
"Shared library extension", "SHLIBEXT" },
{ "lockdir", '\0' , POPT_ARG_STRING, NULL, DYN_LOCKDIR,
"Path to lock file directory", "LOCKDIR" },
{ "statedir", '\0' , POPT_ARG_STRING, NULL, DYN_STATEDIR,
"Path to persistent state file directory", "STATEDIR" },
{ "cachedir", '\0' , POPT_ARG_STRING, NULL, DYN_CACHEDIR,
"Path to temporary cache file directory", "CACHEDIR" },
{ "piddir", '\0' , POPT_ARG_STRING, NULL, DYN_PIDDIR,
"Path to PID file directory", "PIDDIR" },
{ "smb-passwd-file", '\0' , POPT_ARG_STRING, NULL, DYN_SMB_PASSWD_FILE,
"Path to smbpasswd file", "SMB_PASSWD_FILE" },
{ "private-dir", '\0' , POPT_ARG_STRING, NULL, DYN_PRIVATE_DIR,
"Path to private data directory", "PRIVATE_DIR" },
POPT_TABLEEND
};
/**************************************************************************** /****************************************************************************
* get a password from a a file or file descriptor * get a password from a a file or file descriptor
* exit on failure * exit on failure

View File

@ -1071,7 +1071,6 @@ extern void build_options(bool screen);
{"port", 'p', POPT_ARG_STRING, &ports, 0, "Listen on the specified ports"}, {"port", 'p', POPT_ARG_STRING, &ports, 0, "Listen on the specified ports"},
{"profiling-level", 'P', POPT_ARG_STRING, &profile_level, 0, "Set profiling level","PROFILE_LEVEL"}, {"profiling-level", 'P', POPT_ARG_STRING, &profile_level, 0, "Set profiling level","PROFILE_LEVEL"},
POPT_COMMON_SAMBA POPT_COMMON_SAMBA
POPT_COMMON_DYNCONFIG
POPT_TABLEEND POPT_TABLEEND
}; };
struct smbd_parent_context *parent = NULL; struct smbd_parent_context *parent = NULL;