Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffCtL-0002Lc-34 for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Jul 2018 23:26:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ffCtJ-0004s5-GV for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Jul 2018 23:26:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffCtJ-0004rx-AX for pgsql-bugs@lists.postgresql.org; Mon, 16 Jul 2018 23:26:53 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ffCtB-0005qh-Ih for pgsql-bugs@lists.postgresql.org; Mon, 16 Jul 2018 23:26:52 +0000 Received: by mail-wm0-x244.google.com with SMTP id y22-v6so2952574wma.0 for ; Mon, 16 Jul 2018 16:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=TF4EIZ5OBbHUfHUwVwsQZpRkNCD1n/H9ve+snef3kyo=; b=QXMfKf8D3w2Y+HySAnOkEHuyOqVtzUrneuSmRRMGEWx8bnFbpZhsxJm7BZEHGPCjFZ soDjqWe0nE/mQA00J2fq8bhy6/SgSw3wqQ3qP/QizdKBYeMMlBYHd5ZHlAQPVAza60cU r/D6aC1j/k5NbwmIDAunQVCt82oNIKBxbSiSqDOijo/Gium+/9cw+lu2nZ1cr1AmIbSH iD71oTPYkkBWadV/GT6q9LiVYzOSbGzqNXDaJPeIdlPC810W76b2gP9TxyvWhk9CWp9p 88RyMGQCgI5QPX1GRyWvjxGdJK0goCLrkIksO2X0T6ICNFJcB4NxvsZqcEjiUcEcLrWd 8UGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TF4EIZ5OBbHUfHUwVwsQZpRkNCD1n/H9ve+snef3kyo=; b=JdLMZFOLEEyMsKCbFfXB3zrpG9rY5Evl9mMCyoDsqRdP2rzmpffCmnfWYRBAEG0AbF ik/AsW+hZ7DPlIYgINLcYai3g2wv29AMMjEnpv7fkk3uScZiXZiajsV1R0fx+b8frAMW lv4+lrtOTk10kLqnfTZoR8pG0sAY/XEqrfXygDInDu8otR62EyFyAFGClVCX2cV2j/lY iWrMeMVV0xv5kM7fll4oT0zN/LL93CHlvzSE/yxrYCOvdJT17KBj3cHUYSoED7gwWL1Y GTao1yP4HfL2+KTui1LULMJvnq6zrizISlgja1+0DeXn9YCAePQ62Z60Z+QdQ7WbCTkV RMhw== X-Gm-Message-State: AOUpUlGFIsfqkBOBD1UMTr7o+Q3gO5gkQHdgn2sIDrHKkEf4O6ZHUVcz 9TjFd0cfKIKRiWEpljYYBJrtOV/VoUjwXO3ew06ajrM6l5drZc4L7YJbZSv43UKFxN0OANiH3sU 9jbFxTIZiIVEMSrWoERAykW5Si7aZBzEaAuy7ClVhd9otU/FO2ev4rkDLzs/tZgpCMlWOLfGy7o A7apV17ygR00y+h2s= X-Google-Smtp-Source: AAOMgpcQ5/PyiIIbiztNN5pzo4/rQGhT3RxFUrHq8KCLAJmHz78TaZ0E9kWHDAoR2mQLpZ3jeYN56g== X-Received: by 2002:a1c:dc89:: with SMTP id t131-v6mr11620898wmg.50.1531783604072; Mon, 16 Jul 2018 16:26:44 -0700 (PDT) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id w21-v6sm8371165wmc.45.2018.07.16.16.26.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jul 2018 16:26:43 -0700 (PDT) Subject: Re: BUG #15281: Set role does not affect superuser privleges To: Tom Lane Cc: torcher999@gmail.com, pgsql-bugs@lists.postgresql.org References: <153175290278.1396.6851104739737410645@wrigleys.postgresql.org> <9786.1531779170@sss.pgh.pa.us> From: Tomas Vondra Message-ID: <2e4ecc9f-5302-7017-40aa-7a412b7452da@2ndquadrant.com> Date: Tue, 17 Jul 2018 01:26:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <9786.1531779170@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/17/2018 12:12 AM, Tom Lane wrote: > Tomas Vondra writes: >> On 07/16/2018 04:55 PM, PG Bug reporting form wrote: >>> Here are the two scenarios I tested: >>> 1) as a session_user: superuser and current_user: non-superuser I can edit >>> others' tables >>> 2) as a session_user: non-superuser and current_user: superuser I cannot >>> edit others' tables > >> It's usually a good idea to provide exact scripts / output so that >> people can reproduce the issue easily. For me it behaves like this: >> ... >> So, correct in both cases. I'm not on Windows, but I don't see why would >> it behave differently there. > > Tomas' test left out the "GRANT user0 to user1" bit, but I can't > reproduce the behavior as described either. > Ah, right. Sorry for not mentioning that. I've actually tried both with and without that GRANT (no effect on behavior), but I've assumed it's there only to allow the `SET user0` which I've replaced by connecting directly as user0. So I haven't included it into the response. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services