From e131c94ac1b06cc49b1c25717d3496dba8b0b3df Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 13:42:05 -0700 Subject: More const fixes for compiler warnings from the waf build. --- source3/libsmb/libsmb_xattr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/libsmb/libsmb_xattr.c') diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c index af2c56ad403..f8dd7fdefb9 100644 --- a/source3/libsmb/libsmb_xattr.c +++ b/source3/libsmb/libsmb_xattr.c @@ -567,7 +567,7 @@ dos_attr_query(SMBCCTX *context, } /* Obtain the DOS attributes */ - if (!SMBC_getatr(context, srv, CONST_DISCARD(char *, filename), + if (!SMBC_getatr(context, srv, filename, &mode, &size, &create_time_ts, &access_time_ts, @@ -700,8 +700,8 @@ cacl_get(SMBCCTX *context, SMBCSRV *srv, struct cli_state *ipc_cli, struct policy_handle *pol, - char *filename, - char *attr_name, + const char *filename, + const char *attr_name, char *buf, int bufsize) { @@ -2107,12 +2107,12 @@ SMBC_getxattr_ctx(SMBCCTX *context, StrCaseCmp(name, "system.dos_attr.inode") == 0) { /* Yup. */ - char *filename = (char *) name; + const char *filename = name; ret = cacl_get(context, talloc_tos(), srv, ipc_srv == NULL ? NULL : ipc_srv->cli, &ipc_srv->pol, path, filename, - CONST_DISCARD(char *, value), + discard_const_p(char, value), size); if (ret < 0 && errno == 0) { errno = SMBC_errno(context, srv->cli); @@ -2231,7 +2231,7 @@ SMBC_removexattr_ctx(SMBCCTX *context, /* Yup. */ ret = cacl_set(context, talloc_tos(), srv->cli, ipc_srv->cli, &ipc_srv->pol, path, - CONST_DISCARD(char *, name) + 19, + discard_const_p(char, name) + 19, SMBC_XATTR_MODE_REMOVE, 0); TALLOC_FREE(frame); return ret; -- cgit From 27022587e31769718ab53f4d114e03ac2f205f27 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 May 2011 11:47:43 +0200 Subject: s3-libsmb: move protos to libsmb/proto.h Guenther --- source3/libsmb/libsmb_xattr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/libsmb/libsmb_xattr.c') diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c index f8dd7fdefb9..583179daa0d 100644 --- a/source3/libsmb/libsmb_xattr.c +++ b/source3/libsmb/libsmb_xattr.c @@ -23,6 +23,7 @@ */ #include "includes.h" +#include "libsmb/libsmb.h" #include "libsmbclient.h" #include "libsmb_internal.h" #include "../librpc/gen_ndr/ndr_lsa.h" -- cgit From c615ebed6e3d273a682806b952d543e834e5630d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 13 May 2011 20:21:30 +0200 Subject: s3-lib Replace StrCaseCmp() with strcasecmp_m() strcasecmp_m() never needs to call to talloc, and via next_codepoint() still has an ASCII fast-path bypassing iconv() calls. Andrew Bartlett --- source3/libsmb/libsmb_xattr.c | 120 +++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 60 deletions(-) (limited to 'source3/libsmb/libsmb_xattr.c') diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c index 583179daa0d..22d71571c6a 100644 --- a/source3/libsmb/libsmb_xattr.c +++ b/source3/libsmb/libsmb_xattr.c @@ -822,48 +822,48 @@ cacl_get(SMBCCTX *context, } /* Which exclusion name is this? */ - if (StrCaseCmp(pExclude, + if (strcasecmp_m(pExclude, "nt_sec_desc.revision") == 0) { exclude_nt_revision = True; } - else if (StrCaseCmp(pExclude, + else if (strcasecmp_m(pExclude, "nt_sec_desc.owner") == 0) { exclude_nt_owner = True; } - else if (StrCaseCmp(pExclude, + else if (strcasecmp_m(pExclude, "nt_sec_desc.group") == 0) { exclude_nt_group = True; } - else if (StrCaseCmp(pExclude, + else if (strcasecmp_m(pExclude, "nt_sec_desc.acl") == 0) { exclude_nt_acl = True; } - else if (StrCaseCmp(pExclude, + else if (strcasecmp_m(pExclude, "dos_attr.mode") == 0) { exclude_dos_mode = True; } - else if (StrCaseCmp(pExclude, + else if (strcasecmp_m(pExclude, "dos_attr.size") == 0) { exclude_dos_size = True; } else if (excl_attr_strings.create_time_attr != NULL && - StrCaseCmp(pExclude, + strcasecmp_m(pExclude, excl_attr_strings.change_time_attr) == 0) { exclude_dos_create_time = True; } - else if (StrCaseCmp(pExclude, + else if (strcasecmp_m(pExclude, excl_attr_strings.access_time_attr) == 0) { exclude_dos_access_time = True; } - else if (StrCaseCmp(pExclude, + else if (strcasecmp_m(pExclude, excl_attr_strings.write_time_attr) == 0) { exclude_dos_write_time = True; } - else if (StrCaseCmp(pExclude, + else if (strcasecmp_m(pExclude, excl_attr_strings.change_time_attr) == 0) { exclude_dos_change_time = True; } - else if (StrCaseCmp(pExclude, "dos_attr.inode") == 0) { + else if (strcasecmp_m(pExclude, "dos_attr.inode") == 0) { exclude_dos_inode = True; } else { @@ -933,7 +933,7 @@ cacl_get(SMBCCTX *context, "REVISION:%d", sd->revision); } - } else if (StrCaseCmp(name, "revision") == 0) { + } else if (strcasecmp_m(name, "revision") == 0) { if (determine_size) { p = talloc_asprintf(ctx, "%d", sd->revision); @@ -1086,9 +1086,9 @@ cacl_get(SMBCCTX *context, ace->access_mask); } } else if ((StrnCaseCmp(name, "acl", 3) == 0 && - StrCaseCmp(name+3, sidstr) == 0) || + strcasecmp_m(name+3, sidstr) == 0) || (StrnCaseCmp(name, "acl+", 4) == 0 && - StrCaseCmp(name+4, sidstr) == 0)) { + strcasecmp_m(name+4, sidstr) == 0)) { if (determine_size) { p = talloc_asprintf( ctx, @@ -1193,7 +1193,7 @@ cacl_get(SMBCCTX *context, : ""), mode); } - } else if (StrCaseCmp(name, "mode") == 0) { + } else if (strcasecmp_m(name, "mode") == 0) { if (determine_size) { p = talloc_asprintf(ctx, "0x%x", mode); if (!p) { @@ -1234,7 +1234,7 @@ cacl_get(SMBCCTX *context, ",SIZE:%.0f", (double)size); } - } else if (StrCaseCmp(name, "size") == 0) { + } else if (strcasecmp_m(name, "size") == 0) { if (determine_size) { p = talloc_asprintf( ctx, @@ -1281,7 +1281,7 @@ cacl_get(SMBCCTX *context, attr_strings.create_time_attr, (unsigned long) create_time); } - } else if (StrCaseCmp(name, attr_strings.create_time_attr) == 0) { + } else if (strcasecmp_m(name, attr_strings.create_time_attr) == 0) { if (determine_size) { p = talloc_asprintf(ctx, "%lu", (unsigned long) create_time); if (!p) { @@ -1323,7 +1323,7 @@ cacl_get(SMBCCTX *context, attr_strings.access_time_attr, (unsigned long) access_time); } - } else if (StrCaseCmp(name, attr_strings.access_time_attr) == 0) { + } else if (strcasecmp_m(name, attr_strings.access_time_attr) == 0) { if (determine_size) { p = talloc_asprintf(ctx, "%lu", (unsigned long) access_time); if (!p) { @@ -1365,7 +1365,7 @@ cacl_get(SMBCCTX *context, attr_strings.write_time_attr, (unsigned long) write_time); } - } else if (StrCaseCmp(name, attr_strings.write_time_attr) == 0) { + } else if (strcasecmp_m(name, attr_strings.write_time_attr) == 0) { if (determine_size) { p = talloc_asprintf(ctx, "%lu", (unsigned long) write_time); if (!p) { @@ -1407,7 +1407,7 @@ cacl_get(SMBCCTX *context, attr_strings.change_time_attr, (unsigned long) change_time); } - } else if (StrCaseCmp(name, attr_strings.change_time_attr) == 0) { + } else if (strcasecmp_m(name, attr_strings.change_time_attr) == 0) { if (determine_size) { p = talloc_asprintf(ctx, "%lu", (unsigned long) change_time); if (!p) { @@ -1448,7 +1448,7 @@ cacl_get(SMBCCTX *context, ",INODE:%.0f", (double) ino); } - } else if (StrCaseCmp(name, "inode") == 0) { + } else if (strcasecmp_m(name, "inode") == 0) { if (determine_size) { p = talloc_asprintf( ctx, @@ -1775,8 +1775,8 @@ SMBC_setxattr_ctx(SMBCCTX *context, /* * Are they asking to set the entire set of known attributes? */ - if (StrCaseCmp(name, "system.*") == 0 || - StrCaseCmp(name, "system.*+") == 0) { + if (strcasecmp_m(name, "system.*") == 0 || + strcasecmp_m(name, "system.*+") == 0) { /* Yup. */ char *namevalue = talloc_asprintf(talloc_tos(), "%s:%s", @@ -1835,9 +1835,9 @@ SMBC_setxattr_ctx(SMBCCTX *context, * Are they asking to set an access control element or to set * the entire access control list? */ - if (StrCaseCmp(name, "system.nt_sec_desc.*") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.*+") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.revision") == 0 || + if (strcasecmp_m(name, "system.nt_sec_desc.*") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.*+") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.revision") == 0 || StrnCaseCmp(name, "system.nt_sec_desc.acl", 22) == 0 || StrnCaseCmp(name, "system.nt_sec_desc.acl+", 23) == 0) { @@ -1868,8 +1868,8 @@ SMBC_setxattr_ctx(SMBCCTX *context, /* * Are they asking to set the owner? */ - if (StrCaseCmp(name, "system.nt_sec_desc.owner") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.owner+") == 0) { + if (strcasecmp_m(name, "system.nt_sec_desc.owner") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.owner+") == 0) { /* Yup. */ char *namevalue = @@ -1894,8 +1894,8 @@ SMBC_setxattr_ctx(SMBCCTX *context, /* * Are they asking to set the group? */ - if (StrCaseCmp(name, "system.nt_sec_desc.group") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.group+") == 0) { + if (strcasecmp_m(name, "system.nt_sec_desc.group") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.group+") == 0) { /* Yup. */ char *namevalue = @@ -1936,13 +1936,13 @@ SMBC_setxattr_ctx(SMBCCTX *context, /* * Are they asking to set a DOS attribute? */ - if (StrCaseCmp(name, "system.dos_attr.*") == 0 || - StrCaseCmp(name, "system.dos_attr.mode") == 0 || + if (strcasecmp_m(name, "system.dos_attr.*") == 0 || + strcasecmp_m(name, "system.dos_attr.mode") == 0 || (attr_strings.create_time_attr != NULL && - StrCaseCmp(name, attr_strings.create_time_attr) == 0) || - StrCaseCmp(name, attr_strings.access_time_attr) == 0 || - StrCaseCmp(name, attr_strings.write_time_attr) == 0 || - StrCaseCmp(name, attr_strings.change_time_attr) == 0) { + strcasecmp_m(name, attr_strings.create_time_attr) == 0) || + strcasecmp_m(name, attr_strings.access_time_attr) == 0 || + strcasecmp_m(name, attr_strings.write_time_attr) == 0 || + strcasecmp_m(name, attr_strings.change_time_attr) == 0) { /* get a DOS Attribute Descriptor with current attributes */ dad = dos_attr_query(context, talloc_tos(), path, srv); @@ -2081,31 +2081,31 @@ SMBC_getxattr_ctx(SMBCCTX *context, } /* Are they requesting a supported attribute? */ - if (StrCaseCmp(name, "system.*") == 0 || + if (strcasecmp_m(name, "system.*") == 0 || StrnCaseCmp(name, "system.*!", 9) == 0 || - StrCaseCmp(name, "system.*+") == 0 || + strcasecmp_m(name, "system.*+") == 0 || StrnCaseCmp(name, "system.*+!", 10) == 0 || - StrCaseCmp(name, "system.nt_sec_desc.*") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.*") == 0 || StrnCaseCmp(name, "system.nt_sec_desc.*!", 21) == 0 || - StrCaseCmp(name, "system.nt_sec_desc.*+") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.*+") == 0 || StrnCaseCmp(name, "system.nt_sec_desc.*+!", 22) == 0 || - StrCaseCmp(name, "system.nt_sec_desc.revision") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.owner") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.owner+") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.group") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.group+") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.revision") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.owner") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.owner+") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.group") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.group+") == 0 || StrnCaseCmp(name, "system.nt_sec_desc.acl", 22) == 0 || StrnCaseCmp(name, "system.nt_sec_desc.acl+", 23) == 0 || - StrCaseCmp(name, "system.dos_attr.*") == 0 || + strcasecmp_m(name, "system.dos_attr.*") == 0 || StrnCaseCmp(name, "system.dos_attr.*!", 18) == 0 || - StrCaseCmp(name, "system.dos_attr.mode") == 0 || - StrCaseCmp(name, "system.dos_attr.size") == 0 || + strcasecmp_m(name, "system.dos_attr.mode") == 0 || + strcasecmp_m(name, "system.dos_attr.size") == 0 || (attr_strings.create_time_attr != NULL && - StrCaseCmp(name, attr_strings.create_time_attr) == 0) || - StrCaseCmp(name, attr_strings.access_time_attr) == 0 || - StrCaseCmp(name, attr_strings.write_time_attr) == 0 || - StrCaseCmp(name, attr_strings.change_time_attr) == 0 || - StrCaseCmp(name, "system.dos_attr.inode") == 0) { + strcasecmp_m(name, attr_strings.create_time_attr) == 0) || + strcasecmp_m(name, attr_strings.access_time_attr) == 0 || + strcasecmp_m(name, attr_strings.write_time_attr) == 0 || + strcasecmp_m(name, attr_strings.change_time_attr) == 0 || + strcasecmp_m(name, "system.dos_attr.inode") == 0) { /* Yup. */ const char *filename = name; @@ -2206,8 +2206,8 @@ SMBC_removexattr_ctx(SMBCCTX *context, } /* Are they asking to set the entire ACL? */ - if (StrCaseCmp(name, "system.nt_sec_desc.*") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.*+") == 0) { + if (strcasecmp_m(name, "system.nt_sec_desc.*") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.*+") == 0) { /* Yup. */ ret = cacl_set(context, talloc_tos(), srv->cli, @@ -2221,11 +2221,11 @@ SMBC_removexattr_ctx(SMBCCTX *context, * Are they asking to remove one or more spceific security descriptor * attributes? */ - if (StrCaseCmp(name, "system.nt_sec_desc.revision") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.owner") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.owner+") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.group") == 0 || - StrCaseCmp(name, "system.nt_sec_desc.group+") == 0 || + if (strcasecmp_m(name, "system.nt_sec_desc.revision") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.owner") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.owner+") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.group") == 0 || + strcasecmp_m(name, "system.nt_sec_desc.group+") == 0 || StrnCaseCmp(name, "system.nt_sec_desc.acl", 22) == 0 || StrnCaseCmp(name, "system.nt_sec_desc.acl+", 23) == 0) { -- cgit From da662b82b87cdbe07762974b1f9e825ef15951bd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 13 May 2011 20:23:36 +0200 Subject: s3-lib Replace StrnCaseCmp() with strncasecmp_m() strncasecmp_m() never needs to call to talloc, and via next_codepoint() still has an ASCII fast-path bypassing iconv() calls. Andrew Bartlett --- source3/libsmb/libsmb_xattr.c | 74 +++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'source3/libsmb/libsmb_xattr.c') diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c index 22d71571c6a..56fe06435cc 100644 --- a/source3/libsmb/libsmb_xattr.c +++ b/source3/libsmb/libsmb_xattr.c @@ -321,9 +321,9 @@ parse_ace(struct cli_state *ipc_cli, return false; } - if (StrnCaseCmp(tok, "ALLOWED", strlen("ALLOWED")) == 0) { + if (strncasecmp_m(tok, "ALLOWED", strlen("ALLOWED")) == 0) { atype = SEC_ACE_TYPE_ACCESS_ALLOWED; - } else if (StrnCaseCmp(tok, "DENIED", strlen("DENIED")) == 0) { + } else if (strncasecmp_m(tok, "DENIED", strlen("DENIED")) == 0) { atype = SEC_ACE_TYPE_ACCESS_DENIED; } else { TALLOC_FREE(frame); @@ -436,12 +436,12 @@ sec_desc_parse(TALLOC_CTX *ctx, while (next_token_talloc(ctx, &p, &tok, "\t,\r\n")) { - if (StrnCaseCmp(tok,"REVISION:", 9) == 0) { + if (strncasecmp_m(tok,"REVISION:", 9) == 0) { revision = strtol(tok+9, NULL, 16); continue; } - if (StrnCaseCmp(tok,"OWNER:", 6) == 0) { + if (strncasecmp_m(tok,"OWNER:", 6) == 0) { if (owner_sid) { DEBUG(5,("OWNER specified more than once!\n")); goto done; @@ -457,7 +457,7 @@ sec_desc_parse(TALLOC_CTX *ctx, continue; } - if (StrnCaseCmp(tok,"OWNER+:", 7) == 0) { + if (strncasecmp_m(tok,"OWNER+:", 7) == 0) { if (owner_sid) { DEBUG(5,("OWNER specified more than once!\n")); goto done; @@ -473,7 +473,7 @@ sec_desc_parse(TALLOC_CTX *ctx, continue; } - if (StrnCaseCmp(tok,"GROUP:", 6) == 0) { + if (strncasecmp_m(tok,"GROUP:", 6) == 0) { if (group_sid) { DEBUG(5,("GROUP specified more than once!\n")); goto done; @@ -489,7 +489,7 @@ sec_desc_parse(TALLOC_CTX *ctx, continue; } - if (StrnCaseCmp(tok,"GROUP+:", 7) == 0) { + if (strncasecmp_m(tok,"GROUP+:", 7) == 0) { if (group_sid) { DEBUG(5,("GROUP specified more than once!\n")); goto done; @@ -505,7 +505,7 @@ sec_desc_parse(TALLOC_CTX *ctx, continue; } - if (StrnCaseCmp(tok,"ACL:", 4) == 0) { + if (strncasecmp_m(tok,"ACL:", 4) == 0) { struct security_ace ace; if (!parse_ace(ipc_cli, pol, &ace, numeric, tok+4)) { DEBUG(5, ("Failed to parse ACL %s\n", tok)); @@ -518,7 +518,7 @@ sec_desc_parse(TALLOC_CTX *ctx, continue; } - if (StrnCaseCmp(tok,"ACL+:", 5) == 0) { + if (strncasecmp_m(tok,"ACL+:", 5) == 0) { struct security_ace ace; if (!parse_ace(ipc_cli, pol, &ace, False, tok+5)) { DEBUG(5, ("Failed to parse ACL %s\n", tok)); @@ -637,7 +637,7 @@ dos_attr_parse(SMBCCTX *context, frame = talloc_stackframe(); while (next_token_talloc(frame, &p, &tok, "\t,\r\n")) { - if (StrnCaseCmp(tok, "MODE:", 5) == 0) { + if (strncasecmp_m(tok, "MODE:", 5) == 0) { long request = strtol(tok+5, NULL, 16); if (request == 0) { dad->mode = (request | @@ -650,32 +650,32 @@ dos_attr_parse(SMBCCTX *context, continue; } - if (StrnCaseCmp(tok, "SIZE:", 5) == 0) { + if (strncasecmp_m(tok, "SIZE:", 5) == 0) { dad->size = (SMB_OFF_T)atof(tok+5); continue; } n = strlen(attr_strings.access_time_attr); - if (StrnCaseCmp(tok, attr_strings.access_time_attr, n) == 0) { + if (strncasecmp_m(tok, attr_strings.access_time_attr, n) == 0) { dad->access_time = (time_t)strtol(tok+n+1, NULL, 10); continue; } n = strlen(attr_strings.change_time_attr); - if (StrnCaseCmp(tok, attr_strings.change_time_attr, n) == 0) { + if (strncasecmp_m(tok, attr_strings.change_time_attr, n) == 0) { dad->change_time = (time_t)strtol(tok+n+1, NULL, 10); continue; } n = strlen(attr_strings.write_time_attr); - if (StrnCaseCmp(tok, attr_strings.write_time_attr, n) == 0) { + if (strncasecmp_m(tok, attr_strings.write_time_attr, n) == 0) { dad->write_time = (time_t)strtol(tok+n+1, NULL, 10); continue; } if (attr_strings.create_time_attr != NULL) { n = strlen(attr_strings.create_time_attr); - if (StrnCaseCmp(tok, attr_strings.create_time_attr, + if (strncasecmp_m(tok, attr_strings.create_time_attr, n) == 0) { dad->create_time = (time_t)strtol(tok+n+1, NULL, 10); @@ -683,7 +683,7 @@ dos_attr_parse(SMBCCTX *context, } } - if (StrnCaseCmp(tok, "INODE:", 6) == 0) { + if (strncasecmp_m(tok, "INODE:", 6) == 0) { dad->inode = (SMB_INO_T)atof(tok+6); continue; } @@ -800,12 +800,12 @@ cacl_get(SMBCCTX *context, *pExclude++ = '\0'; } - all = (StrnCaseCmp(name, "system.*", 8) == 0); - all_nt = (StrnCaseCmp(name, "system.nt_sec_desc.*", 20) == 0); - all_nt_acls = (StrnCaseCmp(name, "system.nt_sec_desc.acl.*", 24) == 0); - all_dos = (StrnCaseCmp(name, "system.dos_attr.*", 17) == 0); - some_nt = (StrnCaseCmp(name, "system.nt_sec_desc.", 19) == 0); - some_dos = (StrnCaseCmp(name, "system.dos_attr.", 16) == 0); + all = (strncasecmp_m(name, "system.*", 8) == 0); + all_nt = (strncasecmp_m(name, "system.nt_sec_desc.*", 20) == 0); + all_nt_acls = (strncasecmp_m(name, "system.nt_sec_desc.acl.*", 24) == 0); + all_dos = (strncasecmp_m(name, "system.dos_attr.*", 17) == 0); + some_nt = (strncasecmp_m(name, "system.nt_sec_desc.", 19) == 0); + some_dos = (strncasecmp_m(name, "system.dos_attr.", 16) == 0); numeric = (* (name + strlen(name) - 1) != '+'); /* Look for exclusions from "all" requests */ @@ -982,7 +982,7 @@ cacl_get(SMBCCTX *context, n = snprintf(buf, bufsize, ",OWNER:%s", sidstr); } - } else if (StrnCaseCmp(name, "owner", 5) == 0) { + } else if (strncasecmp_m(name, "owner", 5) == 0) { if (determine_size) { p = talloc_asprintf(ctx, "%s", sidstr); if (!p) { @@ -1028,7 +1028,7 @@ cacl_get(SMBCCTX *context, n = snprintf(buf, bufsize, ",GROUP:%s", sidstr); } - } else if (StrnCaseCmp(name, "group", 5) == 0) { + } else if (strncasecmp_m(name, "group", 5) == 0) { if (determine_size) { p = talloc_asprintf(ctx, "%s", sidstr); if (!p) { @@ -1085,9 +1085,9 @@ cacl_get(SMBCCTX *context, ace->flags, ace->access_mask); } - } else if ((StrnCaseCmp(name, "acl", 3) == 0 && + } else if ((strncasecmp_m(name, "acl", 3) == 0 && strcasecmp_m(name+3, sidstr) == 0) || - (StrnCaseCmp(name, "acl+", 4) == 0 && + (strncasecmp_m(name, "acl+", 4) == 0 && strcasecmp_m(name+4, sidstr) == 0)) { if (determine_size) { p = talloc_asprintf( @@ -1838,8 +1838,8 @@ SMBC_setxattr_ctx(SMBCCTX *context, if (strcasecmp_m(name, "system.nt_sec_desc.*") == 0 || strcasecmp_m(name, "system.nt_sec_desc.*+") == 0 || strcasecmp_m(name, "system.nt_sec_desc.revision") == 0 || - StrnCaseCmp(name, "system.nt_sec_desc.acl", 22) == 0 || - StrnCaseCmp(name, "system.nt_sec_desc.acl+", 23) == 0) { + strncasecmp_m(name, "system.nt_sec_desc.acl", 22) == 0 || + strncasecmp_m(name, "system.nt_sec_desc.acl+", 23) == 0) { /* Yup. */ char *namevalue = @@ -2082,22 +2082,22 @@ SMBC_getxattr_ctx(SMBCCTX *context, /* Are they requesting a supported attribute? */ if (strcasecmp_m(name, "system.*") == 0 || - StrnCaseCmp(name, "system.*!", 9) == 0 || + strncasecmp_m(name, "system.*!", 9) == 0 || strcasecmp_m(name, "system.*+") == 0 || - StrnCaseCmp(name, "system.*+!", 10) == 0 || + strncasecmp_m(name, "system.*+!", 10) == 0 || strcasecmp_m(name, "system.nt_sec_desc.*") == 0 || - StrnCaseCmp(name, "system.nt_sec_desc.*!", 21) == 0 || + strncasecmp_m(name, "system.nt_sec_desc.*!", 21) == 0 || strcasecmp_m(name, "system.nt_sec_desc.*+") == 0 || - StrnCaseCmp(name, "system.nt_sec_desc.*+!", 22) == 0 || + strncasecmp_m(name, "system.nt_sec_desc.*+!", 22) == 0 || strcasecmp_m(name, "system.nt_sec_desc.revision") == 0 || strcasecmp_m(name, "system.nt_sec_desc.owner") == 0 || strcasecmp_m(name, "system.nt_sec_desc.owner+") == 0 || strcasecmp_m(name, "system.nt_sec_desc.group") == 0 || strcasecmp_m(name, "system.nt_sec_desc.group+") == 0 || - StrnCaseCmp(name, "system.nt_sec_desc.acl", 22) == 0 || - StrnCaseCmp(name, "system.nt_sec_desc.acl+", 23) == 0 || + strncasecmp_m(name, "system.nt_sec_desc.acl", 22) == 0 || + strncasecmp_m(name, "system.nt_sec_desc.acl+", 23) == 0 || strcasecmp_m(name, "system.dos_attr.*") == 0 || - StrnCaseCmp(name, "system.dos_attr.*!", 18) == 0 || + strncasecmp_m(name, "system.dos_attr.*!", 18) == 0 || strcasecmp_m(name, "system.dos_attr.mode") == 0 || strcasecmp_m(name, "system.dos_attr.size") == 0 || (attr_strings.create_time_attr != NULL && @@ -2226,8 +2226,8 @@ SMBC_removexattr_ctx(SMBCCTX *context, strcasecmp_m(name, "system.nt_sec_desc.owner+") == 0 || strcasecmp_m(name, "system.nt_sec_desc.group") == 0 || strcasecmp_m(name, "system.nt_sec_desc.group+") == 0 || - StrnCaseCmp(name, "system.nt_sec_desc.acl", 22) == 0 || - StrnCaseCmp(name, "system.nt_sec_desc.acl+", 23) == 0) { + strncasecmp_m(name, "system.nt_sec_desc.acl", 22) == 0 || + strncasecmp_m(name, "system.nt_sec_desc.acl+", 23) == 0) { /* Yup. */ ret = cacl_set(context, talloc_tos(), srv->cli, -- cgit From d5e6a47f064a3923b1e257ab84fa7ccd7c4f89f4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:38:41 +1000 Subject: s3-talloc Change TALLOC_P() to talloc() Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc. --- source3/libsmb/libsmb_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libsmb/libsmb_xattr.c') diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c index 56fe06435cc..eeff9a90306 100644 --- a/source3/libsmb/libsmb_xattr.c +++ b/source3/libsmb/libsmb_xattr.c @@ -561,7 +561,7 @@ dos_attr_query(SMBCCTX *context, SMB_INO_T inode = 0; DOS_ATTR_DESC *ret; - ret = TALLOC_P(ctx, DOS_ATTR_DESC); + ret = talloc(ctx, DOS_ATTR_DESC); if (!ret) { errno = ENOMEM; return NULL; -- cgit