SOURCES: nss_pgsql-rootconfig.patch - works

aredridel aredridel at pld-linux.org
Thu Nov 17 08:56:11 CET 2005


Author: aredridel                    Date: Thu Nov 17 07:56:11 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- works

---- Files affected:
SOURCES:
   nss_pgsql-rootconfig.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/nss_pgsql-rootconfig.patch
diff -u SOURCES/nss_pgsql-rootconfig.patch:1.1 SOURCES/nss_pgsql-rootconfig.patch:1.2
--- SOURCES/nss_pgsql-rootconfig.patch:1.1	Sat Jul 16 02:06:59 2005
+++ SOURCES/nss_pgsql-rootconfig.patch	Thu Nov 17 08:56:05 2005
@@ -1,13 +1,18 @@
 diff -urN libnss-pgsql-1.3-o/conf/nss-pgsql-root.conf libnss-pgsql-1.3/conf/nss-pgsql-root.conf
 --- libnss-pgsql-1.3-o/conf/nss-pgsql-root.conf	1969-12-31 17:00:00.000000000 -0700
-+++ libnss-pgsql-1.3/conf/nss-pgsql-root.conf	2005-07-15 18:01:23.000000000 -0600
-@@ -0,0 +1,3 @@
-+# Add config directives here that should only be available to
-+# root, such as a username and password that will grant access
-+# to the password column of the shadow table.
++++ libnss-pgsql-1.3/conf/nss-pgsql-root.conf	2005-11-17 00:17:21.000000000 -0700
+@@ -0,0 +1,8 @@
++#----------------- DB connection
++host             = 10.194.3.95
++# For socket give the directory to put the socket
++#host            = /tmp
++port             = 5432
++database         = gforge
++login            = gforge_privileged
++passwd           = rootpass
 diff -urN libnss-pgsql-1.3-o/src/config.c libnss-pgsql-1.3/src/config.c
 --- libnss-pgsql-1.3-o/src/config.c	2005-03-03 10:30:20.000000000 -0700
-+++ libnss-pgsql-1.3/src/config.c	2005-07-15 18:00:31.000000000 -0600
++++ libnss-pgsql-1.3/src/config.c	2005-11-17 00:19:42.000000000 -0700
 @@ -17,6 +17,7 @@
  #define HASHMAX 150
  #define CFGLINEMAX 256
@@ -16,7 +21,7 @@
  
  static char *_options[HASHMAX];
  static unsigned int _isopen = 0;
-@@ -38,10 +39,23 @@
+@@ -38,20 +39,33 @@
  }
  
  /*
@@ -26,9 +31,9 @@
  int readconfig(void)
  {
 +	int ret;
-+	ret = readconfig_with_name(CFGFILE);
++	ret = readconfig_with_name(CFGFILE, 1);
 +	if(geteuid() == 0) {
-+		ret = readconfig_with_name(CFGFILEROOT);
++		ret = readconfig_with_name(CFGFILEROOT, 2);
 +	}
 +	return ret;
 +}
@@ -36,17 +41,39 @@
 +/*
 + * read configfile specified and save values in hashtable
 + */
-+int readconfig_with_name(const char *filename)
++int readconfig_with_name(const char *filename, int olevel)
 +{
  	FILE *cf;
  	char line[CFGLINEMAX], key[CFGLINEMAX], val[CFGLINEMAX], *c;
  	unsigned int h;
-@@ -50,7 +64,7 @@
- 	if(_isopen)
+ 	unsigned int lineno = 0;
+ 
+-	if(_isopen)
++	if(_isopen > olevel)
  		return 1;
  	
 -	if(!(cf = fopen(CFGFILE, "r"))) {
+-		print_msg("could not open config file " CFGFILE "\n");
 +	if(!(cf = fopen(filename, "r"))) {
- 		print_msg("could not open config file " CFGFILE "\n");
++		print_msg("could not open config file %s\n", filename);
  		return 0;
  	}
+ 
+@@ -69,7 +83,7 @@
+ 
+ 		/* read options */
+ 		if(sscanf(line, " %s = %[^\n]", key, val) < 2) {
+-			print_err("line %d in " CFGFILE " is unparseable: \"%s\"\n", lineno, line);
++			print_err("line %d in %s is unparseable: \"%s\"\n", lineno, filename, line);
+ 		} else {
+ 			h = texthash(key);
+ 			_options[h] = malloc(strlen(val)+1);
+@@ -78,7 +92,7 @@
+ 	}
+ 	fclose(cf);
+ 
+-	_isopen = 1;
++	_isopen = _isopen + 1;
+ 	atexit(cleanup);
+ 
+ 	return 1;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/nss_pgsql-rootconfig.patch?r1=1.1&r2=1.2&f=u




More information about the pld-cvs-commit mailing list