Commit 6aef4237 authored by monty@mashka.mysql.fi's avatar monty@mashka.mysql.fi
Browse files

Fixed bug in previous patch when using a libc with static nss

parent 8a5ef8dc
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@
#include <signal.h>
#include <violite.h>

const char *VER= "12.13";
const char *VER= "12.14";

/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH	     1024
@@ -476,7 +476,8 @@ static struct my_option my_long_options[] =
  {"ignore-space", 'i', "Ignore space after function names.", 0, 0, 0,
   GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
  {"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
   0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   (gptr*) &opt_local_infile,
   (gptr*) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
  {"no-beep", 'b', "Turn off beep on error.", (gptr*) &opt_nobeep,
   (gptr*) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 
  {"host", 'h', "Connect to host.", (gptr*) &current_host,
@@ -609,7 +610,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
    break;
  case OPT_LOCAL_INFILE:
    using_opt_local_infile=1;
    opt_local_infile= test(!argument || atoi(argument)>0);
    break;
  case OPT_TEE:
    if (argument == disabled_my_option)
+4 −1
Original line number Diff line number Diff line
@@ -454,6 +454,8 @@ fi
NOINST_LDFLAGS=

static_nss=""
STATIC_NSS_FLAGS=""
OTHER_LIBC_LIB=""
AC_ARG_WITH(other-libc,
 [  --with-other-libc=DIR   Link against libc and other standard libraries 
                          installed in the specified non-standard location 
@@ -479,6 +481,7 @@ AC_ARG_WITH(other-libc,
     # we need special flags, but we will have to add those later
     STATIC_NSS_FLAGS="-Wl,--start-group -lc -lnss_files -lnss_dns -lresolv \
  -Wl,--end-group"
     OTHER_LIBC_LIB="-L$other_libc_lib"
     static_nss=1
   else
     # this is a dirty hack. We if we detect static nss glibc in the special
@@ -2390,7 +2393,7 @@ fi

if test "$static_nss" = "1"
then
 LDFLAGS="$LDFLAGS -static -L$other_libc_lib " 
 LDFLAGS="$LDFLAGS -static $OTHER_LIBC_LIB" 
 LIBS="$LIBS $STATIC_NSS_FLAGS"
fi  

+1 −1
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ select count(*) from t3 where n >= 4;
unlock tables;
#clean up
connection master;
drop table if exists t1,t2,t3;
drop table if exists t1,t2,t3,t4;
save_master_pos;
connection slave;
sync_with_master;
+18 −2
Original line number Diff line number Diff line
@@ -741,11 +741,25 @@ static void acl_update_db(const char *user, const char *host, const char *db,
}


/*
  Insert a user/db/host combination into the global acl_cache

  SYNOPSIS
    acl_insert_db()
    user		User name
    host		Host name
    db			Database name
    privileges		Bitmap of privileges

  NOTES
    acl_cache->lock must be locked when calling this
*/

static void acl_insert_db(const char *user, const char *host, const char *db,
			  ulong privileges)
{
  ACL_DB acl_db;
  /* The acl_cache mutex is locked by mysql_grant */
  safe_mutex_assert_owner(&acl_cache->lock);
  acl_db.user=strdup_root(&mem,user);
  update_hostname(&acl_db.host,strdup_root(&mem,host));
  acl_db.db=strdup_root(&mem,db);
@@ -1217,6 +1231,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
  char *password,empty_string[1];
  char what= (revoke_grant) ? 'N' : 'Y';
  DBUG_ENTER("replace_user_table");
  safe_mutex_assert_owner(&acl_cache->lock);

  password=empty_string;
  empty_string[0]=0;
@@ -1240,7 +1255,6 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
  {
    if (!create_user)
    {
      THD *thd=current_thd;
      if (what == 'N')
	my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT),
			MYF(0),combo.user.str,combo.host.str);
@@ -1621,6 +1635,7 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip,
  char helping [NAME_LEN*2+USERNAME_LENGTH+3];
  uint len;
  GRANT_TABLE *grant_table,*found=0;
  safe_mutex_assert_owner(&LOCK_grant);

  len  = (uint) (strmov(strmov(strmov(helping,user)+1,db)+1,tname)-helping)+ 1;
  for (grant_table=(GRANT_TABLE*) hash_search(&hash_tables,(byte*) helping,
@@ -1828,6 +1843,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
  int error=0;
  ulong store_table_rights, store_col_rights;
  DBUG_ENTER("replace_table_table");
  safe_mutex_assert_owner(&LOCK_grant);

  strxmov(grantor, thd->user, "@", thd->host_or_ip, NullS);