*/
void reopen_logs(void)
{
- char *logfile = lp_logfile();
+ const char *logfile = lp_logfile();
char *fname = NULL;
int old_fd = state.fd;
void smb_panic(const char *why)
{
- char *cmd = lp_panic_action();
+ const char *cmd = lp_panic_action();
int result;
if (cmd && *cmd) {
struct tcon_context *conn = req->conn;
NTSTATUS status;
struct cvfs_private *private;
- char *map_calls;
+ const char *map_calls;
struct fd_event fde;
const char *host, *user, *pass, *domain, *remote_share;
callers without affecting the source string.
********************************************************************/
-static char *lp_string(const char *s)
+static const char *lp_string(const char *s)
{
#if 0 /* until REWRITE done to make thread-safe */
size_t len = s ? strlen(s) : 0;
*/
#define FN_GLOBAL_STRING(fn_name,ptr) \
- char *fn_name(void) {return(lp_string(*(char **)(ptr) ? *(char **)(ptr) : ""));}
+ const char *fn_name(void) {return(lp_string(*(char **)(ptr) ? *(char **)(ptr) : ""));}
#define FN_GLOBAL_CONST_STRING(fn_name,ptr) \
const char *fn_name(void) {return(*(const char **)(ptr) ? *(const char **)(ptr) : "");}
#define FN_GLOBAL_LIST(fn_name,ptr) \
int fn_name(void) {return(*(int *)(ptr));}
#define FN_LOCAL_STRING(fn_name,val) \
- char *fn_name(int i) {return(lp_string((LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val));}
+ const char *fn_name(int i) {return(lp_string((LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val));}
#define FN_LOCAL_CONST_STRING(fn_name,val) \
const char *fn_name(int i) {return (const char *)((LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val);}
#define FN_LOCAL_LIST(fn_name,val) \
/* Parametric option has following syntax: 'Type: option = value' */
/* Returned value is allocated in 'lp_talloc' context */
-char *lp_parm_string(int lookup_service, const char *type, const char *option)
+const char *lp_parm_string(int lookup_service, const char *type, const char *option)
{
const char *value = get_parametrics(lookup_service, type, option);
Auto-load some home services.
***************************************************************************/
-static void lp_add_auto_services(char *str)
+static void lp_add_auto_services(const char *str)
{
return;
}
/*******************************************************************
A useful volume label function.
********************************************************************/
-char *volume_label(int snum)
+const char *volume_label(int snum)
{
- char *ret = lp_volume(snum);
+ const char *ret = lp_volume(snum);
if (!*ret)
return lp_servicename(snum);
return (ret);
void lp_copy_service(int snum, const char *new_name)
{
- char *oldname = lp_servicename(snum);
+ const char *oldname = lp_servicename(snum);
do_section(new_name);
if (snum >= 0) {
snum = lp_servicenumber(new_name);
{
static BOOL got_major = False;
static int major_version = DEFAULT_MAJOR_VERSION;
- char *vers;
+ const char *vers;
char *p;
if (got_major)
{
static BOOL got_minor = False;
static int minor_version = DEFAULT_MINOR_VERSION;
- char *vers;
+ const char *vers;
char *p;
if (got_minor)
my %tmap = (
"BOOL" => "BOOL ",
"CONST_STRING" => "const char *",
- "STRING" => "char *",
+ "STRING" => "const char *",
"INTEGER" => "int ",
"CHAR" => "char ",
"LIST" => "const char **",
struct count_stat {
pid_t mypid;
int curr_connections;
- char *name;
+ const char *name;
BOOL Clear;
};
int iPrinterService;
if ((iPrinterService = lp_servicenumber(PRINTERS_NAME)) >= 0) {
- char *pszTemp;
+ const char *pszTemp;
DEBUG(3,("checking whether %s is a valid printer name...\n", service));
pszTemp = lp_printcapname();
{ return True; }
-BOOL pcap_printername_ok(const char *service, char *foo)
+BOOL pcap_printername_ok(const char *service, const char *foo)
{ return True; }
BOOL namecache_enable(void)
int nbench_line_count = 0;
static int timelimit = 600;
static int warmup;
-static char *loadfile;
+static const char *loadfile;
#define ival(s) strtol(s, NULL, 0)
BOOL correct = True;
extern int torture_nprocs;
struct cli_state *cli;
- char *p;
+ const char *p;
p = lp_parm_string(-1, "torture", "timelimit");
if (p && *p) {
TALLOC_CTX *mem_ctx;
BOOL ret = True;
int i;
- char *binding = lp_parm_string(-1, "torture", "binding");
+ const char *binding = lp_parm_string(-1, "torture", "binding");
struct dcerpc_binding b;
mem_ctx = talloc_init("torture_rpc_mgmt");
TALLOC_CTX *mem_ctx;
BOOL ret = True;
int i;
- char *binding = lp_parm_string(-1, "torture", "binding");
+ const char *binding = lp_parm_string(-1, "torture", "binding");
struct dcerpc_binding b;
mem_ctx = talloc_init("torture_rpc_scanner");
void *join_ctx;
const char *machine_password;
NTSTATUS status;
- char *binding = lp_parm_string(-1, "torture", "binding");
+ const char *binding = lp_parm_string(-1, "torture", "binding");
struct dcerpc_binding b;
struct dcerpc_pipe *p;
}
static BOOL test_CreateKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- struct policy_handle *handle, char *name, const char *class)
+ struct policy_handle *handle, const char *name,
+ const char *class)
{
struct winreg_CreateKey r;
struct policy_handle newhandle;
struct nmb_name called, calling;
struct in_addr ip;
struct cli_state *cli;
- char *host = lp_parm_string(-1, "torture", "host");
+ const char *host = lp_parm_string(-1, "torture", "host");
make_nmb_name(&calling, lp_netbios_name(), 0x0);
make_nmb_name(&called , host, 0x20);
BOOL retry;
int flags = 0;
NTSTATUS status;
- char *username = lp_parm_string(-1, "torture", "username");
- char *password = lp_parm_string(-1, "torture", "password");
+ const char *username = lp_parm_string(-1, "torture", "username");
+ const char *password = lp_parm_string(-1, "torture", "password");
if (use_kerberos)
flags |= CLI_FULL_CONNECTION_USE_KERBEROS;
BOOL torture_open_connection(struct cli_state **c)
{
- char *host = lp_parm_string(-1, "torture", "host");
- char *share = lp_parm_string(-1, "torture", "share");
+ const char *host = lp_parm_string(-1, "torture", "host");
+ const char *share = lp_parm_string(-1, "torture", "share");
return torture_open_connection_share(c, host, share);
}
uint32_t pipe_version)
{
NTSTATUS status;
- char *binding = lp_parm_string(-1, "torture", "binding");
+ const char *binding = lp_parm_string(-1, "torture", "binding");
if (!binding) {
printf("You must specify a ncacn binding string\n");
char buf[4];
BOOL ret = True;
struct cli_tree *tree1;
- char *host = lp_parm_string(-1, "torture", "host");
- char *share = lp_parm_string(-1, "torture", "share");
- char *password = lp_parm_string(-1, "torture", "password");
+ const char *host = lp_parm_string(-1, "torture", "host");
+ const char *share = lp_parm_string(-1, "torture", "share");
+ const char *password = lp_parm_string(-1, "torture", "password");
if (!torture_open_connection(&cli)) {
return False;
{
BOOL status;
BOOL ret;
- char *password = lp_parm_string(-1, "torture", "password");
+ const char *password = lp_parm_string(-1, "torture", "password");
status = NT_STATUS_IS_OK(cli_send_tconX(cli, myshare, devtype,
password));
int flags = 0;
NTSTATUS status;
BOOL ret = True;
- char *host = lp_parm_string(-1, "torture", "host");
- char *share = lp_parm_string(-1, "torture", "share");
- char *username = lp_parm_string(-1, "torture", "username");
- char *password = lp_parm_string(-1, "torture", "password");
+ const char *host = lp_parm_string(-1, "torture", "host");
+ const char *share = lp_parm_string(-1, "torture", "share");
+ const char *username = lp_parm_string(-1, "torture", "username");
+ const char *password = lp_parm_string(-1, "torture", "password");
status = cli_full_connection(&cli1, lp_netbios_name(),
host, NULL,
static BOOL run_deferopen(struct cli_state *cli, int dummy)
{
- char *fname = "\\defer_open_test.dat";
+ const char *fname = "\\defer_open_test.dat";
int retries=4;
int i = 0;
BOOL correct = True;
int tries = 8;
double start_time_limit = 10 + (torture_nprocs * 1.5);
char **unc_list = NULL;
- char *p;
+ const char *p;
int num_unc_names = 0;
synccount = 0;