Changeset 2160
- Timestamp:
- 04/29/2008 11:03:26 AM (2 weeks ago)
- Files:
-
- branches/lighttpd-1.4.x/src/lemon.c (modified) (8 diffs)
- branches/lighttpd-1.4.x/src/lempar.c (modified) (5 diffs)
- branches/lighttpd-1.4.x/src/lighttpd-angel.c (modified) (2 diffs)
- branches/lighttpd-1.4.x/src/mod_auth.c (modified) (1 diff)
- branches/lighttpd-1.4.x/src/mod_webdav.c (modified) (2 diffs)
- branches/lighttpd-1.4.x/src/plugin.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/lighttpd-1.4.x/src/lemon.c
r1371 r2160 12 12 #include <ctype.h> 13 13 #include <stdlib.h> 14 15 #ifdef HAVE_CONFIG_H 16 #include "config.h" 17 #endif 18 19 #ifdef HAVE_STDINT_H 20 # include <stdint.h> 21 #endif 22 #ifdef HAVE_INTTYPES_H 23 # include <inttypes.h> 24 #endif 25 26 #define UNUSED(x) ( (void)(x) ) 14 27 15 28 extern void qsort(); … … 984 997 struct symbol *spx, *spy; 985 998 int errcnt = 0; 999 UNUSED(errsym); 986 1000 assert( apx->sp==apy->sp ); /* Otherwise there would be no conflict */ 987 1001 if( apx->type==SHIFT && apy->type==REDUCE ){ … … 1348 1362 char *def_tmpl_name = "lempar.c"; 1349 1363 1364 UNUSED(argc); 1350 1365 OptInit(argv,options,stderr); 1351 1366 if( version ){ … … 1652 1667 *((int*)op[j].arg) = v; 1653 1668 }else if( op[j].type==OPT_FFLAG ){ 1654 (*(void(*)())( op[j].arg))(v);1669 (*(void(*)())(intptr_t)(op[j].arg))(v); 1655 1670 }else{ 1656 1671 if( err ){ … … 1734 1749 break; 1735 1750 case OPT_FDBL: 1736 (*(void(*)())( op[j].arg))(dv);1751 (*(void(*)())(intptr_t)(op[j].arg))(dv); 1737 1752 break; 1738 1753 case OPT_INT: … … 1740 1755 break; 1741 1756 case OPT_FINT: 1742 (*(void(*)())( op[j].arg))((int)lv);1757 (*(void(*)())(intptr_t)(op[j].arg))((int)lv); 1743 1758 break; 1744 1759 case OPT_STR: … … 1746 1761 break; 1747 1762 case OPT_FSTR: 1748 (*(void(*)())( op[j].arg))(sv);1763 (*(void(*)())(intptr_t)(op[j].arg))(sv); 1749 1764 break; 1750 1765 } … … 2287 2302 ** the appropriate data structures in the global state vector "gp". 2288 2303 */ 2304 struct pstate ps; 2289 2305 void Parse(gp) 2290 2306 struct lemon *gp; 2291 2307 { 2292 struct pstate ps;2293 2308 FILE *fp; 2294 2309 char *filebuf; branches/lighttpd-1.4.x/src/lempar.c
r1371 r2160 211 211 const char *ParseTokenName(int tokenType){ 212 212 #ifndef NDEBUG 213 if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){213 if( tokenType>0 && (size_t)tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){ 214 214 return yyTokenName[tokenType]; 215 215 }else{ … … 336 336 } 337 337 i += iLookAhead; 338 if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){338 if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ 339 339 #ifdef YYFALLBACK 340 340 int iFallback; /* Fallback token */ … … 379 379 } 380 380 i += iLookAhead; 381 if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){381 if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ 382 382 return yy_default[stateno]; 383 383 }else{ … … 457 457 #ifndef NDEBUG 458 458 if( yyTraceFILE && yyruleno>=0 459 && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){459 && (size_t)yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){ 460 460 fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, 461 461 yyRuleName[yyruleno]); … … 512 512 YYMINORTYPE yyminor /* The minor type of the error token */ 513 513 ){ 514 UNUSED(yymajor); 515 UNUSED(yyminor); 514 516 ParseARG_FETCH; 515 517 #define TOKEN (yyminor.yy0) branches/lighttpd-1.4.x/src/lighttpd-angel.c
r1981 r2160 29 29 static volatile pid_t pid = -1; 30 30 31 #define UNUSED(x) ( (void)(x) ) 32 31 33 static void sigaction_handler(int sig, siginfo_t *si, void *context) { 32 34 int exitcode; 33 35 36 UNUSED(context); 34 37 switch (sig) { 35 38 case SIGINT: … … 60 63 int is_shutdown = 0; 61 64 struct sigaction act; 65 66 UNUSED(argc); 62 67 63 68 /** branches/lighttpd-1.4.x/src/mod_auth.c
r2026 r2160 520 520 handler_t auth_ldap_init(server *srv, mod_auth_plugin_config *s) { 521 521 #ifdef USE_LDAP 522 int ret;522 int ret; 523 523 #if 0 524 if (s->auth_ldap_basedn->used == 0) { 525 log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.base-dn has to be set"); 526 527 return HANDLER_ERROR; 528 } 529 #endif 530 531 if (s->auth_ldap_filter->used) { 532 char *dollar; 533 534 /* parse filter */ 535 536 if (NULL == (dollar = strchr(s->auth_ldap_filter->ptr, '$'))) { 537 log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.filter is missing a replace-operator '$'"); 524 if (s->auth_ldap_basedn->used == 0) { 525 log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.base-dn has to be set"); 526 527 return HANDLER_ERROR; 528 } 529 #endif 530 531 if (s->auth_ldap_filter->used) { 532 char *dollar; 533 534 /* parse filter */ 535 536 if (NULL == (dollar = strchr(s->auth_ldap_filter->ptr, '$'))) { 537 log_error_write(srv, __FILE__, __LINE__, "s", "ldap: auth.backend.ldap.filter is missing a replace-operator '$'"); 538 539 return HANDLER_ERROR; 540 } 541 542 buffer_copy_string_len(s->ldap_filter_pre, s->auth_ldap_filter->ptr, dollar - s->auth_ldap_filter->ptr); 543 buffer_copy_string(s->ldap_filter_post, dollar+1); 544 } 545 546 if (s->auth_ldap_hostname->used) { 547 if (NULL == (s->ldap = ldap_init(s->auth_ldap_hostname->ptr, LDAP_PORT))) { 548 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap ...", strerror(errno)); 549 550 return HANDLER_ERROR; 551 } 552 553 ret = LDAP_VERSION3; 554 if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(s->ldap, LDAP_OPT_PROTOCOL_VERSION, &ret))) { 555 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret)); 556 557 return HANDLER_ERROR; 558 } 559 560 if (s->auth_ldap_starttls) { 561 /* if no CA file is given, it is ok, as we will use encryption 562 * if the server requires a CAfile it will tell us */ 563 if (!buffer_is_empty(s->auth_ldap_cafile)) { 564 if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE, 565 s->auth_ldap_cafile->ptr))) { 566 log_error_write(srv, __FILE__, __LINE__, "ss", 567 "Loading CA certificate failed:", ldap_err2string(ret)); 538 568 539 569 return HANDLER_ERROR; 540 570 } 541 542 buffer_copy_string_len(s->ldap_filter_pre, s->auth_ldap_filter->ptr, dollar - s->auth_ldap_filter->ptr); 543 buffer_copy_string(s->ldap_filter_post, dollar+1); 544 } 545 546 if (s->auth_ldap_hostname->used) { 547 if (NULL == (s->ldap = ldap_init(s->auth_ldap_hostname->ptr, LDAP_PORT))) { 548 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap ...", strerror(errno)); 549 550 return HANDLER_ERROR; 551 } 552 553 ret = LDAP_VERSION3; 554 if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(s->ldap, LDAP_OPT_PROTOCOL_VERSION, &ret))) { 555 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret)); 556 557 return HANDLER_ERROR; 558 } 559 560 if (s->auth_ldap_starttls) { 561 /* if no CA file is given, it is ok, as we will use encryption 562 * if the server requires a CAfile it will tell us */ 563 if (!buffer_is_empty(s->auth_ldap_cafile)) { 564 if (LDAP_OPT_SUCCESS != (ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE, 565 s->auth_ldap_cafile->ptr))) { 566 log_error_write(srv, __FILE__, __LINE__, "ss", 567 "Loading CA certificate failed:", ldap_err2string(ret)); 568 569 return HANDLER_ERROR; 570 } 571 } 572 573 if (LDAP_OPT_SUCCESS != (ret = ldap_start_tls_s(s->ldap, NULL, NULL))) { 574 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap startTLS failed:", ldap_err2string(ret)); 575 576 return HANDLER_ERROR; 577 } 578 } 579 580 581 /* 1. */ 582 if (s->auth_ldap_binddn->used) { 583 if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, s->auth_ldap_binddn->ptr, s->auth_ldap_bindpw->ptr))) { 584 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret)); 585 586 return HANDLER_ERROR; 587 } 588 } else { 589 if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, NULL, NULL))) { 590 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret)); 591 592 return HANDLER_ERROR; 593 } 594 } 595 } 571 } 572 573 if (LDAP_OPT_SUCCESS != (ret = ldap_start_tls_s(s->ldap, NULL, NULL))) { 574 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap startTLS failed:", ldap_err2string(ret)); 575 576 return HANDLER_ERROR; 577 } 578 } 579 580 581 /* 1. */ 582 if (s->auth_ldap_binddn->used) { 583 if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, s->auth_ldap_binddn->ptr, s->auth_ldap_bindpw->ptr))) { 584 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret)); 585 586 return HANDLER_ERROR; 587 } 588 } else { 589 if (LDAP_SUCCESS != (ret = ldap_simple_bind_s(s->ldap, NULL, NULL))) { 590 log_error_write(srv, __FILE__, __LINE__, "ss", "ldap:", ldap_err2string(ret)); 591 592 return HANDLER_ERROR; 593 } 594 } 595 } 596 return HANDLER_GO_ON; 596 597 #else 597 log_error_write(srv, __FILE__, __LINE__, "s", "no ldap support available");598 return HANDLER_ERROR;599 #endif 600 return HANDLER_GO_ON; 598 UNUSED(s); 599 log_error_write(srv, __FILE__, __LINE__, "s", "no ldap support available"); 600 return HANDLER_ERROR; 601 #endif 601 602 } 602 603 branches/lighttpd-1.4.x/src/mod_webdav.c
r1882 r2160 1155 1155 1156 1156 #ifdef USE_LOCKS 1157 UNUSED(srv); 1157 1158 data_string *ds; 1158 1159 … … 1193 1194 } 1194 1195 } 1196 #else 1197 UNUSED(srv); 1198 UNUSED(con); 1199 UNUSED(p); 1200 UNUSED(uri); 1195 1201 #endif 1196 1202 branches/lighttpd-1.4.x/src/plugin.c
r1387 r2160 198 198 #else 199 199 #if 1 200 init = (int (*)(plugin *)) dlsym(p->lib, srv->tmp_buf->ptr);200 init = (int (*)(plugin *))(intptr_t)dlsym(p->lib, srv->tmp_buf->ptr); 201 201 #else 202 202 *(void **)(&init) = dlsym(p->lib, srv->tmp_buf->ptr);

