You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Greg Ames <gr...@raleigh.ibm.com> on 2001/01/30 20:46:16 UTC

[Beta blocker] apr_get_username undefined, BSD w/dso

I still don't have an apr_get_username symbol in the httpd executable on
apache.org.  server/exports.c doesn't have it or any of the others that
should come from apr/include/apr_user.h; same story with
apr/apr.exports.  

If you feed apr_user.h into apr/helpers/make_export.pl (Ryan's perl
prototype), it does the Right Thing. If you feed it into
apr/helpers/make_export.awk (what the build uses), it produces nada,
nil, zip, nothing.  Feeding other header files into make_export.awk does
the Right Thing:

[gregames@gandalf apr]$ awk -f helpers/make_export.awk
include/apr_xlate.h
APR_HAS_XLATE
        apr_xlate_open
        apr_xlate_get_sb
        apr_xlate_conv_buffer
APR_NOT_DONE_YET
                apr_xlate_conv_char
/APR_NOT_DONE_YET
        apr_xlate_close
/APR_HAS_XLATE
[gregames@gandalf apr]$ awk -f helpers/make_export.awk
include/apr_user.h
[gregames@gandalf apr]$

You can repro this part of it on Linux - piece of cake.  The only hard
part is figuring out what the awk program doesn't like about apr_user.h
.  Any awk experts out there?

Greg

Re: [Beta blocker] apr_get_username undefined, BSD w/dso

Posted by Jeff Trawick <tr...@bellsouth.net>.
Greg Ames <gr...@raleigh.ibm.com> writes:

> You can repro this part of it on Linux - piece of cake.  The only hard
> part is figuring out what the awk program doesn't like about
> apr_user.h

If I simply remove this section of code

#if defined(WIN32)
APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t
right);
#else
#define apr_compare_users(left,right) ((left == right) ? APR_SUCCESS :
APR_EMISMATCH)
#endif

then make_export.awk starts spitting out

APR_HAS_USER
        apr_get_username
        apr_get_home_directory
        apr_get_groupname
defined(WIN32)
                apr_compare_groups
/defined(WIN32)
/APR_HAS_USER

(instead of spitting out nothing)

Note that I am able to leave in another similar pattern for
apr_compare_groups() with no ill effects.  I guess the parse state
gets messed up when we have two of these in the file?

> .  Any awk experts out there?

not here :)  I'll keep staring at it for a while longer though...

Aside: I wonder why mod_include as a DSO loaded for me fine yesterday 
evening.  I should have hit the same problem.

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: [Beta blocker] apr_get_username undefined, BSD w/dso

Posted by Jeff Trawick <tr...@bellsouth.net>.
"Brian Havard" <br...@kheldar.apana.org.au> writes:

> Oops, well I did say it wasn't fully tested. Try this one:

I'll commit it ASAP.

Thanks a bunch!

--- apr.exports Wed Jan 31 13:18:26 2001
+++ apr.exports.brian   Wed Jan 31 13:15:24 2001
@@ -4,6 +4,7 @@
        apr_dso_sym
        apr_dso_error
 /APR_HAS_DSO
+apr_strerror
 apr_stat
 apr_lstat
 apr_dir_open
@@ -259,6 +260,17 @@
 apr_rfc822_date
 apr_ctime
 apr_strftime
+APR_HAS_USER
+       apr_get_username
+       apr_get_home_directory
+defined(WIN32)
+               apr_compare_users
+/defined(WIN32)
+       apr_get_groupname
+defined(WIN32)
+               apr_compare_groups
+/defined(WIN32)
+/APR_HAS_USER
 apr_get_uuid
 apr_format_uuid
 apr_parse_uuid

--- exports.c   Wed Jan 31 13:18:29 2001
+++ exports.c.brian     Wed Jan 31 13:15:27 2001
@@ -81,6 +81,7 @@
 const void *ap_hack_apr_dso_sym = (const void *)apr_dso_sym;
 const void *ap_hack_apr_dso_error = (const void *)apr_dso_error;
 #endif /* APR_HAS_DSO */
+const void *ap_hack_apr_strerror = (const void *)apr_strerror;
 const void *ap_hack_apr_stat = (const void *)apr_stat;
 const void *ap_hack_apr_lstat = (const void *)apr_lstat;
 const void *ap_hack_apr_dir_open = (const void *)apr_dir_open;
@@ -334,6 +335,17 @@
 const void *ap_hack_apr_rfc822_date = (const void *)apr_rfc822_date;
 const void *ap_hack_apr_ctime = (const void *)apr_ctime;
 const void *ap_hack_apr_strftime = (const void *)apr_strftime;
+#if APR_HAS_USER
+const void *ap_hack_apr_get_username = (const void
*)apr_get_username;
+const void *ap_hack_apr_get_home_directory = (const void
*)apr_get_home_directory;
+#if defined(WIN32)
+const void *ap_hack_apr_compare_users = (const void
*)apr_compare_users;
+#endif /* defined(WIN32) */
+const void *ap_hack_apr_get_groupname = (const void
*)apr_get_groupname;
+#if defined(WIN32)
+const void *ap_hack_apr_compare_groups = (const void
*)apr_compare_groups;
+#endif /* defined(WIN32) */
+#endif /* APR_HAS_USER */
 const void *ap_hack_apr_get_uuid = (const void *)apr_get_uuid;
 const void *ap_hack_apr_format_uuid = (const void *)apr_format_uuid;
 const void *ap_hack_apr_parse_uuid = (const void *)apr_parse_uuid;

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: [Beta blocker] apr_get_username undefined, BSD w/dso

Posted by Brian Havard <br...@kheldar.apana.org.au>.
On 30 Jan 2001 20:45:24 -0500, Jeff Trawick wrote:

>"Brian Havard" <br...@kheldar.apana.org.au> writes:
>
>> Try this (not fully tested)
>
>I'm afraid that we win some and we lose some with this patch :)
>
>Here is a comparison of exports.c as built with the old awk file
>vs. the one built with the new one.

Oops, well I did say it wasn't fully tested. Try this one:

Index: make_export.awk
===================================================================
RCS file: /home/cvs/apr/helpers/make_export.awk,v
retrieving revision 1.4
diff -u -r1.4 make_export.awk
--- make_export.awk	2000/12/22 14:32:37	1.4
+++ make_export.awk	2001/01/31 12:26:52
@@ -11,7 +11,6 @@
 	}
 	macro_stack[macro_no++] = macro
 	macro = substr($0, length($1)+2)
-	found++
 	count++
 	line = line macro "\n"
 	next
@@ -23,17 +22,17 @@
 		line = line "/" macro "\n"
 		macro = macro_stack[--macro_no]
 	}
-	if (found == count + 1) {
-		found--
+	if (count == 0) {
+		if (found != 0) {
+			printf("%s", line)
+		}
 		line = ""
-	} else if (found > count + 1) {
-		found = 0
 	}
 	next
 }
 
 /^[ \t]*(AP[RU]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ {
-	if (found) {
+	if (count) {
 		found++
 	}
 	for (i = 0; i < count; i++) {
@@ -42,6 +41,11 @@
 	sub("^[ \t]*(AP[UR]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?", "");
 	sub("[(].*", "");
 	line = line $0 "\n"
+
+	if (count == 0) {
+		printf("%s", line)
+		line = ""
+	}
 	next
 }
 

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Re: [Beta blocker] apr_get_username undefined, BSD w/dso

Posted by Jeff Trawick <tr...@bellsouth.net>.
"Brian Havard" <br...@kheldar.apana.org.au> writes:

> Try this (not fully tested)

I'm afraid that we win some and we lose some with this patch :)

Here is a comparison of exports.c as built with the old awk file
vs. the one built with the new one.

--- server/exports.c.original	Mon Jan 29 19:42:12 2001
+++ server/exports.c	Tue Jan 30 20:50:44 2001
@@ -82,49 +82,6 @@
 const void *ap_hack_apr_dso_sym = (const void *)apr_dso_sym;
 const void *ap_hack_apr_dso_error = (const void *)apr_dso_error;
 #endif /* APR_HAS_DSO */
-const void *ap_hack_apr_stat = (const void *)apr_stat;
-const void *ap_hack_apr_lstat = (const void *)apr_lstat;
-const void *ap_hack_apr_dir_open = (const void *)apr_dir_open;
-const void *ap_hack_apr_dir_close = (const void *)apr_dir_close;
-const void *ap_hack_apr_dir_read = (const void *)apr_dir_read;
-const void *ap_hack_apr_dir_rewind = (const void *)apr_dir_rewind;
-const void *ap_hack_apr_open = (const void *)apr_open;
-const void *ap_hack_apr_close = (const void *)apr_close;
-const void *ap_hack_apr_remove_file = (const void *)apr_remove_file;
-const void *ap_hack_apr_rename_file = (const void *)apr_rename_file;
-const void *ap_hack_apr_eof = (const void *)apr_eof;
-const void *ap_hack_apr_ferror = (const void *)apr_ferror;
-const void *ap_hack_apr_open_stderr = (const void *)apr_open_stderr;
-const void *ap_hack_apr_open_stdout = (const void *)apr_open_stdout;
-const void *ap_hack_apr_read = (const void *)apr_read;
-const void *ap_hack_apr_write = (const void *)apr_write;
-const void *ap_hack_apr_writev = (const void *)apr_writev;
-const void *ap_hack_apr_full_read = (const void *)apr_full_read;
-const void *ap_hack_apr_full_write = (const void *)apr_full_write;
-const void *ap_hack_apr_putc = (const void *)apr_putc;
-const void *ap_hack_apr_getc = (const void *)apr_getc;
-const void *ap_hack_apr_ungetc = (const void *)apr_ungetc;
-const void *ap_hack_apr_fgets = (const void *)apr_fgets;
-const void *ap_hack_apr_puts = (const void *)apr_puts;
-const void *ap_hack_apr_flush = (const void *)apr_flush;
-const void *ap_hack_apr_dupfile = (const void *)apr_dupfile;
-const void *ap_hack_apr_seek = (const void *)apr_seek;
-const void *ap_hack_apr_create_pipe = (const void *)apr_create_pipe;
-const void *ap_hack_apr_create_namedpipe = (const void *)apr_create_namedpipe;
-const void *ap_hack_apr_get_pipe_timeout = (const void *)apr_get_pipe_timeout;
-const void *ap_hack_apr_set_pipe_timeout = (const void *)apr_set_pipe_timeout;
-const void *ap_hack_apr_lock_file = (const void *)apr_lock_file;
-const void *ap_hack_apr_unlock_file = (const void *)apr_unlock_file;
-const void *ap_hack_apr_get_filename = (const void *)apr_get_filename;
-const void *ap_hack_apr_get_filedata = (const void *)apr_get_filedata;
-const void *ap_hack_apr_set_filedata = (const void *)apr_set_filedata;
-const void *ap_hack_apr_fprintf = (const void *)apr_fprintf;
-const void *ap_hack_apr_setfileperms = (const void *)apr_setfileperms;
-const void *ap_hack_apr_make_dir = (const void *)apr_make_dir;
-const void *ap_hack_apr_remove_dir = (const void *)apr_remove_dir;
-const void *ap_hack_apr_getfileinfo = (const void *)apr_getfileinfo;
-const void *ap_hack_apr_fnmatch = (const void *)apr_fnmatch;
-const void *ap_hack_apr_is_fnmatch = (const void *)apr_is_fnmatch;
 #if APR_HAS_RANDOM
 const void *ap_hack_apr_generate_random_bytes = (const void *)apr_generate_random_bytes;
 #endif /* APR_HAS_RANDOM */
@@ -141,19 +98,6 @@
 const void *ap_hack_apr_hash_next = (const void *)apr_hash_next;
 const void *ap_hack_apr_hash_this = (const void *)apr_hash_this;
 const void *ap_hack_apr_hash_count = (const void *)apr_hash_count;
-const void *ap_hack_apr_filename_of_pathname = (const void *)apr_filename_of_pathname;
-const void *ap_hack_apr_vformatter = (const void *)apr_vformatter;
-const void *ap_hack_apr_validate_password = (const void *)apr_validate_password;
-const void *ap_hack_apr_snprintf = (const void *)apr_snprintf;
-const void *ap_hack_apr_vsnprintf = (const void *)apr_vsnprintf;
-const void *ap_hack_apr_getpass = (const void *)apr_getpass;
-const void *ap_hack_apr_create_lock = (const void *)apr_create_lock;
-const void *ap_hack_apr_lock = (const void *)apr_lock;
-const void *ap_hack_apr_unlock = (const void *)apr_unlock;
-const void *ap_hack_apr_destroy_lock = (const void *)apr_destroy_lock;
-const void *ap_hack_apr_child_init_lock = (const void *)apr_child_init_lock;
-const void *ap_hack_apr_get_lockdata = (const void *)apr_get_lockdata;
-const void *ap_hack_apr_set_lockdata = (const void *)apr_set_lockdata;
 const void *ap_hack_apr_MD5Init = (const void *)apr_MD5Init;
 #if APR_HAS_XLATE
 const void *ap_hack_apr_MD5SetXlate = (const void *)apr_MD5SetXlate;
@@ -257,33 +201,6 @@
 const void *ap_hack_apr_set_shm_name = (const void *)apr_set_shm_name;
 const void *ap_hack_apr_open_shmem = (const void *)apr_open_shmem;
 const void *ap_hack_apr_shm_avail = (const void *)apr_shm_avail;
-const void *ap_hack_apr_strnatcmp = (const void *)apr_strnatcmp;
-const void *ap_hack_apr_strnatcasecmp = (const void *)apr_strnatcasecmp;
-const void *ap_hack_apr_pstrdup = (const void *)apr_pstrdup;
-const void *ap_hack_apr_pstrndup = (const void *)apr_pstrndup;
-const void *ap_hack_apr_pstrcat = (const void *)apr_pstrcat;
-const void *ap_hack_apr_pvsprintf = (const void *)apr_pvsprintf;
-const void *ap_hack_apr_psprintf = (const void *)apr_psprintf;
-const void *ap_hack_apr_cpystrn = (const void *)apr_cpystrn;
-const void *ap_hack_apr_collapse_spaces = (const void *)apr_collapse_spaces;
-const void *ap_hack_apr_tokenize_to_argv = (const void *)apr_tokenize_to_argv;
-const void *ap_hack_apr_make_array = (const void *)apr_make_array;
-const void *ap_hack_apr_push_array = (const void *)apr_push_array;
-const void *ap_hack_apr_array_cat = (const void *)apr_array_cat;
-const void *ap_hack_apr_array_pstrcat = (const void *)apr_array_pstrcat;
-const void *ap_hack_apr_make_table = (const void *)apr_make_table;
-const void *ap_hack_apr_copy_table = (const void *)apr_copy_table;
-const void *ap_hack_apr_clear_table = (const void *)apr_clear_table;
-const void *ap_hack_apr_table_get = (const void *)apr_table_get;
-const void *ap_hack_apr_table_set = (const void *)apr_table_set;
-const void *ap_hack_apr_table_setn = (const void *)apr_table_setn;
-const void *ap_hack_apr_table_unset = (const void *)apr_table_unset;
-const void *ap_hack_apr_table_merge = (const void *)apr_table_merge;
-const void *ap_hack_apr_table_mergen = (const void *)apr_table_mergen;
-const void *ap_hack_apr_table_add = (const void *)apr_table_add;
-const void *ap_hack_apr_table_addn = (const void *)apr_table_addn;
-const void *ap_hack_apr_overlay_tables = (const void *)apr_overlay_tables;
-const void *ap_hack_apr_overlap_tables = (const void *)apr_overlap_tables;
 const void *ap_hack_apr_create_threadattr = (const void *)apr_create_threadattr;
 const void *ap_hack_apr_setthreadattr_detach = (const void *)apr_setthreadattr_detach;
 const void *ap_hack_apr_getthreadattr_detach = (const void *)apr_getthreadattr_detach;
@@ -335,6 +252,17 @@
 const void *ap_hack_apr_rfc822_date = (const void *)apr_rfc822_date;
 const void *ap_hack_apr_ctime = (const void *)apr_ctime;
 const void *ap_hack_apr_strftime = (const void *)apr_strftime;
+#if APR_HAS_USER
+const void *ap_hack_apr_get_username = (const void *)apr_get_username;
+const void *ap_hack_apr_get_home_directory = (const void *)apr_get_home_directory;
+#if defined(WIN32)
+const void *ap_hack_apr_compare_users = (const void *)apr_compare_users;
+#endif /* defined(WIN32) */
+const void *ap_hack_apr_get_groupname = (const void *)apr_get_groupname;
+#if defined(WIN32)
+const void *ap_hack_apr_compare_groups = (const void *)apr_compare_groups;
+#endif /* defined(WIN32) */
+#endif /* APR_HAS_USER */
 const void *ap_hack_apr_get_uuid = (const void *)apr_get_uuid;
 const void *ap_hack_apr_format_uuid = (const void *)apr_format_uuid;
 const void *ap_hack_apr_parse_uuid = (const void *)apr_parse_uuid;


-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: [Beta blocker] apr_get_username undefined, BSD w/dso

Posted by Brian Havard <br...@kheldar.apana.org.au>.
On Tue, 30 Jan 2001 14:46:16 -0500, Greg Ames wrote:

>I still don't have an apr_get_username symbol in the httpd executable on
>apache.org.  server/exports.c doesn't have it or any of the others that
>should come from apr/include/apr_user.h; same story with
>apr/apr.exports.  
>
>If you feed apr_user.h into apr/helpers/make_export.pl (Ryan's perl
>prototype), it does the Right Thing. If you feed it into
>apr/helpers/make_export.awk (what the build uses), it produces nada,
>nil, zip, nothing.  Feeding other header files into make_export.awk does
>the Right Thing:
>
>[gregames@gandalf apr]$ awk -f helpers/make_export.awk
>include/apr_xlate.h
>APR_HAS_XLATE
>        apr_xlate_open
>        apr_xlate_get_sb
>        apr_xlate_conv_buffer
>APR_NOT_DONE_YET
>                apr_xlate_conv_char
>/APR_NOT_DONE_YET
>        apr_xlate_close
>/APR_HAS_XLATE
>[gregames@gandalf apr]$ awk -f helpers/make_export.awk
>include/apr_user.h
>[gregames@gandalf apr]$
>
>You can repro this part of it on Linux - piece of cake.  The only hard
>part is figuring out what the awk program doesn't like about apr_user.h
>.  Any awk experts out there?

Try this (not fully tested)

Index: make_export.awk
===================================================================
RCS file: /home/cvs/apr/helpers/make_export.awk,v
retrieving revision 1.4
diff -u -r1.4 make_export.awk
--- make_export.awk	2000/12/22 14:32:37	1.4
+++ make_export.awk	2001/01/30 23:52:35
@@ -11,7 +11,6 @@
 	}
 	macro_stack[macro_no++] = macro
 	macro = substr($0, length($1)+2)
-	found++
 	count++
 	line = line macro "\n"
 	next
@@ -23,17 +22,17 @@
 		line = line "/" macro "\n"
 		macro = macro_stack[--macro_no]
 	}
-	if (found == count + 1) {
-		found--
+	if (count == 0) {
+		if (found != 0) {
+			printf("%s", line)
+		}
 		line = ""
-	} else if (found > count + 1) {
-		found = 0
 	}
 	next
 }
 
 /^[ \t]*(AP[RU]?_DECLARE[^(]*[(])?(const[ \t])?[a-z_]+[ \t\*]*[)]?[ \t]+[*]?([A-Za-z0-9_]+)\(/ {
-	if (found) {
+	if (count) {
 		found++
 	}
 	for (i = 0; i < count; i++) {

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------