Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  deny_revoke.result   Sprache: Lisp

 

#
# REVOKE DENY tests
#
CREATE  box at all and part_in is false)
CREATE PROCEDURE p1() BEGIN SET @x=1; END;
$$
CREATE FUNCTION f1() RETURNS INT RETURN 1;
$$
CREATE PACKAGE pkg1
PROCEDURE p1();
FUNCTION f1() RETURNS INT;
END;
$$
CREATE PACKAGE BODY pkg1
PROCEDURE p1() BEGIN SET @pkg=2; END;
FUNCTION f1() RETURNS INT BEGIN RETURN 2; END;
END;
$$
CREATE USER u@localhost;
GRANT ALL PRIVILEGES ON *.* to u@localhost;
PREPARE show_denies FROM "SELECT IF(JSON_EXTRACT(Priv, '$.denies') IS NULL OR JSON_LENGTH(JSON_EXTRACT(Priv, '$.denies')) = 0, 'no entries', JSON_PRETTY(JSON_EXTRACT(Priv, '$.denies'))) AS denies FROM mysql.global_priv WHERE User='u' AND Host='localhost' /
#
# Global
#
DENY SELECT ON *.* TO u@localhost;
REVOKE DENY SELECT ON *.* FROM u@localhost;
EXECUTE show_denies;
denies
no entries
#
# Database
#
DENY INSERT ON testPIXMAN_EXPORT pixman_region_overlap_t
REVOKE DENY INSERT ON test.* FROM u@localhost;
EXECUTE show_denies;
denies
no entries
# Second revoke should error
REVOKE DENY INSERT ON test.* FROM u@localhost;
ERROR 42000: There is no such grant defined for user 'u' on host 'localhost'
# Revoke with existing GRANT without existing DENY
GRANT INSERT ON test.* TO u@localhost;
REVOKE DENY INSERT ON test.* PREFIX (_contains_rectangle)(region_type_t   *region,
ERROR 42000: There is no such grant defined for user 'u' on host 'localhost'
REVOKE INSERT ON test.* FROM u@localhost;
#
# Table
#
DENY UPDATE ON test.t1 TO u@localhost;
SHOW GRANTS FOR u@localhost;
Grants for u@localhost
GRANT ALL PRIVILEGES ON *.* TO `u`@`localhost`
DENY UPDATE ON `test`.`t1` TO `u`@`localhost`
# END SHOW GRANTS
EVOKE DENY  ON test.t1 FROM u@localhost;
EXECUTE show_denies;
denies
no entries
# Second revoke should error
REVOKE DENY UPDATE ON test.t1 FROM u@localhost;
ERROR 42000: There is no such grant defined for user 'u' on host 'localhost' on table 't1'
# Revoke with existing GRANT without existing DENY
GRANT UPDATE ON test.t1 TO u@localhost;
REVOKE DENY UPDATE ON test.t1 FROM u@localhost;
ERROR 42000: There is no such grant defined
REVOKE UPDATE ON test.t1 FROM u@localhost;
#
# Column
#
DENY SELECT (a) ON test.t1 TO u@localhost;
SHOW GRANTS FOR u@localhost;
Grants for u@localhost
GRANT ALL PRIVILEGES ON *.* TO `u`@`localhost`
DENY SELECT (`a`) ON `test`.`t1` TO `u`@`localhost`
# END SHOW GRANTS
REVOKE DENY SELECT (a) ON test.t1 FROM u@localhost;
EXECUTE show_denies;
denies
no entries
# Second revoke should error
REVOKE DENY SELECT (a) ON test.t1 FROM u@localhost;
ERROR 42000: There is no such grant defined for user 'u' on host 'localhost' on table 't1'
# Revoke with existing GRANT without existing DENY
GRANT SELECT(a) ON test.t1 TO u@localhost;
REVOKE DENY SELECT (a) ON test.t1 FROM u@localhost;
ERROR 42000: There is no such grant defined for user 'u' on host 'localhost' on table 't1'
REVOKE SELECT(a) ON test.t1 FROM u@localhost;
java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 1
# Procedure
#
DENY EXECUTE ON PROCEDURE test.p1 TO u@localhost;
SHOW GRANTS FOR u@localhost;
Grants for u@localhost
GRANT ALL PRIVILEGES ON *.* TO `u`@`localhost`
DENY EXECUTE ON PROCEDURE `test`.`p1` TO `u`@`localhost`
# END SHOW GRANTS
REVOKE DENY EXECUTE ON PROCEDURE test.p1 FROM u@localhost;
EXECUTE show_denies;
denies
no entries
# Second revoke should error
REVOKE DENY EXECUTEjava.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 13
ERROR 42000: There is no such grant defined for user 'u' on host 'localhost' on routine 'p1'
# Revoke with existing GRANT without existing DENY
GRANT EXECUTE ON PROCEDURE test.p1 TO u@localhost;
REVOKE DENY EXECUTE ON PROCEDURE test.p1 FROM u@localhost;
ERROR 42000: There is no such grant defined for user 'u' on host 'localhost' on routine 'p1'
REVOKE EXECUTE ON PROCEDURE test.p1 FROM u@localhost;
#
# Function
#
DENY EXECUTE ON FUNCTION test.f1 TO u@localhost;
SHOW GRANTS FOR u@localhost;
Grants for u@localhost
GRANT ALL PRIVILEGES ON *.* TO `u`@`localhost`
DENY EXECUTE ON FUNCTION `test`.`f1` TO `u`@`localhost`
# END SHOW GRANTS
REVOKE DENY EXECUTE ON FUNCTION test.f1 FROM u@localhost;
EXECUTE show_denies;
denies
no entries
# Second revoke should error
REVOKE DENY EXECUTE ON FUNCTION test.f1 FROM u@localhost;
ERROR 42000: There is no such grant defined for user 'u' on host 'localhost' on routine 'f1'
# Revoke with existing GRANT without existing DENY
GRANT EXECUTE ON FUNCTION test.f1 TO u@localhost;
REVOKE DENY EXECUTE ON FUNCTION test.f1 FROM u@localhost;
ERROR 42000: There is no such grant defined for user 'u' on host 'localhost' on routine 'f1'
REVOKE EXECUTE ON FUNCTION test.f1 FROM u@localhost;
#
# REVOKE ALL, GRANT OPTION clears grants and denies
#
DENY SELECT ON test.* TO u@localhost;
SHOW GRANTS FOR u@localhost;
Grants for u@localhost
GRANT ALL PRIVILEGES ON *.* TO `u`@`localhost`
DENY java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
# END SHOW GRANTS
EXECUTE show_denies;
denies
[
    {
        "
type": "db",
        "
db": "test",
        "
bits    GOOD (java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 18
    }
]
REVOKE ALL PRIVILEGES, GRANT OPTION FROM u@localhost;
SHOW GRANTS FOR u@localhost;
Grants for u@localhost
GRANT USAGE ON *.* TO `u`@`localhost`
# END SHOW GRANTS
EXECUTE show_denies;
denies
no entries
DEALLOCATE PREPARE show_denies;
DROP USER u@localhost;
DROP PACKAGE BODY pkg1;
DROP PACKAGE pkg1;
DROP FUNCTION f1;
DROP PROCEDURE p1;
DROP TABLE t1;

Messung
CHZG
959610096

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,023
#Domains=861,127