summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-06-24 20:25:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:58:00 -0500
commit19ca97a70f6b7b41d251eaa76e4d3c980c6eedff (patch)
tree18d7d81e2c1aa7cf9325899b7e8fc90b41c14c8b /source3/libsmb
parent8387af752f81e26f1c141f6053bf6d106f0af5eb (diff)
downloadsamba-19ca97a70f6b7b41d251eaa76e4d3c980c6eedff.tar.gz
r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us from using C++ reserved keywords in our code. Jeremy (This used to be commit 9506b8e145982b1160a2f0aee5c9b7a54980940a)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clierror.c4
-rw-r--r--source3/libsmb/libsmb_cache.c4
-rw-r--r--source3/libsmb/libsmbclient.c6
-rw-r--r--source3/libsmb/namequery.c12
-rw-r--r--source3/libsmb/smberr.c34
-rw-r--r--source3/libsmb/spnego.c2
6 files changed, 31 insertions, 31 deletions
diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c
index ec0ca53a853..a16c1f52419 100644
--- a/source3/libsmb/clierror.c
+++ b/source3/libsmb/clierror.c
@@ -153,9 +153,9 @@ NTSTATUS cli_nt_error(struct cli_state *cli)
int flgs2 = SVAL(cli->inbuf,smb_flg2);
if (!(flgs2 & FLAGS2_32_BIT_ERROR_CODES)) {
- int class = CVAL(cli->inbuf,smb_rcls);
+ int e_class = CVAL(cli->inbuf,smb_rcls);
int code = SVAL(cli->inbuf,smb_err);
- return dos_to_ntstatus(class, code);
+ return dos_to_ntstatus(e_class, code);
}
return NT_STATUS(IVAL(cli->inbuf,smb_rcls));
diff --git a/source3/libsmb/libsmb_cache.c b/source3/libsmb/libsmb_cache.c
index de9a1656d84..e6033faf50f 100644
--- a/source3/libsmb/libsmb_cache.c
+++ b/source3/libsmb/libsmb_cache.c
@@ -46,7 +46,7 @@ struct smbc_server_cache {
* Add a new connection to the server cache.
* This function is only used if the external cache is not enabled
*/
-static int smbc_add_cached_server(SMBCCTX * context, SMBCSRV * new,
+static int smbc_add_cached_server(SMBCCTX * context, SMBCSRV * newsrv,
const char * server, const char * share,
const char * workgroup, const char * username)
{
@@ -60,7 +60,7 @@ static int smbc_add_cached_server(SMBCCTX * context, SMBCSRV * new,
ZERO_STRUCTP(srvcache);
- srvcache->server = new;
+ srvcache->server = newsrv;
srvcache->server_name = SMB_STRDUP(server);
if (!srvcache->server_name) {
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index dac30b934e1..1823bb2ace8 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -3305,7 +3305,7 @@ static BOOL parse_ace(struct cli_state *ipc_cli,
/* add an ACE to a list of ACEs in a SEC_ACL */
static BOOL add_ace(SEC_ACL **the_acl, SEC_ACE *ace, TALLOC_CTX *ctx)
{
- SEC_ACL *new;
+ SEC_ACL *newacl;
SEC_ACE *aces;
if (! *the_acl) {
(*the_acl) = make_sec_acl(ctx, 3, 1, ace);
@@ -3315,9 +3315,9 @@ static BOOL add_ace(SEC_ACL **the_acl, SEC_ACE *ace, TALLOC_CTX *ctx)
aces = SMB_CALLOC_ARRAY(SEC_ACE, 1+(*the_acl)->num_aces);
memcpy(aces, (*the_acl)->ace, (*the_acl)->num_aces * sizeof(SEC_ACE));
memcpy(aces+(*the_acl)->num_aces, ace, sizeof(SEC_ACE));
- new = make_sec_acl(ctx,(*the_acl)->revision,1+(*the_acl)->num_aces, aces);
+ newacl = make_sec_acl(ctx,(*the_acl)->revision,1+(*the_acl)->num_aces, aces);
SAFE_FREE(aces);
- (*the_acl) = new;
+ (*the_acl) = newacl;
return True;
}
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index e6868fb3730..28b89db9087 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -45,9 +45,9 @@ static int generate_trn_id(void)
Parse a node status response into an array of structures.
****************************************************************************/
-static struct node_status *parse_node_status(char *p, int *num_names, struct node_status_extra *extra)
+static NODE_STATUS_STRUCT *parse_node_status(char *p, int *num_names, struct node_status_extra *extra)
{
- struct node_status *ret;
+ NODE_STATUS_STRUCT *ret;
int i;
*num_names = CVAL(p,0);
@@ -55,7 +55,7 @@ static struct node_status *parse_node_status(char *p, int *num_names, struct nod
if (*num_names == 0)
return NULL;
- ret = SMB_MALLOC_ARRAY(struct node_status,*num_names);
+ ret = SMB_MALLOC_ARRAY(NODE_STATUS_STRUCT,*num_names);
if (!ret)
return NULL;
@@ -84,7 +84,7 @@ static struct node_status *parse_node_status(char *p, int *num_names, struct nod
structures holding the returned names or NULL if the query failed.
**************************************************************************/
-struct node_status *node_status_query(int fd,struct nmb_name *name,
+NODE_STATUS_STRUCT *node_status_query(int fd,struct nmb_name *name,
struct in_addr to_ip, int *num_names,
struct node_status_extra *extra)
{
@@ -95,7 +95,7 @@ struct node_status *node_status_query(int fd,struct nmb_name *name,
struct packet_struct p;
struct packet_struct *p2;
struct nmb_packet *nmb = &p.packet.nmb;
- struct node_status *ret;
+ NODE_STATUS_STRUCT *ret;
ZERO_STRUCT(p);
@@ -173,7 +173,7 @@ struct node_status *node_status_query(int fd,struct nmb_name *name,
BOOL name_status_find(const char *q_name, int q_type, int type, struct in_addr to_ip, fstring name)
{
- struct node_status *status = NULL;
+ NODE_STATUS_STRUCT *status = NULL;
struct nmb_name nname;
int count, i;
int sock;
diff --git a/source3/libsmb/smberr.c b/source3/libsmb/smberr.c
index 82efbdb6898..b014fb947e3 100644
--- a/source3/libsmb/smberr.c
+++ b/source3/libsmb/smberr.c
@@ -142,7 +142,7 @@ err_code_struct hard_msgs[] = {
const struct
{
int code;
- const char *class;
+ const char *e_class;
err_code_struct *err_msgs;
} err_classes[] = {
{0,"SUCCESS",NULL},
@@ -160,13 +160,13 @@ const struct
/****************************************************************************
return a SMB error name from a class and code
****************************************************************************/
-const char *smb_dos_err_name(uint8 class, uint16 num)
+const char *smb_dos_err_name(uint8 e_class, uint16 num)
{
static pstring ret;
int i,j;
- for (i=0;err_classes[i].class;i++)
- if (err_classes[i].code == class) {
+ for (i=0;err_classes[i].e_class;i++)
+ if (err_classes[i].code == e_class) {
if (err_classes[i].err_msgs) {
err_code_struct *err = err_classes[i].err_msgs;
for (j=0;err[j].name;j++)
@@ -178,7 +178,7 @@ const char *smb_dos_err_name(uint8 class, uint16 num)
return ret;
}
- slprintf(ret, sizeof(ret) - 1, "Error: Unknown error class (%d,%d)",class,num);
+ slprintf(ret, sizeof(ret) - 1, "Error: Unknown error class (%d,%d)",e_class,num);
return(ret);
}
@@ -196,18 +196,18 @@ const char *get_dos_error_msg(WERROR result)
/****************************************************************************
return a SMB error class name as a string.
****************************************************************************/
-const char *smb_dos_err_class(uint8 class)
+const char *smb_dos_err_class(uint8 e_class)
{
static pstring ret;
int i;
- for (i=0;err_classes[i].class;i++) {
- if (err_classes[i].code == class) {
- return err_classes[i].class;
+ for (i=0;err_classes[i].e_class;i++) {
+ if (err_classes[i].code == e_class) {
+ return err_classes[i].e_class;
}
}
- slprintf(ret, sizeof(ret) - 1, "Error: Unknown class (%d)",class);
+ slprintf(ret, sizeof(ret) - 1, "Error: Unknown class (%d)",e_class);
return(ret);
}
@@ -217,32 +217,32 @@ return a SMB string from an SMB buffer
char *smb_dos_errstr(char *inbuf)
{
static pstring ret;
- int class = CVAL(inbuf,smb_rcls);
+ int e_class = CVAL(inbuf,smb_rcls);
int num = SVAL(inbuf,smb_err);
int i,j;
- for (i=0;err_classes[i].class;i++)
- if (err_classes[i].code == class) {
+ for (i=0;err_classes[i].e_class;i++)
+ if (err_classes[i].code == e_class) {
if (err_classes[i].err_msgs) {
err_code_struct *err = err_classes[i].err_msgs;
for (j=0;err[j].name;j++)
if (num == err[j].code) {
if (DEBUGLEVEL > 0)
slprintf(ret, sizeof(ret) - 1, "%s - %s (%s)",
- err_classes[i].class,
+ err_classes[i].e_class,
err[j].name,err[j].message);
else
slprintf(ret, sizeof(ret) - 1, "%s - %s",
- err_classes[i].class,err[j].name);
+ err_classes[i].e_class,err[j].name);
return ret;
}
}
- slprintf(ret, sizeof(ret) - 1, "%s - %d",err_classes[i].class,num);
+ slprintf(ret, sizeof(ret) - 1, "%s - %d",err_classes[i].e_class,num);
return ret;
}
- slprintf(ret, sizeof(ret) - 1, "Error: Unknown error (%d,%d)",class,num);
+ slprintf(ret, sizeof(ret) - 1, "Error: Unknown error (%d,%d)",e_class,num);
return(ret);
}
diff --git a/source3/libsmb/spnego.c b/source3/libsmb/spnego.c
index a0f5565d4f3..2eaec61ed79 100644
--- a/source3/libsmb/spnego.c
+++ b/source3/libsmb/spnego.c
@@ -47,7 +47,7 @@ static BOOL read_negTokenInit(ASN1_DATA *asn1, negTokenInit_t *token)
0 < asn1_tag_remaining(asn1); i++) {
token->mechTypes =
SMB_REALLOC_ARRAY(token->mechTypes, char *, i + 2);
- asn1_read_OID(asn1, token->mechTypes + i);
+ asn1_read_OID(asn1, &token->mechTypes[i]);
}
token->mechTypes[i] = NULL;