From 6794b58a8c5941ede29e07247bda911328cd7b20 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 19 Sep 2001 09:44:12 +0000 Subject: 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 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) --- source3/smbd/server.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'source3/smbd') 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); -- cgit