static int ip_from_string(const char *str, ctdb_sock_addr *addr)
{
- char *p;
+ const char *p;
int ret;
if (addr == NULL) {
state->query = query;
if ((sitename != NULL) && (sitename[0] != '\0')) {
- char *after_tcp = NULL;
+ const char *after_tcp = NULL;
char *site_aware = NULL;
/*
"--with-smbpasswd-file",
};
- char *equals = NULL;
+ const char *equals = NULL;
*ulen = 0;
for (i = 0; i < ARRAY_SIZE(must_burn); i++) {
if (equals == NULL) {
*ulen = strlen(p);
} else {
- char *pass = (strstr(p, "pass"));
+ const char *pass = (strstr(p, "pass"));
if (pass > equals) {
/* this is --foo=pass, not --pass=foo */
return false;
const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int bit_offset=0, byte_offset, idx, i, n;
uint8_t *d = (uint8_t *)s;
- char *p=NULL;
+ const char *p=NULL;
n=i=0;
int ret;
char *backend;
struct backends_list_entry *be;
- char *colon = NULL;
+ const char *colon = NULL;
colon = strchr(url, ':');
if (colon != NULL) {
{
const char *mutex_msg =
"Can use mutexes only with MUTEX_LOCKING or NOLOCK\n";
- char *p;
+ const char *p;
va_list ap;
p = strstr(format, mutex_msg);
int bit_offset, byte_offset, idx, i, n;
DATA_BLOB decoded = data_blob_talloc(mem_ctx, s, strlen(s)+1);
unsigned char *d = decoded.data;
- char *p;
+ const char *p;
if (decoded.data == NULL) {
decoded.length = 0;
}
for (i = 0; i < ARRAY_SIZE(comp1); i++) {
- char *p;
+ const char *p;
if (i == 0) {
p1 = s1;
}
for (i = 0; i < ARRAY_SIZE(comp2); i++) {
- char *p;
+ const char *p;
if (i == 0) {
p2 = s2;
{
unsigned long int val;
int saved_errno = errno;
- char *needle = NULL;
+ const char *needle = NULL;
char *tmp_endptr = NULL;
errno = 0;
{
unsigned long long int val;
int saved_errno = errno;
- char *needle = NULL;
+ const char *needle = NULL;
char *tmp_endptr = NULL;
errno = 0;
}
if (strchr_m(str, ':')) {
- char *p = strchr_m(str, SCOPE_DELIMITER);
+ const char *p = strchr_m(str, SCOPE_DELIMITER);
/*
* Cope with link-local.
{
#if defined(HAVE_IPV6)
int ret = -1;
- char *p = NULL;
+ const char *p = NULL;
char buf[INET6_ADDRSTRLEN] = { 0, };
size_t len;
const char *addr = str;
struct netlogon_creds_cli_context *context = NULL;
char *_key_name = NULL;
size_t server_netbios_name_len;
- char *p = NULL;
+ const char *p = NULL;
*_context = NULL;
{
TALLOC_CTX *tmp_ctx = talloc_new(NULL);
enum nbt_name_type node_type = NBT_NAME_CLIENT;
- char *node_name, *p;
+ const char *node_name, *p;
struct socket_address *all_zero_addr;
struct nbt_name_socket *nbtsock;
NTSTATUS status = NT_STATUS_OK;
}
if (cases[i].snippet != NULL) {
if (message != NULL) {
- char *c = strstr(message, cases[i].snippet);
+ const char *c = strstr(message, cases[i].snippet);
print_error_message(cases[i].sddl,
message,
message_offset);
for (i=0; i<ctx->argc; i++) {
if ((strncmp(ctx->argv[i], item, strlen(item)) == 0)) {
- char *p;
+ const char *p;
if ((p = strchr(ctx->argv[i], '=')) == NULL) {
_pam_log(ctx, LOG_INFO,
for (i = 0; i < ctx->argc; i++) {
if ((strncmp(ctx->argv[i], item, strlen(item)) == 0)) {
- char *p;
+ const char *p;
if ((p = strchr(ctx->argv[i], '=')) == NULL) {
_pam_log(ctx, LOG_INFO,
fstring user)
{
- char *p = strchr(domuser,winbind_separator());
+ const char *p = strchr(domuser,winbind_separator());
if (!p) {
/* Maybe it was a UPN? */
struct wbcAuthErrorInfo *err = NULL;
struct auth_serversupplied_info *server_info = NULL;
char *original_user_name = NULL;
- char *p = NULL;
+ const char *p = NULL;
wbcErr wbc_err;
/*
const char *domain = NULL;
const char *realm = NULL;
char *user = NULL;
- char *p;
+ const char *p = NULL;
char *fuser = NULL;
char *unixuser = NULL;
struct passwd *pw = NULL;
char *get_mydnsdomname(TALLOC_CTX *ctx)
{
const char *domname;
- char *p;
+ const char *p;
domname = get_mydnsfullname();
if (!domname) {
bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
const char **name)
{
- char *p;
+ const char *p;
ptrdiff_t len;
p = strrchr_m(dir, '/'); /* Find final '/', if any */
char **parent,
const char **name)
{
- char *p;
+ const char *p;
ptrdiff_t len;
p = strrchr_m(dir, '\\'); /* Find final '\\', if any */
state->transports = *transports;
if (host != NULL) {
- char *p = strchr(host, '#');
+ const char *p = strchr(host, '#');
if (p != NULL) {
name_type = strtol(p+1, NULL, 16);
static bool is_special_nfs4_id(const char *nfs4_id)
{
- char *at = NULL;
+ const char *at = NULL;
at = strchr(nfs4_id, '@');
if (at == NULL) {
const char *name)
{
bool ok;
- char *p = NULL;
+ const char *p = NULL;
size_t sparsebundle_strlen = strlen("sparsebundle");
size_t bandsize = 0;
size_t nbands;
* - with suffixed name.
*/
int status = 0;
- char* pathPtr;
+ const char *pathPtr = NULL;
size_t intermPathLen;
DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
goto out;
}
DEBUG(MH_INFO_DEBUG, ("newPath #1 %s\n", *newPath));
+ pathPtr = strstr_m(path, CREATING_DIRNAME);
if (
- (pathPtr = strstr(path, CREATING_DIRNAME)) != NULL
+ pathPtr != NULL
&&
(
*(pathPtr + CREATING_DIRNAME_LEN) == '\0'
basedir);
basedir = NULL;
} else {
- char *p;
+ const char *p;
p = strstr(basedir, config->mount_point);
if (p != basedir) {
DEBUG(1, ("Warning: basedir (%s) is not a "
char **xattr_name)
{
size_t stream_name_len = strlen(stream_name);
- char *stype;
+ const char *stype;
struct streams_xattr_config *config;
char *raw_stream_name = NULL;
char **path_out)
{
int status = 0;
- char *p;
+ const char *p = NULL;
char *digits;
size_t digits_len;
uintmax_t number;
const char *rename_prefix = NULL;
const char *rename_suffix = NULL;
const char *socket_path = NULL;
- char *sret = NULL;
+ const char *sret = NULL;
char *tmp = NULL;
enum virusfilter_scanner_enum backend;
int connect_timeout = 0;
int rename_trap_count = 0;
int ret;
bool ok1;
- char *sret = NULL;
+ const char *sret = NULL;
struct smb_filename *smb_fname = NULL;
SMB_STRUCT_STAT sbuf = smb_fname_in->st;
**********************************************************/
uint32_t get_int_param( const char* param )
{
- char *p;
+ const char *p = NULL;
p = strchr( param, '=' );
if ( !p )
struct dom_sid *ret_sid,
enum lsa_SidType *ret_type)
{
- char *p;
+ const char *p;
const char *tmp;
const char *domain = NULL;
const char *name = NULL;
PTR_DIFF(p, full_name));
name = talloc_strdup(tmp_ctx, p+1);
} else {
- char *q = strchr_m(full_name, '@');
+ const char *q = strchr_m(full_name, '@');
/* Set the domain for UPNs */
if (q != NULL) {
*response = NULL; /* IPP Response */
ipp_attribute_t *attr; /* Current attribute */
cups_lang_t *language = NULL; /* Default language */
- char *ver; /* server version pointer */
+ const char *ver; /* server version pointer */
char *vertmp; /* server version tmp pointer */
int serverVersion = 0; /* server version */
- char *os; /* server os */
+ const char *os; /* server os */
int osFlag = 0; /* 0 for NetWare, 1 for anything else */
char *temp; /* pointer for string manipulation */
const char *filename_in,
uint32_t ucf_flags)
{
- char *last_slash = NULL;
+ const char *last_slash = NULL;
char *orig_lcomp;
NTSTATUS status;
static bool is_mangled(const char *s, const struct share_params *p)
{
- char *magic;
+ const char *magic = NULL;
char magic_char;
magic_char = lp_mangling_char(p);
static bool is_8_3(const char *name, bool check_case, bool allow_wildcards, const struct share_params *p)
{
int len, i;
- char *dot_p;
+ const char *dot_p = NULL;
/* as a special case, the names '.' and '..' are allowable 8.3 names */
if (ISDOT(name) || (ISDOTDOT(name))) {
int default_case,
const struct share_params *p)
{
- char *dot_p;
+ const char *dot_p = NULL;
char lead_chars[7];
char extension[4];
unsigned int extension_length, i;
static const char *strip_unc(const char *unc)
{
- char *p;
+ const char *p = NULL;
if (unc == NULL) {
return NULL;
time_t date,
bool uc)
{
- char *p;
+ const char *p = NULL;
if ((mode & FILE_ATTRIBUTE_DIRECTORY) != 0) {
size = 0;
}
memset(buf+1,' ',11);
- if ((p = strchr_m(mask, '.')) != NULL) {
+ p = strchr_m(mask, '.');
+ if (p != NULL) {
char name[p - mask + 1];
strlcpy(name, mask, sizeof(name));
push_ascii(buf + 1, name, 8, 0);
const char *auth_password = cli_credentials_get_password(c->creds);
const char *realm = NULL;
char *new_password = NULL;
- char *chr = NULL;
+ const char *chr = NULL;
char *prompt = NULL;
const char *user = NULL;
char pwd[256] = {0};
static int net_ads_kerberos_pac_save(struct net_context *c, int argc, const char **argv)
{
struct PAC_DATA_CTR *pac_data_ctr = NULL;
- char *filename = NULL;
+ const char *filename = NULL;
int ret = -1;
int i;
static bool do_unfruit(const char *path)
{
struct smb_filename *smb_fname = NULL;
- char *p = NULL;
+ const char *p = NULL;
bool converted;
NTSTATUS status;
fstring user)
{
- char *p = strchr(domuser,winbind_separator());
+ const char *p = strchr(domuser,winbind_separator());
if (!p) {
return False;
return NULL;
for ( i=0; i<num_ace; i++ ) {
- char *end_acl = strchr_m( pacl, ',' );
+ const char *end_acl = strchr_m( pacl, ',' );
fstring acl_string;
strncpy( acl_string, pacl, MIN( PTR_DIFF( end_acl, pacl ), sizeof(fstring)-1) );
if(deny_list) {
for (i=0; deny_list[i]; i++) {
- char *hasstar = strchr_m(deny_list[i], '*');
- char *hasquery = strchr_m(deny_list[i], '?');
+ const char *hasstar = strchr_m(deny_list[i], '*');
+ const char *hasquery = strchr_m(deny_list[i], '?');
if(hasstar || hasquery) {
fprintf(stderr,
"Invalid character %c in hosts deny list "
if(allow_list) {
for (i=0; allow_list[i]; i++) {
- char *hasstar = strchr_m(allow_list[i], '*');
- char *hasquery = strchr_m(allow_list[i], '?');
+ const char *hasstar = strchr_m(allow_list[i], '*');
+ const char *hasquery = strchr_m(allow_list[i], '?');
if(hasstar || hasquery) {
fprintf(stderr,
"Invalid character %c in hosts allow "
char **backend,
char **domain)
{
- char *p;
+ const char *p;
*backend = *domain = NULL;
/* Handle types with explicit paths and %u or %{uid} substitution */
if (has_prefix) {
- char *p;
+ const char *p;
const char *subst_pattern = NULL;
p = strchr(type, '%');
char **pdomain,
char **puser)
{
- char *p = NULL;
+ const char *p = NULL;
char *namespace = NULL;
char *domain = NULL;
char *user = NULL;
TALLOC_FREE(frame);
return NT_STATUS_INVALID_PARAMETER;
}
- p = strstr_m(ntln->string, "..");
- if (p != NULL) {
- TALLOC_FREE(frame);
- return NT_STATUS_INVALID_PARAMETER;
+ {
+ const char *dots = NULL;
+
+ dots = strstr_m(ntln->string, "..");
+ if (dots != NULL) {
+ TALLOC_FREE(frame);
+ return NT_STATUS_INVALID_PARAMETER;
+ }
}
if (nnb != NULL &&
}
for (i=0; i < modules_attributes->num_values; i++) {
- char *p;
+ const char *p;
DATA_BLOB dn_blob;
data->modules[i] = talloc(data->modules, struct partition_module);
if (!data->modules[i]) {
return LDB_ERR_CONSTRAINT_VIOLATION;
}
/* Now trim off the filename */
- dn_blob.length = ((uint8_t *)p - dn_blob.data);
+ dn_blob.length = ((const uint8_t *)p - dn_blob.data);
p++;
data->modules[i]->modules = ldb_modules_list_from_string(ldb, data->modules[i],
(strncmp((const char *)&dn_blob.data[dn_blob.length-4], ".ldb", 4) == 0)) {
/* Look for DN:filename.ldb */
- char *p = strrchr((const char *)dn_blob.data, ':');
+ const char *p = strrchr((const char *)dn_blob.data, ':');
if (!p) {
ldb_asprintf_errstring(ldb,
"partition_init: invalid DN in attempting to parse partition record: %s", (const char *)dn_blob.data);
filename = p+1;
/* Now trim off the filename */
- dn_blob.length = ((uint8_t *)p - dn_blob.data);
+ dn_blob.length = ((const uint8_t *)p - dn_blob.data);
}
dn = ldb_dn_from_ldb_val(mem_ctx, ldb, &dn_blob);
/* Find those that are range requests from the attribute list */
for (i = 0; ac->req->op.search.attrs[i]; i++) {
- char *p, *new_attr;
+ const char *p;
+ char *new_attr;
const char *end_str;
unsigned int start, end;
struct ldb_message_element *el;
/* Strip the range request from the attribute */
for (i = 0; req->op.search.attrs && req->op.search.attrs[i]; i++) {
- char *p;
+ const char *p;
size_t range_len = strlen(";range=");
new_attrs = talloc_realloc(req, new_attrs, const char *, i+2);
{
const struct ldb_message *msg = req->op.mod.message;
const char *ldb_val_str;
- char *dn, *guid;
+ char *dn;
+ const char *guid;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
NTSTATUS status;
for (i = 0; name[i] != '\0'; i++) {
uint8_t c = name[i];
- char *p = NULL;
+ const char *p = NULL;
+
if (c < 32 || c == 127) {
ldb_asprintf_errstring(
ldb,
{
int ret;
char *service_class = NULL;
- char *spn_tail = NULL;
- char *p = NULL;
+ const char *spn_tail = NULL;
+ const char *p = NULL;
char **aliases = NULL;
size_t n_aliases = 0;
size_t i, len;
DATA_BLOB ret;
const char *HEXCHARS = "0123456789ABCDEF";
size_t i, j;
- char *hi, *lo;
+ const char *hi, *lo;
ret = data_blob_talloc_zero(mem_ctx, (strlen(str)+(strlen(str) % 3))/3);
j = 0;
char addr[INET6_ADDRSTRLEN];
struct in6_addr dest6;
const char *sp = name;
- char *p;
+ const char *p = NULL;
int ret;
if (sp == NULL) return in6addr_any;
}
if (strncmp(sharename, "\\\\", 2) == 0) {
- char *str = strchr(sharename+2, '\\');
+ const char *str = strchr(sharename+2, '\\');
if (str) {
sharename = str + 1;
}
}
if (strncmp(sharename, "\\\\", 2) == 0) {
- char *p = strchr(sharename+2, '\\');
+ const char *p = strchr(sharename+2, '\\');
if (p) {
sharename = p + 1;
}
*/
bool is_exe_filename(const char *fname)
{
- char *p;
+ const char *p;
p = strrchr(fname, '.');
if (!p) {
return false;
{
const char *base1, *base2;
const char *ext1, *ext2;
- char *p;
+ const char *p = NULL;
/* break into base part plus extension */
p = strrchr_m(fname, '.');
const char *name, bool check_case, bool allow_wildcards)
{
int len, i;
- char *dot_p;
+ const char *dot_p;
/* as a special case, the names '.' and '..' are allowable 8.3 names */
if (name[0] == '.') {
static char *name_map(struct pvfs_mangle_context *ctx,
const char *name, bool need83, bool cache83)
{
- char *dot_p;
+ const char *dot_p;
char lead_chars[7];
char extension[4];
unsigned int extension_length, i;
const char **pathname)
{
struct pvfs_sys_ctx *ctx;
- char *cwd, *p, *dirname;
+ char *cwd, *dirname;
+ const char *p;
int ret;
ctx = talloc_zero(pvfs, struct pvfs_sys_ctx);
}
if (strncmp(sharename, "\\\\", 2) == 0) {
- char *p = strchr(sharename+2, '\\');
+ const char *p = strchr(sharename+2, '\\');
if (p) {
sharename = p + 1;
}
*/
struct svfs_dir *svfs_list_unix(TALLOC_CTX *mem_ctx, struct ntvfs_request *req, const char *unix_path)
{
- char *p, *mask;
+ const char *p, *mask;
struct svfs_dir *dir;
DIR *odir;
struct dirent *dent;
}
if (strncmp(sharename, "\\\\", 2) == 0) {
- char *p2 = strchr(sharename+2, '\\');
+ const char *p2 = strchr(sharename+2, '\\');
if (p2) {
sharename = p2 + 1;
}
for (i=0;i<r->in.num_names;i++) {
struct dcesrv_lsa_TranslatedItem *item = &state->items[i];
- char *p = NULL;
+ const char *p = NULL;
item->type = SID_NAME_UNKNOWN;
item->name = r->in.names[i].string;
/* the service might be of the form \\SERVER\SHARE. Should we put
the server name we get from this somewhere? */
if (strncmp(service, "\\\\", 2) == 0) {
- char *p = strchr(service+2, '\\');
+ const char *p = strchr(service+2, '\\');
if (p) {
service = p + 1;
}
torture_fail(torture, "ALL_INFO didn't give a filename");
}
if (s1 && s1->all_info.out.fname.s) {
- char *p = strrchr(s1->all_info.out.fname.s, '\\');
+ const char *p = strrchr(s1->all_info.out.fname.s, '\\');
if (!p) {
printf("Not a full path in all_info/fname? - '%s'\n",
s1->all_info.out.fname.s);
static const char *strip_unc(const char *unc)
{
- char *name;
+ const char *name;
if (!unc) {
return NULL;
static const char *strip_path(const char *path)
{
- char *p;
+ const char *p;
if (path == NULL) {
return NULL;
if (torture_setting_bool(tctx, "samba3", false) ||
torture_setting_bool(tctx, "samba4", false)) {
- char *q;
+ const char *q;
q = strrchr(values[i], ',');
if (q) {
torture_comment(
const char *name)
{
const char *full_name = talloc_strdup(tctx, name);
- char *p;
+ const char *p;
if (name && name[0] == '\\' && name[1] == '\\') {
name += 2;
const char *local_dir,
const char **path)
{
- char *p;
+ const char *p;
p = strrchr(local_dir, '/');
if (!p) {
static const char *driver_directory_dir(const char *driver_directory)
{
- char *p;
+ const char *p;
p = strrchr(driver_directory, '\\');
if (p) {
const char *domuser, fstring domain,
fstring user)
{
- char *p = strchr(domuser, winbind_separator(torture));
+ const char *p = strchr(domuser, winbind_separator(torture));
char *dom = NULL;
if (!p) {
static int check_braces(const char *string)
{
size_t b;
- char *c;
+ const char *c;
b = 0;
if ((c = strchr(string, '(')) == NULL) {