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"
-/*
- * Globals...
- */
-
-extern BOOL in_client; /* Boolean for client library */
-
-
/*
* Local functions...
*/
FILE *fp; /* File to print */
int status=0; /* Status of LPD job */
struct smbcli_state *cli; /* SMB interface */
+ struct loadparm_context *lp_ctx;
/* we expect the URI in argv[0]. Detect the case where it is in argv[1] and cope */
if (argc > 2 && strncmp(argv[0],"smb://", 6) && !strncmp(argv[1],"smb://", 6)) {
* Setup the SAMBA server state...
*/
- setup_logging("smbspool", DEBUG_STDOUT);
+ setup_logging(argv[0], DEBUG_STDOUT);
- in_client = True; /* Make sure that we tell lp_load we are */
-
- if (!lp_load(dyn_CONFIGFILE, True, False, False))
- {
- fprintf(stderr, "ERROR: Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
- return (1);
+ if (!lp_load(talloc_autofree_context(), dyn_CONFIGFILE, &lp_ctx)) {
+ fprintf(stderr, "ERROR: Can't load %s - run testparm to debug it\n", lp_config_file());
+ return (1);
}
if (workgroup == NULL)
- workgroup = lp_workgroup();
-
- load_interfaces();
+ workgroup = lp_workgroup(lp_ctx);
do
{
if ((status = smb_print(cli, argv[3] /* title */, fp)) != 0)
break;
- smbcli_shutdown(cli);
+ talloc_free(cli);
/*
* Return the queue status...
myname = get_myname();
- nt_status = smbcli_full_connection(&c, myname, server, NULL, 0, share, "?????",
- username, workgroup, password, 0, NULL);
+ nt_status = smbcli_full_connection(NULL, &c, myname, server, 0, share, NULL,
+ username, workgroup, password, NULL);
free(myname);
if (!NT_STATUS_IS_OK(nt_status)) {