File: bug-225424-grant-all-privileges.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 (59 lines) | stat: -rw-r--r-- 1,802 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
51
52
53
54
55
56
57
58
59
diff -ur wwwconfig-common-0.0.33/mysql-createuser.sh wwwconfig-common-0.0.33-new/mysql-createuser.sh
--- wwwconfig-common-0.0.33/mysql-createuser.sh	2003-10-27 11:04:51.000000000 +0100
+++ wwwconfig-common-0.0.33-new/mysql-createuser.sh	2004-02-04 16:58:14.000000000 +0100
@@ -10,6 +10,9 @@
 #		Removed the dbadmpass check part.
 #	20031027 Benoit Joly <benoit@debian.org>
 #		Patch small bug.
+#	20040204 Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
+#		Use proper GRANT for compatibility with added MySQL 4
+#		features, now all privileges are granted (excluding GRANT)
 # Needs:	$dbuser    - the user name to create (or replace).
 #		$dballow   - what hosts to allow (defaults to %).
 #		$dbname    - the database that user should have access to.
@@ -48,41 +51,11 @@
 else
     log="${log}Creating or resetting database user ($dbuser)."
     script="
-	CONNECT mysql;
+	GRANT ALL PRIVILEGES ON \`$dbname\`.* TO \`$dbuser\`@'$dballow'
+		IDENTIFIED BY '$dbpass';
 	
-	REPLACE INTO user ( host, user, password )
-	VALUES (
-	    '$dballow',
-	    '$dbuser',
-	    password( '$dbpass' )
-	);
-	
-	REPLACE INTO user ( host, user, password )
-	VALUES (
-	    'localhost',
-	    '$dbuser',
-	    password( '$dbpass' )
-	);
-	
-	REPLACE INTO db ( host, db, user, select_priv, insert_priv, update_priv,
-	    delete_priv, create_priv, drop_priv )
-	VALUES (
-	    '$dballow',
-	    '$dbname',
-	    '$dbuser',
-	    'Y', 'Y', 'Y', 'Y',
-	    'Y', 'Y'
-	);
-	
-	REPLACE INTO db ( host, db, user, select_priv, insert_priv, update_priv,
-	    delete_priv, create_priv, drop_priv )
-	VALUES (
-	    'localhost',
-	    '$dbname',
-	    '$dbuser',
-	    'Y', 'Y', 'Y', 'Y',
-	    'Y', 'Y'
-	);
+	GRANT ALL PRIVILEGES ON \`$dbname\`.* TO \`$dbuser\`@localhost
+		IDENTIFIED BY '$dbpass';
 	
 	flush privileges;
 "