? pg_autovacuum/dllist.c
Index: pg_autovacuum/README.pg_autovacuum
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/pg_autovacuum/README.pg_autovacuum,v
retrieving revision 1.14
diff -c -r1.14 README.pg_autovacuum
*** pg_autovacuum/README.pg_autovacuum	19 Apr 2005 03:35:15 -0000	1.14
--- pg_autovacuum/README.pg_autovacuum	24 May 2005 15:36:17 -0000
***************
*** 109,114 ****
--- 109,119 ----
  
    sleep 10    # To give the database some time to start up
    $PGBINS/pg_autovacuum -D -s $SBASE -S $SSCALE ... [other arguments]
+   
+ Note that pg_hba.conf settings may require a password for pg_autovacuum
+ to access your databases. This should be specified in a ~/.pgpass file -
+ see http://www.postgresql.org/docs/8.0/static/libpq-pgpass.html for 
+ details.
  
  Command line arguments:
  -----------------------
***************
*** 130,141 ****
  -L log file: Name of file to which output is submitted, otherwise STDERR
  -U username: Username pg_autovacuum will use to connect with, if not
     specified the current username is used.
- -P password: Password pg_autovacuum will use to connect with. *WARNING*
-    This option is insecure. When installed as a Windows Service, this
-    option will be stored in plain text in the registry. When used with
-    most Unix variants, other users will be able to see the argument to
-    the "-P" option via ps(1). The ~/.pgpass file can be used to
-    specify a password more securely.
  -H host: host name or IP to connect to.
  -p port: port used for connection.
  -h help: list of command line options.
--- 135,140 ----
Index: pg_autovacuum/pg_autovacuum.c
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/pg_autovacuum/pg_autovacuum.c,v
retrieving revision 1.34
diff -c -r1.34 pg_autovacuum.c
*** pg_autovacuum/pg_autovacuum.c	11 May 2005 18:07:14 -0000	1.34
--- pg_autovacuum/pg_autovacuum.c	24 May 2005 15:39:36 -0000
***************
*** 642,653 ****
  		newdbinfo->username = (char *) malloc(strlen(args->user) + 1);
  		strcpy(newdbinfo->username, args->user);
  	}
- 	newdbinfo->password = NULL;
- 	if (args->password != NULL)
- 	{
- 		newdbinfo->password = (char *) malloc(strlen(args->password) + 1);
- 		strcpy(newdbinfo->password, args->password);
- 	}
  	newdbinfo->oid = oid;
  	newdbinfo->age = age;
  	newdbinfo->table_list = DLNewList();
--- 642,647 ----
***************
*** 838,848 ****
  		free(dbi->username);
  		dbi->username = NULL;
  	}
- 	if (dbi->password)
- 	{
- 		free(dbi->password);
- 		dbi->password = NULL;
- 	}
  	if (dbi->table_list)
  	{
  		free_tbl_list(dbi->table_list);
--- 832,837 ----
***************
*** 898,906 ****
  	sprintf(logbuffer, "  username: %s", (dbi->username) ? dbi->username : "(null)");
  	log_entry(logbuffer, LVL_INFO);
  
- 	sprintf(logbuffer, "  password: %s", (dbi->password) ? dbi->password : "(null)");
- 	log_entry(logbuffer, LVL_INFO);
- 
  	if (dbi->conn != NULL)
  		log_entry("  conn is valid, (connected)", LVL_INFO);
  	else
--- 887,892 ----
***************
*** 927,933 ****
  {
  	PGconn	   *db_conn =
  	PQsetdbLogin(args->host, args->port, NULL, NULL, dbi->dbname,
! 				 dbi->username, dbi->password);
  
  	if (PQstatus(db_conn) != CONNECTION_OK)
  	{
--- 913,919 ----
  {
  	PGconn	   *db_conn =
  	PQsetdbLogin(args->host, args->port, NULL, NULL, dbi->dbname,
! 				 dbi->username, NULL);
  
  	if (PQstatus(db_conn) != CONNECTION_OK)
  	{
***************
*** 1084,1091 ****
  	{
  		if (args->user != NULL)
  			free(args->user);
- 		if (args->password != NULL)
- 			free(args->password);
  		free(args);
  	}
  }
--- 1070,1075 ----
***************
*** 1114,1120 ****
  	args->service_password = 0;
  #endif
  	args->user = 0;
- 	args->password = 0;
  	args->host = 0;
  	args->logfile = 0;
  	args->port = 0;
--- 1098,1103 ----
***************
*** 1133,1141 ****
  	 * values etc
  	 */
  #ifndef WIN32
! 	while ((c = getopt(argc, argv, "s:S:v:V:a:A:d:U:P:H:L:p:hDc:C:m:n:l:")) != -1)
  #else
! 	while ((c = getopt(argc, argv, "s:S:v:V:a:A:d:U:P:H:L:p:hIRN:W:E:c:C:m:n:l:")) != -1)
  #endif
  	{
  		switch (c)
--- 1116,1124 ----
  	 * values etc
  	 */
  #ifndef WIN32
! 	while ((c = getopt(argc, argv, "s:S:v:V:a:A:d:U:H:L:p:hDc:C:m:n:l:")) != -1)
  #else
! 	while ((c = getopt(argc, argv, "s:S:v:V:a:A:d:U:H:L:p:hIRN:W:E:c:C:m:n:l:")) != -1)
  #endif
  	{
  		switch (c)
***************
*** 1187,1195 ****
  			case 'U':
  				args->user = optarg;
  				break;
- 			case 'P':
- 				args->password = optarg;
- 				break;
  			case 'H':
  				args->host = optarg;
  				break;
--- 1170,1175 ----
***************
*** 1295,1301 ****
  	fprintf(stderr, "   [-l] vacuum_cost_limit (default=none)\n");
  
  	fprintf(stderr, "   [-U] username (libpq default)\n");
- 	fprintf(stderr, "   [-P] password (libpq default)\n");
  	fprintf(stderr, "   [-H] host (libpq default)\n");
  	fprintf(stderr, "   [-p] port (libpq default)\n");
  
--- 1275,1280 ----
***************
*** 1313,1320 ****
  	log_entry(logbuffer, LVL_INFO);
  	sprintf(logbuffer, "  args->username=%s", (args->user) ? args->user : "(null)");
  	log_entry(logbuffer, LVL_INFO);
- 	sprintf(logbuffer, "  args->password=%s", (args->password) ? args->password : "(null)");
- 	log_entry(logbuffer, LVL_INFO);
  	sprintf(logbuffer, "  args->logfile=%s", (args->logfile) ? args->logfile : "(null)");
  	log_entry(logbuffer, LVL_INFO);
  #ifndef WIN32
--- 1292,1297 ----
***************
*** 1463,1470 ****
  		sprintf(szCommand, "%s -p %s", szCommand, args->port);
  	if (args->user)
  		sprintf(szCommand, "%s -U \"%s\"", szCommand, args->user);
- 	if (args->password)
- 		sprintf(szCommand, "%s -P \"%s\"", szCommand, args->password);
  	if (args->logfile)
  		sprintf(szCommand, "%s -L \"%s\"", szCommand, args->logfile);
  	if (args->sleep_base_value != (int) SLEEPBASEVALUE)
--- 1440,1445 ----
Index: pg_autovacuum/pg_autovacuum.h
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/pg_autovacuum/pg_autovacuum.h,v
retrieving revision 1.15
diff -c -r1.15 pg_autovacuum.h
*** pg_autovacuum/pg_autovacuum.h	19 Apr 2005 03:35:15 -0000	1.15
--- pg_autovacuum/pg_autovacuum.h	24 May 2005 15:41:48 -0000
***************
*** 67,73 ****
  				analyze_scaling_factor,
  				sleep_scaling_factor;
  	char	   *user,
- 			   *password,
  #ifdef WIN32
  			   *service_dependencies,
  			   *service_user,
--- 67,72 ----
***************
*** 91,98 ****
  										 * thresholds */
  	PGconn	   *conn;
  	char	   *dbname,
! 			   *username,
! 			   *password;
  	Dllist	   *table_list;
  } db_info;
  
--- 90,96 ----
  										 * thresholds */
  	PGconn	   *conn;
  	char	   *dbname,
! 			   *username;
  	Dllist	   *table_list;
  } db_info;
  
