Bugzilla – Bug 321633
[patch] sanitize uname() result in io-layer/shared.c
Last modified: 2007-09-15 21:24:46 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".