Print this page
5910 libnisdb won't build with modern GCC
*** 18,33 ****
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
- #pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <fcntl.h>
--- 18,32 ----
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
+ * Copyright 2015 Gary Mills
* Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <fcntl.h>
*** 34,43 ****
--- 33,44 ----
#include <unistd.h>
#include <locale.h>
#include "ldap_parse.h"
#include "nis_parse_ldap_conf.h"
+ #include "nis_parse_ldap_yp_util.h"
+ #include "nis_parse_ldap_util.h"
/* other attribute functions */
static char *getIndex(const char **s_cur, const char *end_s);
static bool_t get_ttls(const char *s, const char *s_end,
__nis_table_mapping_t *t_mapping);
*** 91,101 ****
{
const char *s;
const char *attrib_end;
const char *db_id_end;
const char *begin_token;
- const char *end_token;
char *index_string;
__nis_object_dn_t *objectDN;
__nis_table_mapping_t *t_mapping;
__nis_table_mapping_t *t;
--- 92,101 ----
*** 376,388 ****
__yp_domain_context_t *ypDomains)
{
const char *s;
const char *attrib_end;
int numDomains = 0;
- int i;
- char *tmp_str;
- int ret = 0;
attrib_end = attrib_val + attrib_len;
for (s = attrib_val; s < attrib_end; s++) {
if (*s == COLON_CHAR) {
break;
--- 376,385 ----
*** 1509,1520 ****
parse_format_string_expected_error;
break;
}
if (end_token == begin_token + 1 ||
! *begin_token == ESCAPE_CHAR &&
! end_token == begin_token + 2) {
e->type = me_split;
e->element.split.item = item;
e->element.split.delim = *begin_token;
} else {
str = s_strndup(begin_token,
--- 1506,1517 ----
parse_format_string_expected_error;
break;
}
if (end_token == begin_token + 1 ||
! (*begin_token == ESCAPE_CHAR &&
! end_token == begin_token + 2)) {
e->type = me_split;
e->element.split.item = item;
e->element.split.delim = *begin_token;
} else {
str = s_strndup(begin_token,
*** 1651,1662 ****
begin_token = s;
end_token = end_s;
s = get_next_token(&begin_token, &end_token, &t);
if (s != NULL && t == quoted_string_token &&
(end_token == begin_token + 1 ||
! *begin_token == ESCAPE_CHAR &&
! end_token == begin_token + 2)) {
if (numSubElements != 1 ||
subElement->type == me_extract ||
subElement->type == me_split) {
p_error = parse_cannot_elide;
break;
--- 1648,1659 ----
begin_token = s;
end_token = end_s;
s = get_next_token(&begin_token, &end_token, &t);
if (s != NULL && t == quoted_string_token &&
(end_token == begin_token + 1 ||
! (*begin_token == ESCAPE_CHAR &&
! end_token == begin_token + 2))) {
if (numSubElements != 1 ||
subElement->type == me_extract ||
subElement->type == me_split) {
p_error = parse_cannot_elide;
break;
*** 2065,2076 ****
if (s == NULL || t != quoted_string_token) {
p_error = parse_format_string_expected_error;
break;
}
if (end_token == begin_token + 1 ||
! *begin_token == ESCAPE_CHAR &&
! end_token == begin_token + 2) {
/* me_split */
delim = (unsigned char)end_token[-1];
s = skip_token(s, end_s, close_paren_token);
if (s == NULL)
break;
--- 2062,2073 ----
if (s == NULL || t != quoted_string_token) {
p_error = parse_format_string_expected_error;
break;
}
if (end_token == begin_token + 1 ||
! (*begin_token == ESCAPE_CHAR &&
! end_token == begin_token + 2)) {
/* me_split */
delim = (unsigned char)end_token[-1];
s = skip_token(s, end_s, close_paren_token);
if (s == NULL)
break;