smbd: enable unit-testing of NT_TRANSACT_GET_USER_QUOTA
authorUri Simchoni <uri@samba.org>
Sat, 9 Jan 2016 19:24:10 +0000 (21:24 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 26 Jan 2016 14:58:11 +0000 (15:58 +0100)
Processing of NT_TRANSACT_GET_USER_QUOTA involves a security check to
see the user is an admin, allow this check to run in unit-testing mode.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/nttrans.c

index b5fbbfdcf2ba9fc694a1b36e834421e4ffac3735..75b283e79999572d1fb687e829a7313e43dbab49 100644 (file)
@@ -2310,7 +2310,7 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
        ZERO_STRUCT(qt);
 
        /* access check */
-       if (get_current_uid(conn) != 0) {
+       if (get_current_uid(conn) != sec_initial_uid()) {
                DEBUG(1,("get_user_quota: access_denied service [%s] user "
                         "[%s]\n", lp_servicename(talloc_tos(), SNUM(conn)),
                         conn->session_info->unix_info->unix_name));