git.samba.org
/
jelmer
/
samba4-debian.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b7bcc49
)
r26360: Add some const.
author
Jelmer Vernooij
<jelmer@samba.org>
Mon, 10 Dec 2007 03:33:39 +0000
(
04:33
+0100)
committer
Stefan Metzmacher
<metze@samba.org>
Fri, 21 Dec 2007 04:49:03 +0000
(
05:49
+0100)
source/auth/auth_anonymous.c
patch
|
blob
|
history
source/auth/auth_developer.c
patch
|
blob
|
history
source/auth/ntlm_check.c
patch
|
blob
|
history
source/client/client.c
patch
|
blob
|
history
source/dsdb/samdb/ldb_modules/partition.c
patch
|
blob
|
history
diff --git
a/source/auth/auth_anonymous.c
b/source/auth/auth_anonymous.c
index 2dd0be5a0485fdfa5a78676388486b289d4acdd8..bcab918347518956136e0caf60608f9b629f9c40 100644
(file)
--- a/
source/auth/auth_anonymous.c
+++ b/
source/auth/auth_anonymous.c
@@
-56,7
+56,7
@@
static NTSTATUS anonymous_check_password(struct auth_method_context *ctx,
return auth_anonymous_server_info(mem_ctx, lp_netbios_name(ctx->auth_ctx->lp_ctx), _server_info);
}
return auth_anonymous_server_info(mem_ctx, lp_netbios_name(ctx->auth_ctx->lp_ctx), _server_info);
}
-static struct auth_operations anonymous_auth_ops = {
+static
const
struct auth_operations anonymous_auth_ops = {
.name = "anonymous",
.get_challenge = auth_get_challenge_not_implemented,
.want_check = anonymous_want_check,
.name = "anonymous",
.get_challenge = auth_get_challenge_not_implemented,
.want_check = anonymous_want_check,
diff --git
a/source/auth/auth_developer.c
b/source/auth/auth_developer.c
index cc5e79631f4c35997a4332a44858ba8f14dbc9de..57eb752ac8708d0cf11daf90f1dac253a169d5f9 100644
(file)
--- a/
source/auth/auth_developer.c
+++ b/
source/auth/auth_developer.c
@@
-129,7
+129,7
@@
static NTSTATUS name_to_ntstatus_check_password(struct auth_method_context *ctx,
return nt_status;
}
return nt_status;
}
-static struct auth_operations name_to_ntstatus_auth_ops = {
+static
const
struct auth_operations name_to_ntstatus_auth_ops = {
.name = "name_to_ntstatus",
.get_challenge = auth_get_challenge_not_implemented,
.want_check = name_to_ntstatus_want_check,
.name = "name_to_ntstatus",
.get_challenge = auth_get_challenge_not_implemented,
.want_check = name_to_ntstatus_want_check,
@@
-179,7
+179,7
@@
static NTSTATUS fixed_challenge_check_password(struct auth_method_context *ctx,
return NT_STATUS_NO_SUCH_USER;
}
return NT_STATUS_NO_SUCH_USER;
}
-static struct auth_operations fixed_challenge_auth_ops = {
+static
const
struct auth_operations fixed_challenge_auth_ops = {
.name = "fixed_challenge",
.get_challenge = fixed_challenge_get_challenge,
.want_check = fixed_challenge_want_check,
.name = "fixed_challenge",
.get_challenge = fixed_challenge_get_challenge,
.want_check = fixed_challenge_want_check,
diff --git
a/source/auth/ntlm_check.c
b/source/auth/ntlm_check.c
index b98ce50cf68b6f1d804f09c6399a9763f9c83ed8..a0846f00deccff5b4b989e95ed9ac9cf6829acc3 100644
(file)
--- a/
source/auth/ntlm_check.c
+++ b/
source/auth/ntlm_check.c
@@
-295,7
+295,7
@@
NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
DATA_BLOB *user_sess_key,
DATA_BLOB *lm_sess_key)
{
DATA_BLOB *user_sess_key,
DATA_BLOB *lm_sess_key)
{
-
static const
uint8_t zeros[8];
+
const static
uint8_t zeros[8];
DATA_BLOB tmp_sess_key;
if (stored_nt == NULL) {
DATA_BLOB tmp_sess_key;
if (stored_nt == NULL) {
diff --git
a/source/client/client.c
b/source/client/client.c
index 9e031cd09ec1a0918cf66448520e60b805ab4a40..43135e13ea69b02ff6fe14801f38e3cbf71c1b16 100644
(file)
--- a/
source/client/client.c
+++ b/
source/client/client.c
@@
-51,8
+51,6
@@
#include "librpc/gen_ndr/ndr_nbt.h"
#include "param/param.h"
#include "librpc/gen_ndr/ndr_nbt.h"
#include "param/param.h"
-static int io_bufsize = 64512;
-
struct smbclient_context {
char *remote_cur_dir;
struct smbcli_state *cli;
struct smbclient_context {
char *remote_cur_dir;
struct smbcli_state *cli;
@@
-64,6
+62,7
@@
struct smbclient_context {
bool lowercase;
int printmode;
bool translation;
bool lowercase;
int printmode;
bool translation;
+ int io_bufsize;
};
/* timing globals */
};
/* timing globals */
@@
-680,7
+679,7
@@
static int do_get(struct smbclient_context *ctx, char *rname, const char *lname,
bool newhandle = false;
uint8_t *data;
struct timeval tp_start;
bool newhandle = false;
uint8_t *data;
struct timeval tp_start;
- int read_size = io_bufsize;
+ int read_size =
ctx->
io_bufsize;
uint16_t attr;
size_t size;
off_t start = 0;
uint16_t attr;
size_t size;
off_t start = 0;
@@
-1074,7
+1073,7
@@
static int do_put(struct smbclient_context *ctx, char *rname, char *lname, bool
size_t start = 0;
off_t nread = 0;
uint8_t *buf = NULL;
size_t start = 0;
off_t nread = 0;
uint8_t *buf = NULL;
- int maxwrite = io_bufsize;
+ int maxwrite =
ctx->
io_bufsize;
int rc = 0;
struct timeval tp_start;
int rc = 0;
struct timeval tp_start;
@@
-3017,17
+3016,12
@@
static int process_stdin(struct smbclient_context *ctx)
/*****************************************************
return a connection to a server
*******************************************************/
/*****************************************************
return a connection to a server
*******************************************************/
-static
struct smbclient_context *do_connect(TALLOC_CTX *mem_ctx,
+static
bool do_connect(struct smbclient_context *ctx,
const char *specified_server, const char *specified_share, struct cli_credentials *cred)
{
NTSTATUS status;
const char *specified_server, const char *specified_share, struct cli_credentials *cred)
{
NTSTATUS status;
- struct smbclient_context *ctx = talloc_zero(mem_ctx, struct smbclient_context);
char *server, *share;
char *server, *share;
- if (!ctx) {
- return NULL;
- }
-
rl_ctx = ctx; /* Ugly hack */
if (strncmp(specified_share, "\\\\", 2) == 0 ||
rl_ctx = ctx; /* Ugly hack */
if (strncmp(specified_share, "\\\\", 2) == 0 ||
@@
-3148,6
+3142,9
@@
static int do_message_op(const char *netbios_name, const char *desthost, const c
exit(1);
}
exit(1);
}
+ ctx = talloc(mem_ctx, struct smbclient_context);
+ ctx->io_bufsize = 64512;
+
pc = poptGetContext("smbclient", argc, (const char **) argv, long_options, 0);
poptSetOtherOptionHelp(pc, "[OPTIONS] service <password>");
pc = poptGetContext("smbclient", argc, (const char **) argv, long_options, 0);
poptSetOtherOptionHelp(pc, "[OPTIONS] service <password>");
@@
-3176,7
+3173,7
@@
static int do_message_op(const char *netbios_name, const char *desthost, const c
base_directory = strdup(poptGetOptArg(pc));
break;
case 'b':
base_directory = strdup(poptGetOptArg(pc));
break;
case 'b':
- io_bufsize = MAX(1, atoi(poptGetOptArg(pc)));
+
ctx->
io_bufsize = MAX(1, atoi(poptGetOptArg(pc)));
break;
}
}
break;
}
}
@@
-3227,9
+3224,7
@@
static int do_message_op(const char *netbios_name, const char *desthost, const c
return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, dest_ip, name_type, lp_name_resolve_order(cmdline_lp_ctx), lp_max_xmit(cmdline_lp_ctx), lp_maxmux(cmdline_lp_ctx));
}
return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, dest_ip, name_type, lp_name_resolve_order(cmdline_lp_ctx), lp_max_xmit(cmdline_lp_ctx), lp_maxmux(cmdline_lp_ctx));
}
-
- ctx = do_connect(mem_ctx, desthost, service, cmdline_credentials);
- if (!ctx)
+ if (!do_connect(ctx, desthost, service, cmdline_credentials))
return 1;
if (base_directory)
return 1;
if (base_directory)
diff --git
a/source/dsdb/samdb/ldb_modules/partition.c
b/source/dsdb/samdb/ldb_modules/partition.c
index f40cf5ef42e0ad0b8b3e004cf61c207a56e6c659..bf4421ab0d53cb87fdd394540eb95729b9e7723e 100644
(file)
--- a/
source/dsdb/samdb/ldb_modules/partition.c
+++ b/
source/dsdb/samdb/ldb_modules/partition.c
@@
-711,7
+711,7
@@
static int partition_init(struct ldb_module *module)
{
int ret, i;
TALLOC_CTX *mem_ctx = talloc_new(module);
{
int ret, i;
TALLOC_CTX *mem_ctx = talloc_new(module);
-
static
const char *attrs[] = { "partition", "replicateEntries", "modules", NULL };
+ const char *attrs[] = { "partition", "replicateEntries", "modules", NULL };
struct ldb_result *res;
struct ldb_message *msg;
struct ldb_message_element *partition_attributes;
struct ldb_result *res;
struct ldb_message *msg;
struct ldb_message_element *partition_attributes;