s3/smbd: allow set quota for non root user (when built with --enable-selftest)
authorNoel Power <noel.power@suse.com>
Wed, 22 Mar 2017 20:06:13 +0000 (20:06 +0000)
committerNoel Power <npower@samba.org>
Tue, 31 Jul 2018 14:56:25 +0000 (16:56 +0200)
Currently it appears you need to be root to set quotas, for test purposes
this requirement needs to be relaxed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/nttrans.c

index 6967e4e1b37155de413b8fb21d16b7b5402b8146..5937380fb85adbee48c5c8fc61fdf2cdd75df9c9 100644 (file)
@@ -2710,7 +2710,7 @@ static void call_nt_transact_set_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,("set_user_quota: access_denied service [%s] user "
                         "[%s]\n", lp_servicename(talloc_tos(), SNUM(conn)),
                         conn->session_info->unix_info->unix_name));