/* Unix SMB/CIFS implementation. Test validity of smb.conf Copyright (C) Karl Auer 1993, 1994-1998 Extensively modified by Andrew Tridgell, 1995 Converted to popt by Jelmer Vernooij (jelmer@nl.linux.org), 2002 Updated for Samba4 by Andrew Bartlett 2006 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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, see . */ /* * Testbed for loadparm.c/params.c * * This module simply loads a specified configuration file and * if successful, dumps it's contents to stdout. Note that the * operation is performed with DEBUGLEVEL at 3. * * Useful for a quick 'syntax check' of a configuration file. * */ #include "includes.h" #include "system/filesys.h" #include "lib/cmdline/popt_common.h" #include "lib/socket/socket.h" #include "param/param.h" #include "param/loadparm.h" /*********************************************** Here we do a set of 'hard coded' checks for bad configuration settings. ************************************************/ static int do_global_checks(struct loadparm_context *lp_ctx) { int ret = 0; if (!directory_exist(lp_lockdir(lp_ctx))) { fprintf(stderr, "ERROR: lock directory %s does not exist\n", lp_lockdir(lp_ctx)); ret = 1; } if (!directory_exist(lp_piddir(lp_ctx))) { fprintf(stderr, "ERROR: pid directory %s does not exist\n", lp_piddir(lp_ctx)); ret = 1; } if (strlen(lp_winbind_separator(lp_ctx)) != 1) { fprintf(stderr,"ERROR: the 'winbind separator' parameter must be a single character.\n"); ret = 1; } if (*lp_winbind_separator(lp_ctx) == '+') { fprintf(stderr,"'winbind separator = +' might cause problems with group membership.\n"); } return ret; } static int do_share_checks(struct loadparm_context *lp_ctx, const char *cname, const char *caddr, bool silent_mode, bool show_defaults, const char *section_name, const char *parameter_name) { int ret = 0; int s; for (s=0;s 12) { fprintf(stderr, "WARNING: You have some share names that are longer than 12 characters.\n" ); fprintf(stderr, "These may not be accessible to some older clients.\n" ); fprintf(stderr, "(Eg. Windows9x, WindowsMe, and not listed in smbclient in Samba 3.0.)\n" ); break; } } for (s=0;s