user/5014: Minor bug in httpd/src/main/http_protocol.c and http_main.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

user/5014: Minor bug in httpd/src/main/http_protocol.c and http_main.c

Alexander Farber
>Number:         5014
>Category:       user
>Synopsis:       Minor bug in httpd/src/main/http_protocol.c and http_main.c
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 09 20:30:02 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     A. Farber
>Release:        -current
>Organization:
net
>Environment:
       
        System      : OpenBSD 3.9
        Architecture: OpenBSD.i386
        Machine     : i386
>Description:
        ap_server_strip_chroot() eventually modifies the first argument,
        so you shouldn't pass a const char * to it or you get warnings:

        cc -c  -I../os/unix -I../include  -O2 -pipe -DDEV_RANDOM=/dev/arandom -DMOD_SSL=208116 -DEAPI `../apaci` http_main.c
        http_main.c: In function `standalone_main':
        http_main.c:3083: warning: passing arg 1 of `ap_server_strip_chroot' discards qualifiers from pointer target type
        cc -c  -I../os/unix -I../include  -O2 -pipe -DDEV_RANDOM=/dev/arandom -DMOD_SSL=208116 -DEAPI `../apaci` http_protocol.c
        http_protocol.c: In function `ap_create_etag_state':
        http_protocol.c:3035: warning: passing arg 1 of `ap_server_strip_chroot' discards qualifiers from pointer target type
        http_protocol.c: In function `ap_read_etag_state':
        http_protocol.c:3078: warning: passing arg 1 of `ap_server_strip_chroot' discards qualifiers from pointer target type

>How-To-Repeat:
        make build
>Fix:

--- http_main.c.OLD Thu Feb  9 21:00:01 2006
+++ http_main.c Thu Feb  9 21:00:43 2006
@@ -3078,7 +3078,7 @@
 
     /* cleanup pid file on normal shutdown */
     {
- const char *pidfile = NULL;
+ char *pidfile = NULL;
  pidfile = ap_server_root_relative (pconf, ap_pid_fname);
  ap_server_strip_chroot(pidfile, 0);
  if ( pidfile != NULL && unlink(pidfile) == 0)

--- http_protocol.c.OLD Thu Feb  9 20:55:24 2006
+++ http_protocol.c Thu Feb  9 20:55:59 2006
@@ -3029,7 +3029,7 @@
     u_int32_t rnd;
     unsigned int u;
     int fd;
-    const char* filename;
+    char* filename;
 
     filename = ap_server_root_relative(pconf, "logs/etag-state");
     ap_server_strip_chroot(filename, 0);
@@ -3067,7 +3067,7 @@
     u_int32_t rnd;
     unsigned int u;
     int fd;
-    const char* filename;
+    char* filename;
 
     ap_SHA1Init(&baseCtx);


>Release-Note:
>Audit-Trail:
>Unformatted: