nerdexam
Oracle

1Z0-146 · Question #107

A procedure is created in the SYS schema to allow users to change the password as follows: CREATE OR REPLACE PROCEDURE change_password(p_username VARCHAR2 DEFAULT NULL, p_new_password VARCHAR2…

The correct answer is D. by using AUTHID CURRENT_USER in the procedure to implement the invoker's right. See the full explanation below for the reasoning.

Question

A procedure is created in the SYS schema to allow users to change the password as follows:

CREATE OR REPLACE PROCEDURE change_password(p_username VARCHAR2 DEFAULT NULL, p_new_password VARCHAR2 DEFAULT NULL) IS v_sql_stmt VARCHAR2(500); BEGIN v_sql_stmt := 'ALTER USER '||p_username ||' IDENTIFIED BY ' || p_new_password; EXECUTE IMMEDIATE v_sql_stmt; END change_password; The SYS user has granted EXECUTE privilege on the procedure to the OE user. But OE is able to change the password for SYS by using this procedure. How would you protect this?

Options

  • Aby using the procedure as part of a PL/SQL package
  • Bby using a bind argument with dynamic SQL in the procedure
  • Cby using AUTHID DEFINER in the procedure to implement the definer's right
  • Dby using AUTHID CURRENT_USER in the procedure to implement the invoker's right

How the community answered

(48 responses)
  • A
    2% (1)
  • B
    6% (3)
  • C
    10% (5)
  • D
    81% (39)

Community Discussion

No community discussion yet for this question.

Full 1Z0-146 Practice