File: bug-231186-make-mysql-exec.sh-work-for-nonadmins-too-more.patch

package info (click to toggle)
wwwconfig-common 0.3.0
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 488 kB
  • sloc: sh: 952; makefile: 5
file content (38 lines) | stat: -rw-r--r-- 1,859 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
From: Jeremy <jeremy.laine@polytechnique.org>
Date: Fri, 7 May 2004 17:50:06 +0200

Attached is a patch that fixes mysql-(create|drop)db.sh. I have tested
it and it works fines. I don't really have any merit for this patch, I
just did the same thing as Jeroen did for the mysql-*-exec scripts!

I have purposefully not patched mysql-(create|drop)user.sh as the logic
of those scripts is slightly different and they require some more
thinking.

Regards,
Jeremy

diff -ur /usr/share/wwwconfig-common/mysql-createdb.sh ./mysql-createdb.sh
--- /usr/share/wwwconfig-common/mysql-createdb.sh	2004-02-16 14:35:15.000000000 +0100
+++ ./mysql-createdb.sh	2004-05-07 17:33:47.000000000 +0200
@@ -35,7 +35,7 @@
 elif [ ! -x $(which mysql) ] ; then
     error="No mysql client to execute, install the mysql client package and
     run 'dpkg-reconfigure -plow packagename'."
-elif ! eval $mysqlcmd -f mysql -e "\"show tables;\"" >/dev/null 2>&1 ; then
+elif ! eval $mysqlcmd </dev/null >/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.
diff -ur /usr/share/wwwconfig-common/mysql-dropdb.sh ./mysql-dropdb.sh
--- /usr/share/wwwconfig-common/mysql-dropdb.sh	2004-02-16 14:35:15.000000000 +0100
+++ ./mysql-dropdb.sh	2004-05-07 17:34:22.000000000 +0200
@@ -33,7 +33,7 @@
 elif [ ! -x $(which mysql) ] ; then
     error="No mysql client to execute, install the mysql client package and
     run 'dpkg-reconfigure -plow packagename'."
-elif ! eval $mysqlcmd -f mysql -e "\"show tables;\"" >/dev/null 2>&1 ; then
+elif ! eval $mysqlcmd </dev/null >/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.