fikset litt småtteri så den kompilerer på SLES9

This commit is contained in:
Knut Auvor Grythe 2005-06-27 10:13:01 +00:00
parent a5f4841fb8
commit 83dd083eec
5 changed files with 22 additions and 11 deletions

View File

@ -1,3 +1,10 @@
v0.46 (2005-06-27) knuta@itea.ntnu.no
* Replaced deprecated functions not supported in SLES9
v0.42-0.45 (2002-03-07 - 2004-12-08) unknown
* Various undocumented fixes, at least something about length
of group names, I think
v0.41 (2002-03-07) tlan@stud.ntnu.no
* Fixed a seg.fault bug in is_password_set()-routine.

6
configure vendored
View File

@ -1544,7 +1544,7 @@ fi
# Define the identity of the package.
PACKAGE=mysql-admutils
VERSION=0.41
VERSION=0.46
cat >>confdefs.h <<_ACEOF
@ -3969,8 +3969,8 @@ echo "$as_me: error: Invalid MySQL directory - unable to find mysql.h under $wit
fi
fi
MYSQL_INCLUDE=-I$MYSQL_INCDIR
#MYSQL_LFLAGS="-L$MYSQL_LIBDIR -Wl,-rpath,$MYSQL_LIBDIR"
MYSQL_LFLAGS="-L$MYSQL_LIBDIR"
MYSQL_LFLAGS="-L$MYSQL_LIBDIR -Wl,-R,$MYSQL_LIBDIR"
#MYSQL_LFLAGS="-L$MYSQL_LIBDIR"
MYSQL_LIBS=-lmysqlclient
cat >>confdefs.h <<\_ACEOF

View File

@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(mysql-dbadm.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mysql-admutils, 0.41)
AM_INIT_AUTOMAKE(mysql-admutils, 0.46)
AM_SANITY_CHECK
dnl Checks for programs.

View File

@ -1,5 +1,5 @@
/*
* @(#) $Header: /tmp/cvs/mysql-admutils/mysql-dbadm.c,v 1.12 2004-11-16 20:56:51 lkarsten Exp $
* @(#) $Header: /tmp/cvs/mysql-admutils/mysql-dbadm.c,v 1.13 2005-06-27 10:13:01 knuta Exp $
*
* mysql-dbadm.c
*
@ -97,9 +97,10 @@ create(MYSQL *pmysql, char *db)
}
mysql_select_db(pmysql, "mysql");
// oppretter databasen.
if (mysql_create_db(pmysql, db)) {
char query[1024];
sprintf(query, "create database `%s`", db);
if (mysql_query(pmysql, query))
return dberror(pmysql, "Cannot create database '%s'.", db);
}
fprintf(stderr, "Database '%s' created.\n", db);
return 0;
}
@ -120,7 +121,8 @@ drop(MYSQL *pmysql, char *db)
}
mysql_select_db(pmysql, "mysql");
if (mysql_drop_db(pmysql, db))
sprintf(query, "drop database `%s`", db);
if (mysql_query(pmysql, query))
return dberror(pmysql, "Cannot drop database '%s'.", db);
fprintf(stderr, "Database '%s' dropped.\n", db);
@ -421,6 +423,7 @@ main(int argc, char *argv[])
int i;
enum { c_create, c_drop, c_editperm, c_show } command;
MYSQL mysql;
mysql_init(&mysql);
char **dblist, **p;
char *db;
@ -463,7 +466,7 @@ main(int argc, char *argv[])
read_config_file();
/* connect to the database server and select the mysql database */
if (!mysql_connect(&mysql, db_server, db_user, db_passwd))
if (!mysql_real_connect(&mysql, db_server, db_user, db_passwd, db_name, 0, NULL, 0))
return dberror(&mysql, "Cannot connect to database server '%s'.",
db_server);
if (mysql_select_db(&mysql, db_name))

View File

@ -1,5 +1,5 @@
/*
* @(#) $Header: /tmp/cvs/mysql-admutils/mysql-useradm.c,v 1.9 2004-11-16 20:59:42 lkarsten Exp $
* @(#) $Header: /tmp/cvs/mysql-admutils/mysql-useradm.c,v 1.10 2005-06-27 10:13:01 knuta Exp $
*
* mysql-useradm.c
*
@ -226,6 +226,7 @@ main(int argc, char *argv[])
int i;
enum { c_create, c_delete, c_passwd, c_show } command;
MYSQL mysql;
mysql_init(&mysql);
char **dblist, **p;
char *user;
@ -267,7 +268,7 @@ main(int argc, char *argv[])
read_config_file();
/* connect to the database server and select the mysql database */
if (!mysql_connect(&mysql, db_server, db_user, db_passwd))
if (!mysql_real_connect(&mysql, db_server, db_user, db_passwd, db_name, 0, NULL, 0))
return dberror(&mysql, "Cannot connect to database server '%s'.",
db_server);
if (mysql_select_db(&mysql, db_name))