heimdal: fixed a shadowed variable warning for error_message

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
This commit is contained in:
Andrew Tridgell
2010-11-09 08:51:20 +11:00
committed by Love Hornquist Astrand
parent c54b80f00c
commit 157d60a0eb

View File

@@ -75,14 +75,14 @@ config_fgets(char *str, size_t len, struct fileptr *ptr)
static krb5_error_code parse_section(char *p, krb5_config_section **s, static krb5_error_code parse_section(char *p, krb5_config_section **s,
krb5_config_section **res, krb5_config_section **res,
const char **error_message); const char **err_message);
static krb5_error_code parse_binding(struct fileptr *f, unsigned *lineno, char *p, static krb5_error_code parse_binding(struct fileptr *f, unsigned *lineno, char *p,
krb5_config_binding **b, krb5_config_binding **b,
krb5_config_binding **parent, krb5_config_binding **parent,
const char **error_message); const char **err_message);
static krb5_error_code parse_list(struct fileptr *f, unsigned *lineno, static krb5_error_code parse_list(struct fileptr *f, unsigned *lineno,
krb5_config_binding **parent, krb5_config_binding **parent,
const char **error_message); const char **err_message);
static krb5_config_section * static krb5_config_section *
get_entry(krb5_config_section **parent, const char *name, int type) get_entry(krb5_config_section **parent, const char *name, int type)
@@ -119,25 +119,25 @@ get_entry(krb5_config_section **parent, const char *name, int type)
* *
* starting at the line in `p', storing the resulting structure in * starting at the line in `p', storing the resulting structure in
* `s' and hooking it into `parent'. * `s' and hooking it into `parent'.
* Store the error message in `error_message'. * Store the error message in `err_message'.
*/ */
static krb5_error_code static krb5_error_code
parse_section(char *p, krb5_config_section **s, krb5_config_section **parent, parse_section(char *p, krb5_config_section **s, krb5_config_section **parent,
const char **error_message) const char **err_message)
{ {
char *p1; char *p1;
krb5_config_section *tmp; krb5_config_section *tmp;
p1 = strchr (p + 1, ']'); p1 = strchr (p + 1, ']');
if (p1 == NULL) { if (p1 == NULL) {
*error_message = "missing ]"; *err_message = "missing ]";
return KRB5_CONFIG_BADFORMAT; return KRB5_CONFIG_BADFORMAT;
} }
*p1 = '\0'; *p1 = '\0';
tmp = get_entry(parent, p + 1, krb5_config_list); tmp = get_entry(parent, p + 1, krb5_config_list);
if(tmp == NULL) { if(tmp == NULL) {
*error_message = "out of memory"; *err_message = "out of memory";
return KRB5_CONFIG_BADFORMAT; return KRB5_CONFIG_BADFORMAT;
} }
*s = tmp; *s = tmp;
@@ -147,12 +147,12 @@ parse_section(char *p, krb5_config_section **s, krb5_config_section **parent,
/* /*
* Parse a brace-enclosed list from `f', hooking in the structure at * Parse a brace-enclosed list from `f', hooking in the structure at
* `parent'. * `parent'.
* Store the error message in `error_message'. * Store the error message in `err_message'.
*/ */
static krb5_error_code static krb5_error_code
parse_list(struct fileptr *f, unsigned *lineno, krb5_config_binding **parent, parse_list(struct fileptr *f, unsigned *lineno, krb5_config_binding **parent,
const char **error_message) const char **err_message)
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
krb5_error_code ret; krb5_error_code ret;
@@ -175,12 +175,12 @@ parse_list(struct fileptr *f, unsigned *lineno, krb5_config_binding **parent,
return 0; return 0;
if (*p == '\0') if (*p == '\0')
continue; continue;
ret = parse_binding (f, lineno, p, &b, parent, error_message); ret = parse_binding (f, lineno, p, &b, parent, err_message);
if (ret) if (ret)
return ret; return ret;
} }
*lineno = beg_lineno; *lineno = beg_lineno;
*error_message = "unclosed {"; *err_message = "unclosed {";
return KRB5_CONFIG_BADFORMAT; return KRB5_CONFIG_BADFORMAT;
} }
@@ -191,7 +191,7 @@ parse_list(struct fileptr *f, unsigned *lineno, krb5_config_binding **parent,
static krb5_error_code static krb5_error_code
parse_binding(struct fileptr *f, unsigned *lineno, char *p, parse_binding(struct fileptr *f, unsigned *lineno, char *p,
krb5_config_binding **b, krb5_config_binding **parent, krb5_config_binding **b, krb5_config_binding **parent,
const char **error_message) const char **err_message)
{ {
krb5_config_binding *tmp; krb5_config_binding *tmp;
char *p1, *p2; char *p1, *p2;
@@ -201,14 +201,14 @@ parse_binding(struct fileptr *f, unsigned *lineno, char *p,
while (*p && *p != '=' && !isspace((unsigned char)*p)) while (*p && *p != '=' && !isspace((unsigned char)*p))
++p; ++p;
if (*p == '\0') { if (*p == '\0') {
*error_message = "missing ="; *err_message = "missing =";
return KRB5_CONFIG_BADFORMAT; return KRB5_CONFIG_BADFORMAT;
} }
p2 = p; p2 = p;
while (isspace((unsigned char)*p)) while (isspace((unsigned char)*p))
++p; ++p;
if (*p != '=') { if (*p != '=') {
*error_message = "missing ="; *err_message = "missing =";
return KRB5_CONFIG_BADFORMAT; return KRB5_CONFIG_BADFORMAT;
} }
++p; ++p;
@@ -218,14 +218,14 @@ parse_binding(struct fileptr *f, unsigned *lineno, char *p,
if (*p == '{') { if (*p == '{') {
tmp = get_entry(parent, p1, krb5_config_list); tmp = get_entry(parent, p1, krb5_config_list);
if (tmp == NULL) { if (tmp == NULL) {
*error_message = "out of memory"; *err_message = "out of memory";
return KRB5_CONFIG_BADFORMAT; return KRB5_CONFIG_BADFORMAT;
} }
ret = parse_list (f, lineno, &tmp->u.list, error_message); ret = parse_list (f, lineno, &tmp->u.list, err_message);
} else { } else {
tmp = get_entry(parent, p1, krb5_config_string); tmp = get_entry(parent, p1, krb5_config_string);
if (tmp == NULL) { if (tmp == NULL) {
*error_message = "out of memory"; *err_message = "out of memory";
return KRB5_CONFIG_BADFORMAT; return KRB5_CONFIG_BADFORMAT;
} }
p1 = p; p1 = p;
@@ -341,14 +341,14 @@ parse_plist_config(krb5_context context, const char *path, krb5_config_section *
/* /*
* Parse the config file `fname', generating the structures into `res' * Parse the config file `fname', generating the structures into `res'
* returning error messages in `error_message' * returning error messages in `err_message'
*/ */
static krb5_error_code static krb5_error_code
krb5_config_parse_debug (struct fileptr *f, krb5_config_parse_debug (struct fileptr *f,
krb5_config_section **res, krb5_config_section **res,
unsigned *lineno, unsigned *lineno,
const char **error_message) const char **err_message)
{ {
krb5_config_section *s = NULL; krb5_config_section *s = NULL;
krb5_config_binding *b = NULL; krb5_config_binding *b = NULL;
@@ -366,19 +366,19 @@ krb5_config_parse_debug (struct fileptr *f,
if (*p == '#' || *p == ';') if (*p == '#' || *p == ';')
continue; continue;
if (*p == '[') { if (*p == '[') {
ret = parse_section(p, &s, res, error_message); ret = parse_section(p, &s, res, err_message);
if (ret) if (ret)
return ret; return ret;
b = NULL; b = NULL;
} else if (*p == '}') { } else if (*p == '}') {
*error_message = "unmatched }"; *err_message = "unmatched }";
return EINVAL; /* XXX */ return EINVAL; /* XXX */
} else if(*p != '\0') { } else if(*p != '\0') {
if (s == NULL) { if (s == NULL) {
*error_message = "binding before section"; *err_message = "binding before section";
return EINVAL; return EINVAL;
} }
ret = parse_binding(f, lineno, p, &b, &s->u.list, error_message); ret = parse_binding(f, lineno, p, &b, &s->u.list, err_message);
if (ret) if (ret)
return ret; return ret;
} }