src/hg/lib/hgConfig.c 1.22
1.22 2009/10/06 16:51:43 angie
Don't require user-read-only for included files (just ~/.hg.conf itself). This allows us to include our cgi-bin-\angie/hg.conf files, and simply override the db.user and password in ~/.hg.conf.
Index: src/hg/lib/hgConfig.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/hgConfig.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -b -B -U 4 -r1.21 -r1.22
--- src/hg/lib/hgConfig.c 27 Aug 2009 23:09:51 -0000 1.21
+++ src/hg/lib/hgConfig.c 6 Oct 2009 16:51:43 -0000 1.22
@@ -45,15 +45,15 @@
return FALSE;
#endif
}
-static void checkConfigPerms(char *filename)
+static void checkConfigPerms(char *filename, int depth)
/* get that we are either a CGI or that the config file is only readable by
* the user, or doesn't exist. Specifying HGDB_CONF also disables perms
* check to make debugging and having CGIs run loaders easier */
{
struct stat statBuf;
-if ((!isBrowserCgi()) && isEmpty(getenv("HGDB_CONF"))
+if ((!isBrowserCgi()) && isEmpty(getenv("HGDB_CONF")) && depth == 0
&& (stat(filename, &statBuf) == 0))
{
if ((statBuf.st_mode & (S_IRWXG|S_IRWXO)) != 0)
errAbort("config file %s allows group or other access, must only allow user access",
@@ -157,9 +157,9 @@
static void parseConfigFile(char *filename, int depth)
/* open and parse a config file */
{
-checkConfigPerms(filename);
+checkConfigPerms(filename, depth);
struct lineFile *lf = lineFileOpen(filename, TRUE);
char *line;
while(lineFileNext(lf, &line, NULL))
{