summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-09-19 09:44:12 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-09-19 09:44:12 +0000
commit6794b58a8c5941ede29e07247bda911328cd7b20 (patch)
treec57ea30d76a3b5d3c08cde0785ce42a86e873439 /source3/smbd
parentebe02a7e8743e413113562150f40e7db3d2d378c (diff)
downloadsamba-6794b58a8c5941ede29e07247bda911328cd7b20.tar.gz
samba-6794b58a8c5941ede29e07247bda911328cd7b20.tar.bz2
samba-6794b58a8c5941ede29e07247bda911328cd7b20.zip
Add the ability to display Samba's build options with smbd -b and as a level 4
DEBUG(). Also included are details like build date/time, location and compiler. This should get most of the options we set, except those that don't affect smbd, like WITH_PAM_SMBPASSWD or WITH_WINBINDD. This work due to Vance Lankhaar <vlankhaar@hotmail.com> Some work needs to be done to make it only rebuild when needed (ie smbd being rebuilt) but its in pretty good shape already. Also fix up some printf() -> d_printf(). Andrew Bartlett (This used to be commit beff1d2beaf4337dba6bfc372c5e09a43cfd791a)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/server.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 4ee39a2406..1e89bbab7e 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -560,23 +560,23 @@ usage on the program
static void usage(char *pname)
{
- printf("Usage: %s [-DaoPh?V] [-d debuglevel] [-l log basename] [-p port]\n", pname);
- printf(" [-O socket options] [-s services file]\n");
- printf("\t-D Become a daemon\n");
- printf("\t-a Append to log file (default)\n");
- printf("\t-o Overwrite log file, don't append\n");
- printf("\t-h Print usage\n");
- printf("\t-? Print usage\n");
- printf("\t-V Print version\n");
- printf("\t-d debuglevel Set the debuglevel\n");
- printf("\t-l log basename. Basename for log/debug files\n");
- printf("\t-p port Listen on the specified port\n");
- printf("\t-O socket options Socket options\n");
- printf("\t-s services file. Filename of services file\n");
- printf("\n");
+ d_printf("Usage: %s [-DaoPh?Vb] [-d debuglevel] [-l log basename] [-p port]\n", pname);
+ d_printf(" [-O socket options] [-s services file]\n");
+ d_printf("\t-D Become a daemon\n");
+ d_printf("\t-a Append to log file (default)\n");
+ d_printf("\t-o Overwrite log file, don't append\n");
+ d_printf("\t-h Print usage\n");
+ d_printf("\t-? Print usage\n");
+ d_printf("\t-V Print version\n");
+ d_printf("\t-b Print build options\n");
+ d_printf("\t-d debuglevel Set the debuglevel\n");
+ d_printf("\t-l log basename. Basename for log/debug files\n");
+ d_printf("\t-p port Listen on the specified port\n");
+ d_printf("\t-O socket options Socket options\n");
+ d_printf("\t-s services file. Filename of services file\n");
+ d_printf("\n");
}
-
/****************************************************************************
main program
****************************************************************************/
@@ -600,7 +600,7 @@ static void usage(char *pname)
argc--;
}
- while ( EOF != (opt = getopt(argc, argv, "O:l:s:d:Dp:h?Vaof:")) )
+ while ( EOF != (opt = getopt(argc, argv, "O:l:s:d:Dp:h?bVaof:")) )
switch (opt) {
case 'O':
pstrcpy(user_socket_options,optarg);
@@ -648,6 +648,10 @@ static void usage(char *pname)
d_printf("Version %s\n",VERSION);
exit(0);
break;
+ case 'b':
+ build_options(True); /* Display output to screen as well as debug */
+ exit(0);
+ break;
default:
DEBUG(0,("Incorrect program usage - are you sure the command line is correct?\n"));
usage(argv[0]);
@@ -718,6 +722,9 @@ static void usage(char *pname)
DEBUG(2,("uid=%d gid=%d euid=%d egid=%d\n",
(int)getuid(),(int)getgid(),(int)geteuid(),(int)getegid()));
+ /* Output the build options to the debug log */
+ build_options(False);
+
if (sizeof(uint16) < 2 || sizeof(uint32) < 4) {
DEBUG(0,("ERROR: Samba is not configured correctly for the word size on your machine\n"));
exit(1);