Version 0.51
Mer brukervennlige feilmeldinger, samt fikset alle kompilatoradvarsler.
This commit is contained in:
parent
bcb560b925
commit
21f0f57f99
|
@ -230,11 +230,6 @@ pwyacc.h: pwyacc.c
|
|||
mysql-dbadm$(EXEEXT): $(mysql_dbadm_OBJECTS) $(mysql_dbadm_DEPENDENCIES)
|
||||
@rm -f mysql-dbadm$(EXEEXT)
|
||||
$(LINK) $(mysql_dbadm_LDFLAGS) $(mysql_dbadm_OBJECTS) $(mysql_dbadm_LDADD) $(LIBS)
|
||||
pwyacc.h: pwyacc.c
|
||||
@if test ! -f $@; then \
|
||||
rm -f pwyacc.c; \
|
||||
$(MAKE) pwyacc.c; \
|
||||
else :; fi
|
||||
mysql-useradm$(EXEEXT): $(mysql_useradm_OBJECTS) $(mysql_useradm_DEPENDENCIES)
|
||||
@rm -f mysql-useradm$(EXEEXT)
|
||||
$(LINK) $(mysql_useradm_LDFLAGS) $(mysql_useradm_OBJECTS) $(mysql_useradm_LDADD) $(LIBS)
|
||||
|
|
7
common.c
7
common.c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* @(#) $Header: /tmp/cvs/mysql-admutils/common.c,v 1.8 2006-08-15 11:51:58 geirha Exp $
|
||||
* @(#) $Header: /tmp/cvs/mysql-admutils/common.c,v 1.9 2007-02-27 14:10:07 geirha Exp $
|
||||
*
|
||||
* functions used by mysql-dbadm.c and mysql-useradm.c
|
||||
*
|
||||
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <mysql.h>
|
||||
#include <assert.h>
|
||||
|
@ -22,7 +23,7 @@
|
|||
|
||||
char *program_name;
|
||||
|
||||
static char *rcsheader = "@(#) " PACKAGE " " VERSION " orakel@ntnu.no $Header: /tmp/cvs/mysql-admutils/common.c,v 1.8 2006-08-15 11:51:58 geirha Exp $";
|
||||
static char *rcsheader = "@(#) " PACKAGE " " VERSION " orakel@ntnu.no $Header: /tmp/cvs/mysql-admutils/common.c,v 1.9 2007-02-27 14:10:07 geirha Exp $";
|
||||
|
||||
|
||||
int
|
||||
|
@ -56,7 +57,7 @@ wrong_use(char *format, ...)
|
|||
int
|
||||
dberror(MYSQL *pmysql, char *format, ...)
|
||||
{
|
||||
char *errmsg;
|
||||
const char *errmsg;
|
||||
va_list ap;
|
||||
|
||||
fprintf(stderr, "%s: ", program_name);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* @(#) $Header: /tmp/cvs/mysql-admutils/mysql-dbadm.c,v 1.18 2007-02-27 11:38:07 geirha Exp $
|
||||
* @(#) $Header: /tmp/cvs/mysql-admutils/mysql-dbadm.c,v 1.19 2007-02-27 14:10:08 geirha Exp $
|
||||
*
|
||||
* mysql-dbadm.c
|
||||
*
|
||||
|
@ -513,8 +513,15 @@ main(int argc, char *argv[])
|
|||
db[32] = '\0';
|
||||
|
||||
if (! (owner(db) || member(db))) {
|
||||
dberror(NULL, "You are not the owner of '%s'. Skipping.",
|
||||
db);
|
||||
if (command == c_create)
|
||||
dberror(NULL,"Unable to create mysql-database '%s'.\n"
|
||||
"A mysql-database must start with either '%s_' or "
|
||||
"'groupname_', where groupname is a unix group you are a "
|
||||
"member of. Type \"groups\" to see which groups you are a "
|
||||
"member of.\n",
|
||||
db, getpwuid(getuid())->pw_name);
|
||||
else
|
||||
dberror(NULL, "You are not in charge of mysql-database: '%s'. Skipping.", db);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* @(#) $Header: /tmp/cvs/mysql-admutils/mysql-useradm.c,v 1.10 2005-06-27 10:13:01 knuta Exp $
|
||||
* @(#) $Header: /tmp/cvs/mysql-admutils/mysql-useradm.c,v 1.11 2007-02-27 14:10:08 geirha Exp $
|
||||
*
|
||||
* mysql-useradm.c
|
||||
*
|
||||
|
@ -295,7 +295,16 @@ main(int argc, char *argv[])
|
|||
user[33] = '\0';
|
||||
if (! (owner(user) || member(user)))
|
||||
{
|
||||
dberror(NULL, "You are not the owner of '%s'. Skipping.", user);
|
||||
if (command == c_create)
|
||||
dberror(NULL,"Unable to create mysql-user '%s'.\n"
|
||||
|
||||
"A mysql-user must start with either '%s_' or "
|
||||
"'groupname_', where groupname is a unix group you are a "
|
||||
"member of. Type \"groups\" to see which groups you are "
|
||||
"a member of.\n",
|
||||
user, getpwuid(getuid())->pw_name);
|
||||
else
|
||||
dberror(NULL, "You are not in charge of mysql-user: '%s'. Skipping.", user);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
4
pwfile.c
4
pwfile.c
|
@ -1,11 +1,13 @@
|
|||
/*
|
||||
* @($) $Id: pwfile.c,v 1.2 2002-02-27 08:49:48 knutpett Exp $
|
||||
* @($) $Id: pwfile.c,v 1.3 2007-02-27 14:10:08 geirha Exp $
|
||||
*
|
||||
* functions for parsing the config file.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
|
|
63
pwyacc.h
63
pwyacc.h
|
@ -1,58 +1,17 @@
|
|||
/* A Bison parser, made by GNU Bison 1.875. */
|
||||
#ifndef BISON_Y_TAB_H
|
||||
# define BISON_Y_TAB_H
|
||||
|
||||
/* Skeleton parser for Yacc-like parsing with Bison,
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As a special exception, when this file is copied by Bison into a
|
||||
Bison output file, you may use that output file without restriction.
|
||||
This special exception was added by the Free Software Foundation
|
||||
in version 1.24 of Bison. */
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||
know about them. */
|
||||
enum yytokentype {
|
||||
SET = 258,
|
||||
HOST = 259,
|
||||
USER = 260,
|
||||
PASSWORD = 261,
|
||||
STRING = 262
|
||||
};
|
||||
#endif
|
||||
#define SET 258
|
||||
#define HOST 259
|
||||
#define USER 260
|
||||
#define PASSWORD 261
|
||||
#define STRING 262
|
||||
|
||||
|
||||
|
||||
|
||||
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||
typedef int YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# ifndef YYSTYPE
|
||||
# define YYSTYPE int
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# endif
|
||||
# define SET 257
|
||||
# define HOST 258
|
||||
# define USER 259
|
||||
# define PASSWORD 260
|
||||
# define STRING 261
|
||||
|
||||
|
||||
extern YYSTYPE yylval;
|
||||
|
||||
|
||||
|
||||
#endif /* not BISON_Y_TAB_H */
|
||||
|
|
Loading…
Reference in New Issue