This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ 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,
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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
*/
extern pstring user_socket_options;
-extern BOOL AllowDebugChange;
-extern BOOL override_logfile;
+extern bool AllowDebugChange;
+extern bool override_logfile;
struct user_auth_info cmdline_auth_info;
lp_set_logfile(logfile);
}
+static bool PrintSambaVersionString;
+
static void popt_common_callback(poptContext con,
enum poptCallbackReason reason,
const struct poptOption *opt,
return;
}
+ if (reason == POPT_CALLBACK_REASON_POST) {
+ if (!PrintSambaVersionString) return;
+
+ printf( "Version %s\n", SAMBA_VERSION_STRING);
+ exit(0);
+ return;
+ }
+
switch(opt->val) {
case 'd':
if (arg) {
break;
case 'V':
- printf( "Version %s\n", SAMBA_VERSION_STRING);
- exit(0);
+ PrintSambaVersionString = True;
break;
case 'O':
};
struct poptOption popt_common_samba[] = {
- { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE, (void *)popt_common_callback },
+ { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void *)popt_common_callback },
{ "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" },
{ "configfile", 's', POPT_ARG_STRING, NULL, 's', "Use alternate configuration file", "CONFIGFILE" },
{ "log-basename", 'l', POPT_ARG_STRING, NULL, 'l', "Base name for log files", "LOGFILEBASE" },
{
int fd = -1;
char *p;
- BOOL close_it = False;
+ bool close_it = False;
pstring spec;
char pass[128];