Commit 458a7e46 authored by Leigh Stoller's avatar Leigh Stoller

Add "user" to a bunch of mysql connects so that log files record who

made the queries.
parent 78b358b5
......@@ -292,7 +292,7 @@ mydb_query(char *query, int ncols, ...)
}
mysql_init(&db);
if (mysql_real_connect(&db, 0, 0, 0, dbname, 0, 0, 0) == 0) {
if (mysql_real_connect(&db, 0, "capserver", 0, dbname, 0, 0, 0) == 0) {
syslog(LOG_ERR, "%s: connect failed: %s",
dbname, mysql_error(&db));
return (MYSQL_RES *) 0;
......
......@@ -70,7 +70,7 @@ query_bootinfo_db(struct in_addr ipaddr, boot_what_t *info)
}
mysql_init(&db);
if (mysql_real_connect(&db, 0, 0, 0, dbname, 0, 0, 0) == 0) {
if (mysql_real_connect(&db, 0, "bootinfo", 0, dbname, 0, 0, 0) == 0) {
syslog(LOG_ERR, "%s: connect failed: %s",
dbname, mysql_error(&db));
return 1;
......
......@@ -50,7 +50,7 @@ query_db(struct in_addr ipaddr, struct in_addr *sip,
}
mysql_init(&db);
if (mysql_real_connect(&db, 0, 0, 0, dbname, 0, 0, 0) == 0) {
if (mysql_real_connect(&db, 0, "proxydhcp", 0, dbname, 0, 0, 0) == 0) {
syslog(LOG_ERR, "%s: connect failed: %s",
dbname, mysql_error(&db));
return 1;
......@@ -162,7 +162,7 @@ ip2nodeid(struct in_addr ipaddr, char *nodeid, int len)
}
mysql_init(&db);
if (mysql_real_connect(&db, 0, 0, 0, dbname, 0, 0, 0) == 0) {
if (mysql_real_connect(&db, 0, "proxydhcp", 0, dbname, 0, 0, 0) == 0) {
syslog(LOG_ERR, "%s: connect failed: %s",
dbname, mysql_error(&db));
return 1;
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2002 University of Utah and the Flux Group.
* Copyright (c) 2000-2003 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -360,7 +360,8 @@ mydb_update(char *query, ...)
if (! inited) {
mysql_init(&db);
if (mysql_real_connect(&db, 0, 0, 0, TBDBNAME, 0, 0, 0) == 0) {
if (mysql_real_connect(&db, 0, "genlastlog",
0, TBDBNAME, 0, 0, 0) == 0) {
syslog(LOG_ERR, "%s: connect failed: %s",
TBDBNAME, mysql_error(&db));
return -1;
......
......@@ -3104,7 +3104,7 @@ mydb_connect()
}
mysql_init(&db);
if (mysql_real_connect(&db, 0, 0, 0,
if (mysql_real_connect(&db, 0, "tmcd", 0,
dbname, 0, 0, CLIENT_INTERACTIVE) == 0) {
error("%s: connect failed: %s\n", dbname, mysql_error(&db));
return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment