File: bug-210632-mysql-createuser-eval.patch

package info (click to toggle)
wwwconfig-common 0.3.0
  • links: PTS
  • area: main
  • in suites: bullseye, sid, stretch
  • size: 488 kB
  • sloc: sh: 952; makefile: 5
file content (50 lines) | stat: -rw-r--r-- 1,561 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Package: wwwconfig-common
Version: 0.0.30
Severity: important

Missing eval in mysql-createuser breaks it, except when the
admin user has no password. Here is a patch:

--- mysql-createuser.sh.~1~	2003-08-29 23:30:07.000000000 +0200
+++ mysql-createuser.sh	2003-09-12 16:48:31.000000000 +0200
@@ -38,14 +38,14 @@
 elif [ ! -x $(which mysql) ] ; then
     echo "No mysql client to execute, install the mysql client package and
     run 'dpkg-reconfigure -plow packagename'."
-elif ! $mysqlcmd -f mysql -e "show tables;" >/dev/null 2>&1 ; then
+elif ! eval $mysqlcmd -f mysql -e "\"show tables;\"" >/dev/null 2>&1 ; then
     error="Error when trying to connect to the mysql database.
     This error can occur if you have no database to connect to, or
     if the password was incorrect.
 	use: dpkg-reconfigure -plow packagename to reconfigure."
 else
     log="${log}Creating or resetting database user ($dbuser)."
-    if $mysqlcmd -f mysql -e "
+    script="
 	CONNECT mysql;
 	
 	REPLACE INTO user ( host, user, password )
@@ -83,8 +83,10 @@
 	);
 	
 	flush privileges;
-	
-	" > /dev/null 2>&1 ; then
+"
+    
+
+    if ! eval $mysqlcmd -f mysql -e '"$script"'  ; then
 	
 	if ! eval $mysqlcmd -f mysql -e "select User from user;" | grep $dbuser >/dev/null 2>&1 ; then
 	    error="Database user $dbuser NOT successfully added. You have to do it manually."


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux bou 2.4.20-3-686 #1 Sat Jun 7 22:34:55 EST 2003 i686
Locale: LANG=C, LC_CTYPE=C

-- no debconf information