Merge lp:~hingo/drizzle/drizzle-rescue-drizzle_password_hash into lp:~drizzle-trunk/drizzle/development

Proposed by Henrik Ingo
Status: Merged
Approved by: Brian Aker
Approved revision: 2483
Merged at revision: 2495
Proposed branch: lp:~hingo/drizzle/drizzle-rescue-drizzle_password_hash
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 143 lines (+8/-79)
4 files modified
.bzrignore (+1/-2)
client/include.am (+6/-1)
libdrizzle-2.0/include.am (+1/-14)
libdrizzle-2.0/mysql_password_hash.cc (+0/-62)
To merge this branch: bzr merge lp:~hingo/drizzle/drizzle-rescue-drizzle_password_hash
Reviewer Review Type Date Requested Status
Drizzle Merge Team Pending
Review via email: mp+88475@code.launchpad.net

Description of the change

With the recent rehash of libdrizzle files, one binary called drizzle_password_hash dropped out of make install. This is referenced in the auth_ldap documentation and use for password management with ldap.

This fixes the problem by moving the source file to client/drizzle_password_hash.cc and adding to bin_PROGRAMS in client/include.am. The libdrizzle*/mysql_password_hash.cc files are deleted.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2011-12-27 16:09:18 +0000
+++ .bzrignore 2012-01-13 10:33:24 +0000
@@ -43,6 +43,7 @@
43client/drizzleslap43client/drizzleslap
44client/drizzletest44client/drizzletest
45client/mysqlslap45client/mysqlslap
46client/drizzle_password_hash
46comp_creator.gcno47comp_creator.gcno
47compile48compile
48config.guess49config.guess
@@ -166,8 +167,6 @@
166item.gcno167item.gcno
167key.gcno168key.gcno
168key_map.gcno169key_map.gcno
169libdrizzle-2.0/libdrizzle/mysql_password_hash
170libdrizzle-2.0/libdrizzle/drizzle_password_hash
171libmysql/Makefile.in170libmysql/Makefile.in
172libserialutil_la-db.gcno171libserialutil_la-db.gcno
173libserialutil_la-unireg.gcno172libserialutil_la-unireg.gcno
174173
=== renamed file 'libdrizzle/mysql_password_hash.cc' => 'client/drizzle_password_hash.cc'
=== modified file 'client/include.am'
--- client/include.am 2011-11-30 17:23:18 +0000
+++ client/include.am 2012-01-13 10:33:24 +0000
@@ -34,7 +34,8 @@
34 client/drizzle \34 client/drizzle \
35 client/drizzledump \35 client/drizzledump \
36 client/drizzleimport \36 client/drizzleimport \
37 client/drizzleslap37 client/drizzleslap \
38 client/drizzle_password_hash
3839
39man_MANS+= \40man_MANS+= \
40 client/drizzle.1 \41 client/drizzle.1 \
@@ -88,3 +89,7 @@
8889
89client_drizzletest_SOURCES= client/drizzletest.cc90client_drizzletest_SOURCES= client/drizzletest.cc
90client_drizzletest_LDADD= ${CLIENT2_LDADD} ${BOOST_LIBS} ${LIBPCRE} 91client_drizzletest_LDADD= ${CLIENT2_LDADD} ${BOOST_LIBS} ${LIBPCRE}
92
93
94client_drizzle_password_hash_SOURCES= client/drizzle_password_hash.cc
95client_drizzle_password_hash_LDADD= libdrizzle-2.0/libdrizzle-2.0.la
9196
=== modified file 'libdrizzle-2.0/include.am'
--- libdrizzle-2.0/include.am 2011-12-23 20:13:32 +0000
+++ libdrizzle-2.0/include.am 2012-01-13 10:33:24 +0000
@@ -40,18 +40,6 @@
40SQLITE_PROGS= examples/sqlite_server40SQLITE_PROGS= examples/sqlite_server
41endif41endif
4242
43noinst_PROGRAMS+= libdrizzle-2.0/mysql_password_hash
44libdrizzle_2_0_mysql_password_hash_LDADD= libdrizzle-2.0/libdrizzle-2.0.la
45libdrizzle_2_0_mysql_password_hash_SOURCES= libdrizzle-2.0/mysql_password_hash.cc
46
47# For some reason this has originally been called mysql_password_hash. I'd prefer
48# to call it drizzle_password_hash but to remain backward compatible I didn't
49# change any sources, rather just build it twice and provide both.
50# Only drizzle_password_hash is installed by make install though.
51noinst_PROGRAMS+= libdrizzle-2.0/drizzle_password_hash
52libdrizzle_2_0_drizzle_password_hash_LDADD= libdrizzle-2.0/libdrizzle-2.0.la
53libdrizzle_2_0_drizzle_password_hash_SOURCES= libdrizzle-2.0/mysql_password_hash.cc
54
55noinst_PROGRAMS+= \43noinst_PROGRAMS+= \
56 $(SQLITE_PROGS) \44 $(SQLITE_PROGS) \
57 examples/client \45 examples/client \
@@ -59,8 +47,7 @@
59 examples/proxy \47 examples/proxy \
60 examples/server \48 examples/server \
61 examples/simple \49 examples/simple \
62 examples/simple_multi \50 examples/simple_multi
63 libdrizzle-2.0/mysql_password_hash
6451
65libdrizzle_2_0_libdrizzle_2_0_la_CXXFLAGS= \52libdrizzle_2_0_libdrizzle_2_0_la_CXXFLAGS= \
66 ${AM_CXXFLAGS} \53 ${AM_CXXFLAGS} \
6754
=== removed file 'libdrizzle-2.0/mysql_password_hash.cc'
--- libdrizzle-2.0/mysql_password_hash.cc 2011-11-04 21:06:16 +0000
+++ libdrizzle-2.0/mysql_password_hash.cc 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
1/*
2 * Drizzle Client & Protocol Library
3 *
4 * Copyright (C) 2008 Eric Day (eday@oddments.org)
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 *
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following disclaimer
16 * in the documentation and/or other materials provided with the
17 * distribution.
18 *
19 * * The names of its contributors may not be used to endorse or
20 * promote products derived from this software without specific prior
21 * written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *
35 */
36
37
38#include <config.h>
39
40#include <cstring>
41#include <iostream>
42
43#include <libdrizzle-2.0/drizzle_client.h>
44
45static const uint32_t BUFFER_CHUNK= 8192;
46
47int main(int argc, char *argv[])
48{
49 char hashed_password[DRIZZLE_MYSQL_PASSWORD_HASH];
50
51 if (argc != 2)
52 {
53 std::cerr << "Usage: " << argv[0] << " <password to hash>" << std::endl;
54 return 1;
55 }
56
57 drizzle_mysql_password_hash(hashed_password, argv[1], strlen(argv[1]));
58
59 std::cout << hashed_password << std::endl;
60
61 return 0;
62}