[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ggi-develop
Subject:    Re: [ggi-develop] Patch for installing libgii cleanly on mingw.
From:       "Christoph Egger" <Christoph_Egger () gmx ! de>
Date:       2004-08-13 12:22:39
Message-ID: 26988.1092399759 () www23 ! gmx ! net
[Download RAW message or body]

> On win32, when using mingw, mingw relies on msys. msys is a minimal
> system based on cygwin that can run configure scripts and among many
> things provides a mapping from / to c:/whatever, since so many tool
> require paths of the unix kind.
> 
> During build, mingw uses this feature, and /usr and other unixy paths
> are accessible. Also, when running configure, the --prefix option
> requires an absolute path. So, it is not possible to say
> --prefix=c:/whatever (configure requires the path starts with /, I
> think).
> 
> Then, when config.status is run, the prefix path is substituted into the
> lib*.conf files (the .root and .include directive).
> 
> But when the app runs, it does not use msys and the translation from /
> to c:/whatever does not exist. This of course causes problems when
> trying to locate files pointed to from lib*.conf.
> 
> On cygwin this works, as the mapping from / is present for that app as
> well.
> 
> Now, windows is windows and everybody assumes that there is a binary
> distribution. Thus, it would be nice if the lib*.conf files could be
> moved around without too much trouble. After all, the mingw port
> supports the GGI_CONFDIR environment variable for just this purpose. So,
> I'm proposing this patch.
> 
> First, it implements the notion of relative paths in the lib*.conf
> files. I.e. any .root or .include path that does not start with / is
> treated as a path releative to the file that contains the path. This is
> implemented in the gg/conf.c file.
> 
> Then, configure is made to calculate the relative path from
> sysconfdir/ggi to the libdir/ggi and puts this path in the .root
> directive. The rest of the patch takes care of this.
> 
> I'm being conservative here, and this is only done for mingw, where it's
> needed. All other systems still has absolute paths everywhere, even
> though I believe it would be safe to have paths relative to the config
> file everywhere.
> 
> With this patch, it is possible to get libgii going on mingw with the
> usual ./configure && make && make install. Albeit, you have to set some
> environment variables, such as the above GGI_CONFDIR. But there is no
> longer any need to edit installed files.
> 
> I'm posting this here for review, as I might have overlooked something.
> It feels better if more people think about any security implications of
> having a more flexible configuration system. Perhaps the patch to
> gg/conf.c should be #if defined(__WIN32__) && !defined(__CYGWIN__)? But
> is that really needed if the paths in lib*.conf are absolute anyway?

The config file is sensitive to security:

http://marc.theaimsgroup.com/?l=ggi-develop&m=99475016403474&w=2



The modifications the patch makes in gg/conf.c look secure to me.

I'm not sure, if the change from absolute to relative is secure
conceptually.

On the other hand that's the only one way for mingw to have not
to edit the config files after installation.

-- 
CU,

Christoph Egger
E-Mail: Christoph_Egger@gmx.de

NEU: WLAN-Router für 0,- EUR* - auch für DSL-Wechsler!
GMX DSL = supergünstig & kabellos http://www.gmx.net/de/go/dsl



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
ggi-develop mailing list
ggi-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ggi-develop
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic