* support/suexec.c: Add gcc format-string attributes to logging
functions.
(main): Always print uid/gid as unsigned long, and cast to avoid
warnings (which somewhat defeats the point of the format string
attrs, but is necessary since the size of gid/uid varies).
remove an unnecessary check in a nest loop of ap_create_environment()
s/;;/;/
No need to test for NULL before calling apr_pstrdup.
No need it apr_pcalloc here, the memory is fully initialized the line just after
cppCheck: unreadVariable - 'serviceFlag' is not used in the function, so remove it
Remove unused code. "Next week" hasn't happened in the last 10 years or so.
log client error at level debug, log broken Host header value
remove some more old unused code
remove obsolete comment from 1.3 days
Submitted by: jorton, pqf, jailletc36, jailletc36, jailletc36, jailletc36, sf, sf, sf, sf
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1416581 13f79535-47bb-0310-9956-
ffa450edef68
documentation patch : http://apache-doc-fr.gryzor.com/fallbackresource_disabled_2.4_doc.patch
+1: gryzor, covener, sf
- * proposal 1/x: try to keep 2.4.x in line with trunk.
- Only small and trivial patches. No CHANGES needed IMO (maybe needed for 1407006 ?).
- I will propose other ones the same way if you find it interesting.
- 1407004: Remove unused code. "Next week" hasn't happened in the last 10 years or so.
- 1407528: remove obsolete comment from 1.3 days
- 1407088: remove some more old unused code
- 1397636: s/;;/;/
- 1378178: remove an unnecessary check in a nest loop of ap_create_environment()
- 1407006: log client error at level debug, log broken Host header value
- 1337344: support/suexec.c: Add gcc format-string attributes to logging functions.
- 1398481: cppCheck: unreadVariable - 'serviceFlag' is not used in the function, so remove it
- 1398025: No need to test for NULL before calling apr_pstrdup.
- 1398040: No need it apr_pcalloc here, the memory is fully initialized the line just after
- trunk patches:
- http://svn.apache.org/viewvc?view=revision&revision=1407004
- http://svn.apache.org/viewvc?view=revision&revision=1407528
- http://svn.apache.org/viewvc?view=revision&revision=1407088
- http://svn.apache.org/viewvc?view=revision&revision=1397636
- http://svn.apache.org/viewvc?view=revision&revision=1378178
- http://svn.apache.org/viewvc?view=revision&revision=1407006
- http://svn.apache.org/viewvc?view=revision&revision=1337344
- http://svn.apache.org/viewvc?view=revision&revision=1398481
- http://svn.apache.org/viewvc?view=revision&revision=1398025
- http://svn.apache.org/viewvc?view=revision&revision=1398040
- 2.4.x patch:
- http://people.apache.org/~jailletc36/backport.patch
- +1: jailletc36, sf, jim
-
* mod_session_dbd: fix a segmentation fault in the function dbd_remove.
PR 53452
trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1408958
ap_get_server_banner());
ap_rputs(" <BR>\n", r);
ap_rprintf(r, " Server built: \"%s\"\n", ap_get_server_built());
- ap_rputs(" </P>\n", r);;
+ ap_rputs(" </P>\n", r);
ap_rputs(" <P>\n", r);
ap_rputs(" The format for the callback trace is:\n", r);
ap_rputs(" </P>\n", r);
}
p->type = type;
- p->data = data ? apr_pstrdup(arr->pool, data) : NULL;
+ p->data = apr_pstrdup(arr->pool, data);
p->apply_path = apr_pstrcat(arr->pool, path, "*", NULL);
if ((type == BY_PATH) && (!ap_is_matchexp(to))) {
* There are local nonincremental settings, which clear
* all inheritance from above. They *are* the new base settings.
*/
- new->opts = add->opts;;
+ new->opts = add->opts;
}
/*
* We're guaranteed that there'll be no overlap between
*binddn = apr_pstrdup(r->pool, search_nodep->dn);
if (attrs) {
int i;
- *retvals = apr_pcalloc(r->pool, sizeof(char *) * search_nodep->numvals);
+ *retvals = apr_palloc(r->pool, sizeof(char *) * search_nodep->numvals);
for (i = 0; i < search_nodep->numvals; i++) {
(*retvals)[i] = apr_pstrdup(r->pool, search_nodep->vals[i]);
}
pl = ap_open_piped_log(p, name + 1);
if (pl == NULL) {
- return NULL;;
+ return NULL;
}
return ap_piped_log_write_fd(pl);
}
apr_table_setn(z->entries, SESSION_EXPIRY, expiry);
}
apr_table_do((int (*) (void *, const char *, const char *))
- identity_count, &length, z->entries, NULL);;
+ identity_count, &length, z->entries, NULL);
buffer = apr_pcalloc(r->pool, length + 1);
apr_table_do((int (*) (void *, const char *, const char *))
identity_concat, buffer, z->entries, NULL);
result = ssl_var_lookup_ssl_cert_PEM(p, xs);
}
- if (result != NULL && resdup)
+ if (resdup)
result = apr_pstrdup(p, result);
return result;
}
h = apr_bucket_alloc(sizeof(*h), b->list);
h->status = error;
- h->data = (buf) ? apr_pstrdup(p, buf) : NULL;
+ h->data = apr_pstrdup(p, buf);
b = apr_bucket_shared_make(b, h, 0, 0);
b->type = &ap_bucket_type_error;
const char *uri;
const char *pro;
-#if 0
- conn_rec *conn = r->connection;
-#endif
int major = 1, minor = 0; /* Assume HTTP/1.0 if non-"HTTP" protocol */
char http[5];
apr_size_t len;
ap_escape_logitem(r->pool, r->the_request));
}
- /* we've probably got something to do, ignore graceful restart requests */
-
r->request_time = apr_time_now();
ll = r->the_request;
r->method = ap_getword_white(r->pool, &ll);
-#if 0
-/* XXX If we want to keep track of the Method, the protocol module should do
- * it. That support isn't in the scoreboard yet. Hopefully next week
- * sometime. rbb */
- ap_update_connection_status(AP_CHILD_THREAD_FROM_ID(conn->id), "Method",
- r->method);
-#endif
-
uri = ap_getword_white(r->pool, &ll);
/* Provide quick information about the request method as soon as known */
}
r->protocol = apr_pstrmemdup(r->pool, pro, len);
- /* XXX ap_update_connection_status(conn->id, "Protocol", r->protocol); */
-
/* Avoid sscanf in the common case */
if (len == 8
&& pro[0] == 'H' && pro[1] == 'T' && pro[2] == 'T' && pro[3] == 'P'
if (global_providers == NULL) {
global_providers = apr_hash_make(pool);
- global_providers_names = apr_hash_make(pool);;
+ global_providers_names = apr_hash_make(pool);
apr_pool_cleanup_register(pool, NULL, cleanup_global_providers,
apr_pool_cleanup_null);
}
*whack++ = '_';
}
while (*whack != '=') {
- if (!apr_isalnum(*whack) && *whack != '_') {
+ if (!apr_isalnum(*whack)) {
*whack = '_';
}
++whack;
bad:
r->status = HTTP_BAD_REQUEST;
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00550)
- "Client sent malformed Host header");
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00550)
+ "Client sent malformed Host header: %s",
+ r->hostname);
return;
}
NULL
};
+static void log_err(const char *fmt,...)
+ __attribute__((format(printf,1,2)));
+static void log_no_err(const char *fmt,...)
+ __attribute__((format(printf,1,2)));
+static void err_output(int is_error, const char *fmt, va_list ap)
+ __attribute__((format(printf,2,0)));
static void err_output(int is_error, const char *fmt, va_list ap)
{
*/
uid = getuid();
if ((pw = getpwuid(uid)) == NULL) {
- log_err("crit: invalid uid: (%ld)\n", uid);
+ log_err("crit: invalid uid: (%lu)\n", (unsigned long)uid);
exit(102);
}
/*
* a UID less than AP_UID_MIN. Tsk tsk.
*/
if ((uid == 0) || (uid < AP_UID_MIN)) {
- log_err("cannot run as forbidden uid (%d/%s)\n", uid, cmd);
+ log_err("cannot run as forbidden uid (%lu/%s)\n", (unsigned long)uid, cmd);
exit(107);
}
* or as a GID less than AP_GID_MIN. Tsk tsk.
*/
if ((gid == 0) || (gid < AP_GID_MIN)) {
- log_err("cannot run as forbidden gid (%d/%s)\n", gid, cmd);
+ log_err("cannot run as forbidden gid (%lu/%s)\n", (unsigned long)gid, cmd);
exit(108);
}
* and setgid() to the target group. If unsuccessful, error out.
*/
if (((setgid(gid)) != 0) || (initgroups(actual_uname, gid) != 0)) {
- log_err("failed to setgid (%ld: %s)\n", gid, cmd);
+ log_err("failed to setgid (%lu: %s)\n", (unsigned long)gid, cmd);
exit(109);
}
* setuid() to the target user. Error out on fail.
*/
if ((setuid(uid)) != 0) {
- log_err("failed to setuid (%ld: %s)\n", uid, cmd);
+ log_err("failed to setuid (%lu: %s)\n", (unsigned long)uid, cmd);
exit(110);
}
(gid != dir_info.st_gid) ||
(uid != prg_info.st_uid) ||
(gid != prg_info.st_gid)) {
- log_err("target uid/gid (%ld/%ld) mismatch "
- "with directory (%ld/%ld) or program (%ld/%ld)\n",
- uid, gid,
- dir_info.st_uid, dir_info.st_gid,
- prg_info.st_uid, prg_info.st_gid);
+ log_err("target uid/gid (%lu/%lu) mismatch "
+ "with directory (%lu/%lu) or program (%lu/%lu)\n",
+ (unsigned long)uid, (unsigned long)gid,
+ (unsigned long)dir_info.st_uid, (unsigned long)dir_info.st_gid,
+ (unsigned long)prg_info.st_uid, (unsigned long)prg_info.st_gid);
exit(120);
}
/*
{
TCHAR szMsg[MAX_PATH];
BOOL retValue;
- BOOL serviceFlag = TRUE;
SC_HANDLE schService;
SC_HANDLE schSCManager;
SERVICE_STATUS schSStatus;