diff --git a/lib/modules/Sql.pmod/Sql.pike b/lib/modules/Sql.pmod/Sql.pike index d97f4ad44bcd5f695058cf2a1603709747c35101..11f10623d4fe32ca95cc7b5755619c686380e1f3 100644 --- a/lib/modules/Sql.pmod/Sql.pike +++ b/lib/modules/Sql.pmod/Sql.pike @@ -1,5 +1,5 @@ /* - * $Id: Sql.pike,v 1.89 2007/02/27 17:45:58 grubba Exp $ + * $Id: Sql.pike,v 1.90 2008/01/09 14:26:07 mast Exp $ * * Implements the generic parts of the SQL-interface * @@ -170,10 +170,15 @@ static program find_dbm(string program_name) { //! @note //! Support for @[options] was added in Pike 7.3. //! -void create(string|object host, void|string|mapping(string:int|string) db, - void|string user, void|string password, +void create(string|object _host, void|string|mapping(string:int|string) db, + void|string user, void|string _password, void|mapping(string:int|string) options) { + // _host is censored only if we pick out a password from it below. + void|string|object host = _host; + string password = _password; + _password = "CENSORED"; + if (objectp(host)) { master_sql = host; if ((user && user != "") || (password && password != "") || @@ -230,6 +235,8 @@ void create(string|object host, void|string|mapping(string:int|string) db, if (password == "") { password = 0; } + else + _host = "CENSORED"; } } arr = host/"/"; diff --git a/lib/modules/Sql.pmod/mysql.pike b/lib/modules/Sql.pmod/mysql.pike index bf4c1acd27b2508a864e1eeb2bc02edb15dd2693..d60f237bb41b2091eb8ab8d4c7e56c3a87fae61d 100644 --- a/lib/modules/Sql.pmod/mysql.pike +++ b/lib/modules/Sql.pmod/mysql.pike @@ -1,5 +1,5 @@ /* - * $Id: mysql.pike,v 1.39 2007/05/26 13:53:26 mast Exp $ + * $Id: mysql.pike,v 1.40 2008/01/09 14:26:07 mast Exp $ * * Glue for the Mysql-module */ @@ -804,9 +804,12 @@ int(0..1) is_keyword( string name ) } static void create(string|void host, string|void database, - string|void user, string|void password, + string|void user, string|void _password, mapping(string:string|int)|void options) { + string password = _password; + _password = "CENSORED"; + if (options) { string charset = options->mysql_charset_name ? lower_case (options->mysql_charset_name) : "latin1"; diff --git a/lib/modules/Sql.pmod/postgres.pike b/lib/modules/Sql.pmod/postgres.pike index 90f4dcde1f05f7b484bf4ea81d24f31de9d55480..3ad35e4999612ccf8a2b83dd0afec453e6ebf713 100644 --- a/lib/modules/Sql.pmod/postgres.pike +++ b/lib/modules/Sql.pmod/postgres.pike @@ -1,7 +1,7 @@ /* * This is part of the Postgres module for Pike. * - * $Id: postgres.pike,v 1.26 2006/06/06 03:26:00 adam Exp $ + * $Id: postgres.pike,v 1.27 2008/01/09 14:26:07 mast Exp $ * */ @@ -153,7 +153,9 @@ static private int mkbool(string s) { //! @seealso //! @[Postgres.postgres], @[Sql.Sql], @[postgres->select_db] void create(void|string host, void|string database, void|string user, - void|string pass) { + void|string _pass) { + string pass = _pass; + _pass = "CENSORED"; string real_host=host, real_db=database; int port=0; quote = this->_quote ? this->_quote : simple_quote; diff --git a/lib/modules/Sql.pmod/rsql.pike b/lib/modules/Sql.pmod/rsql.pike index 90b7f172699f7cb8f9f8c4cac02355d5d88210da..569a111e890e3c99a48d7bf4365cbb5a684a5c2a 100644 --- a/lib/modules/Sql.pmod/rsql.pike +++ b/lib/modules/Sql.pmod/rsql.pike @@ -224,8 +224,11 @@ array(mapping(string:mixed)) query(mixed ... args) return do_request('@', args); } -void create(string|void host, string|void db, string|void user, string|void pw) +void create(string|void host, string|void db, string|void user, string|void _pw) { + string pw = _pw; + _pw = "CENSORED"; + // Reconstruct the original URL (minus rsql://) if(!host) { diff --git a/lib/modules/Sql.pmod/sybase.pike b/lib/modules/Sql.pmod/sybase.pike index 6444d6bd1c209f2bab4b44d88ad401b5f5e477ec..18d59bbbfb513a80e13da40ef18e8e06a08f3b26 100644 --- a/lib/modules/Sql.pmod/sybase.pike +++ b/lib/modules/Sql.pmod/sybase.pike @@ -2,7 +2,7 @@ * Sybase driver for the Pike programming language. * By Francesco Chemolli <kinkie@roxen.com> 10/12/1999 * - * $Id: sybase.pike,v 1.10 2004/04/16 12:12:46 grubba Exp $ + * $Id: sybase.pike,v 1.11 2008/01/09 14:26:07 mast Exp $ * */ @@ -91,7 +91,9 @@ void seek(int skipthismany) { } void create(void|string host, void|string db, void|string user, - void|string pass) { + void|string _pass) { + string pass = _pass; + _pass = "CENSORED"; mo::create(host||"",db||"",user||"",pass||""); if (db && stringp(db) && sizeof(db)) { mo::big_query("use "+db);