Bug 321633 (MONO78917) - [patch] sanitize uname() result in io-layer/shared.c
Summary: [patch] sanitize uname() result in io-layer/shared.c
Status: RESOLVED FIXED
Alias: MONO78917
Product: Mono: Runtime
Classification: Mono
Component: io-layer (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Dick Porter
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-21 10:02 UTC by petr.salinger
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:04:18 UTC


---- Reported by petr.salinger@seznam.cz 2006-07-21 03:02:41 MST ----

Hi,

I tried to build mono on GNU/kFreeBSD,
there is problem with _wapi_shm_file().

On GNU/kFreeBSD "operating system name"/"kernel name" contains "/":

$ uname
GNU/kFreeBSD

$ uname -a
GNU/kFreeBSD orion-bsd.eurosignal.cz 6.1-1-686 #2 Tue Jun 27 15:08:38 CEST 
2006 i686 i386 Intel(R) Pentium(R) 4 CPU 1.60GHz GNU/kFreeBSD


So, the generated filename contains extra directory part.

Please, could you sanitize uname() result. 
For GNU/kFreeBSD case is sufficient patch bellow.

Thanks

Petr

--- mono/io-layer/shared.c.ORIG 2006-07-21 10:06:30.000000000 +0200
+++ mono/io-layer/shared.c      2006-07-21 10:07:27.000000000 +0200
@@ -43,6 +43,11 @@
        if (ret == -1) {
                ubuf.machine[0] = '\0';
                ubuf.sysname[0] = '\0';
+       } else {
+               char *p = ubuf.sysname;
+               while ((p = strchr(p, '\\'))) *p = '_';
+               p = ubuf.machine;
+               while ((p = strchr(p, '\\'))) *p = '_';
        }
 
        fake_name = g_getenv ("MONO_SHARED_HOSTNAME");



---- Additional Comments From dick@ximian.com 2006-07-25 09:41:28 MST ----

Fixed in svn r62955


Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>GNU/kFreeBSD</cf_op_sys_details>
Unknown operating system other. Setting to default OS "Other".