From paf@yandex.ru Wed Sep 20 05:30:08 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qipn1-0080Y6-Tn for pgsql-general@arkaria.postgresql.org; Wed, 20 Sep 2023 05:30:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qipn0-00ETs8-2h for pgsql-general@arkaria.postgresql.org; Wed, 20 Sep 2023 05:30:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qipmz-00ETrm-KM for pgsql-general@lists.postgresql.org; Wed, 20 Sep 2023 05:30:17 +0000 Received: from forward401b.mail.yandex.net ([178.154.239.158]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qipmv-005ZKW-6V for pgsql-general@lists.postgresql.org; Wed, 20 Sep 2023 05:30:16 +0000 Received: from mail-nwsmtp-mxback-production-main-79.iva.yp-c.yandex.net (mail-nwsmtp-mxback-production-main-79.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:1288:0:640:1dc8:0]) by forward401b.mail.yandex.net (Yandex) with ESMTP id 4A8C0669F4 for ; Wed, 20 Sep 2023 08:30:09 +0300 (MSK) Received: from mail.yandex.ru (2a02:6b8:c0c:a52c:0:640:72d9:0 [2a02:6b8:c0c:a52c:0:640:72d9:0]) by mail-nwsmtp-mxback-production-main-79.iva.yp-c.yandex.net (mxback/Yandex) with HTTP id 6UBJiY0W8Gk0-ZAlACq0n; Wed, 20 Sep 2023 08:30:08 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1695187808; bh=FZZIQJVzUCD4aJeVfn+DQeXgmfj02g8MRh1bFq7F7P4=; h=Message-Id:Date:Subject:To:From; b=aGwR4Yd1HdUT1VmGn6QRw2PAyQOloqRk1wugOaZyvj2G7LGrWZvd/XuPorkzahIB/ fLZkNsCwT3Q2qBc5wNvyuc7D34bthOsBoeQQJgZIWs2Y2rgVjZil8S1qCTRwsGubKn WisDmz6Enal2dozWSdISspii3kliCSE5e0C9a0bM= Authentication-Results: mail-nwsmtp-mxback-production-main-79.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: by 2y2i6g6snfcuakol.iva.yp-c.yandex.net with HTTP; Wed, 20 Sep 2023 08:30:08 +0300 From: =?utf-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0LXRgtGA0L7RgdGP0L0gKHdlYik=?= To: "pgsql-general@lists.postgresql.org" Subject: debugger from superuser only.... why? MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 20 Sep 2023 08:30:08 +0300 Message-Id: <6006191695187640@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/html; charset=utf-8 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk
Checked few sources, can not seem to find reasoning behind this limit:

> You must have superuser privileges to use the debugger.

From here.
 
Say, in java/c++/many_others... one can debug from non-proviledged user allright. Not so with pldbgapi.
 
What is the reason?
 
Alexander Petrossian (PAF)
From fluca1978@gmail.com Fri Sep 22 11:20:14 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjeDS-00BayB-0w for pgsql-general@arkaria.postgresql.org; Fri, 22 Sep 2023 11:20:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qjeDQ-0036CE-CW for pgsql-general@arkaria.postgresql.org; Fri, 22 Sep 2023 11:20:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjeDP-0036C2-Vi for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 11:20:55 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qjeDN-006uye-6m for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 11:20:55 +0000 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-69101022969so1844062b3a.3 for ; Fri, 22 Sep 2023 04:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695381650; x=1695986450; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o8DvVUrMjukMSQBjAPXUPQdPUg+pJ0UrXa2PhsqxcsA=; b=C40LD4hln8nswZtPJ3bTuHOv+JnUlL2TZuEOCSD+HHSsAraEdfqXN61H4eWeKuRca/ MkK16cfudAp1HH7CYWWRgjhz+h0hBiDBK3Gf+sxNSvsfgVbcMayVrC6YeiBqBZ7BPjzD 2nQ9Bs/9ChgRHKGCgayq9KqTUUNXk5z8pLxs0dSFTEjyytnkVMmjlAQcD2+oJeXcKElw MIGNXZ5iAB7M+GCULZaTelglHamaoKjxkzBl4HY90xZnPYidCP4p3XqU3+YfaLkx4V1+ lfXha1J782Y+sMraG/IhxG/rt5b5XGfK4/nPoErK9ir91gKKHPv30gxG6NzzWr1s8kyj sB7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695381650; x=1695986450; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o8DvVUrMjukMSQBjAPXUPQdPUg+pJ0UrXa2PhsqxcsA=; b=n+4WS7flqvafmqhOHpok48c96Q0tgAlwYgwsIdHOP2an3gd+//Zc7BL43GbUV0It5n wpb+quPtnDtmlsIAec93PVQnf0fgf4ZEHLomuaLrkCsIEAeEz3dmzxZTqSKpsNAa3Kgb MKKEu51X+t+Gu22QOm2P712DsrTQ+C9kdvA/EjY+mKi1oDt8gcyvP8rrjl+iWGqt3UBi 0MDZkuE3Tdy7TmX/tOQAjCa9BNuDs8ccfttW+b2GCF6pR+kDBchmViEvm9eqBfJPPwZj 1kAqKs6mzx4sTa17bmD5qbQjoz3PqP20DAzZwjHmOqLDIGwr3OqLgvbUOhzPFkqsqndN IEkg== X-Gm-Message-State: AOJu0YzAl6cx5/tMqwbmA7Tg9HRYJRTDHTmN3sNYy4ykbV4nFwoIrR3/ /YU1Q0dRiGcqLm/IbzB8WnK88XIb5+IubTtSI84= X-Google-Smtp-Source: AGHT+IHpdr7Kvr6i+N6Bk8kex/UazOm4dDt3xcvpSU+JB2FlQJSCrB/tBPSzM00A+4ARtKxkArhQEaJjrczPoaOx9cc= X-Received: by 2002:a05:6a21:9988:b0:131:c760:2a0b with SMTP id ve8-20020a056a21998800b00131c7602a0bmr9515147pzb.52.1695381650357; Fri, 22 Sep 2023 04:20:50 -0700 (PDT) MIME-Version: 1.0 References: <6006191695187640@mail.yandex.ru> In-Reply-To: <6006191695187640@mail.yandex.ru> From: Luca Ferrari Date: Fri, 22 Sep 2023 13:20:14 +0200 Message-ID: Subject: Re: debugger from superuser only.... why? To: =?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0LXRgtGA0L7RgdGP0L0gKHdlYik=?= Cc: "pgsql-general@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Sep 20, 2023 at 9:32=E2=80=AFAM =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0= =B0=D0=BD=D0=B4=D1=80 =D0=9F=D0=B5=D1=82=D1=80=D0=BE=D1=81=D1=8F=D0=BD (web= ) wrote: > > Checked few sources, can not seem to find reasoning behind this limit: > > > You must have superuser privileges to use the debugger. > It means database superuser. > What is the reason? I suspect the debugger will need to open a connection back to pgadmin, and that probably is the need for privileges. Luca From alexander.petrossian@gmail.com Fri Sep 22 11:28:22 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkhKr-00FlDA-7V for pgsql-general@arkaria.postgresql.org; Mon, 25 Sep 2023 08:52:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qkhKp-00GyIK-Te for pgsql-general@arkaria.postgresql.org; Mon, 25 Sep 2023 08:52:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjeKj-003DU0-Ua for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 11:28:29 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qjeKh-006v2E-3Y for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 11:28:29 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-5041335fb9cso3292256e87.0 for ; Fri, 22 Sep 2023 04:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695382106; x=1695986906; darn=lists.postgresql.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=byqqrhhLqszCdalUvCFBoPCKaRUligT0CKDLD795fQo=; b=UxPMwVbzckEEmMAw3Z7xcZseGwqxqQFbJ3v/tu8dR23aqg221ktyZTQ4R5GYUk7GIh 5LseeorY9/5SlZzW0wC9pPaKvwuEtjFH+0cLuKVdziblouVdUYJdxczXWRIWXAteAPal 7RitXFxsOpV6REuPhcQsMuDXhoyn95lCcuR60or5zjqbZMBzz/PJdu1HdlTaSLeK1FHB 8/oG2sckuSPyPp6uytODO7UGIt+xp3Cbcx3Tylu4MhXVdQ5Wg+ODetIBkSKOMxpBsgbv Stfu/V5hjV9z1GwZAMQQaut+Z461x5A9fCHYy5ji42W3WiCDRo1tc0OGI9B8hnYPDEMs 3IvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695382106; x=1695986906; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=byqqrhhLqszCdalUvCFBoPCKaRUligT0CKDLD795fQo=; b=McUYJYBKJrwaLgcXSSUOtYBNWW5LuZnfXcmyfYTD+fza33ts40FpQFQeTruSepyiWT Q2ld47Ktquo58uJnAXHNOwK1A4n7aJ4AhNVMSEHbzI0bFR/3tEhJTzJjyjTCwt7Re/Hg amjyiPZCcYG1VobMRLSbr1sGprij1EcbcPZueBHYe1CLt9JCcHJgZU6SxSkGzQFdI+oS bXkoM7PzdK39PYSKGFDLVh+qLGBX4vfIDOas1mto3zzQqQRR1r5Dt3dtLUGcVT0HiL1V kol0DhWukE8XYNRpxYRkEZ0tTCZ7RJHI7gieEfPMgt6VfnGh7Ru/gIlvgpkahTvOkvwm 9FGw== X-Gm-Message-State: AOJu0YwxD5Pcdi1Py/jaX5YR+NjRUYw4Lyl4M9WkU/iKM6To2HJJfSDG tcMA25+3q5JOPcrVCe3DOHNHanMvBG8= X-Google-Smtp-Source: AGHT+IEp6gRoddGWIewJgrcLadU3ylDi/ijAx1lW5vclhPsUb20MTyKB/VoGCmT6NXIe9Hf1nsRAWw== X-Received: by 2002:a05:6512:220a:b0:503:1c58:8a46 with SMTP id h10-20020a056512220a00b005031c588a46mr9363182lfu.9.1695382105525; Fri, 22 Sep 2023 04:28:25 -0700 (PDT) Received: from smtpclient.apple ([185.197.33.6]) by smtp.gmail.com with ESMTPSA id b13-20020ac25e8d000000b004f86d3e52c0sm695318lfq.4.2023.09.22.04.28.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Sep 2023 04:28:24 -0700 (PDT) From: Alexander Petrossian Message-Id: <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_6322E27A-04FF-4797-A052-EA630C7F2B4B" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: debugger from superuser only.... why? Date: Fri, 22 Sep 2023 14:28:22 +0300 In-Reply-To: Cc: =?utf-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0LXRgtGA0L7RgdGP0L0=?= , "pgsql-general@lists.postgresql.org" To: Luca Ferrari References: <6006191695187640@mail.yandex.ru> X-Mailer: Apple Mail (2.3731.600.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_6322E27A-04FF-4797-A052-EA630C7F2B4B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 22 =D1=81=D0=B5=D0=BD=D1=82. 2023 =D0=B3., =D0=B2 14:20, Luca Ferrari = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): >> Checked few sources, can not seem to find reasoning behind this = limit: >> You must have superuser privileges to use the debugger. >> What is the reason? > I suspect the debugger will need to open a connection back to pgadmin, > and that probably is the need for privileges. Not sure. I=E2=80=99ve collected log for supseruser debug session under IntelliJ = plugin. Playing this under non-privileged user... some commands pass (below for = history) and this one does not: > SELECT * FROM pldbg_set_global_breakpoint(1, 65695, -1, NULL); > ERROR: must be a superuser to create a breakpoint I am wondering why is this, why not allow debugging for non-privileged = users? PAF P.S. those that pass are > SELECT setting > FROM pg_settings > WHERE name =3D 'shared_preload_libraries'; >=20 > SELECT * FROM (SELECT > t_namespace.nspname, > t_extension.extname, > t_extension.extversion > FROM pg_extension t_extension > JOIN pg_namespace t_namespace ON = t_extension.extnamespace =3D t_namespace.oid)q; >=20 > SELECT * FROM (SELECT pid, > application_name, > usename, > client_addr > FROM pg_stat_activity > WHERE application_name =3D 'idea_debugger' > AND pid <> pg_backend_pid())q; > SELECT * FROM pldbg_create_listener(); --Apple-Mail=_6322E27A-04FF-4797-A052-EA630C7F2B4B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 22 =D1=81=D0=B5=D0= =BD=D1=82. 2023 =D0=B3., =D0=B2 14:20, Luca Ferrari = <fluca1978@gmail.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0= =B0):
Checked few sources, can not seem to find reasoning behind = this limit:
You must have superuser privileges to use the = debugger.
What is the = reason?
I suspect the debugger will need to open a = connection back to pgadmin,
and that probably is the need for = privileges.

Not = sure.

I=E2=80=99ve collected log for supseruser = debug session under IntelliJ plugin.

Playing = this under non-privileged user... some commands pass (below for history) = and this one does not:

SELECT * FROM pldbg_set_global_breakpoint(1, = 65695, -1, NULL);
ERROR: must be a superuser to create = a breakpoint

I am wondering why is = this, why not allow debugging for non-privileged = users?

PAF

P.= S. those that pass are

SELECT setting
FROM = pg_settings
WHERE name =3D = 'shared_preload_libraries';

SELECT * FROM = (SELECT
              =      t_namespace.nspname,
      =             =  t_extension.extname,
          =         =  t_extension.extversion
        =        FROM pg_extension = t_extension
              =           JOIN pg_namespace t_namespace ON = t_extension.extnamespace =3D = t_namespace.oid)q;

SELECT * FROM (SELECT = pid,
                =       application_name,
      =                 = usename,
              =         client_addr
      =          FROM pg_stat_activity
  =              WHERE application_name =3D= 'idea_debugger'
            =      AND pid <> = pg_backend_pid())q;
SELECT * FROM = pldbg_create_listener();
= --Apple-Mail=_6322E27A-04FF-4797-A052-EA630C7F2B4B-- From fluca1978@gmail.com Fri Sep 22 11:49:14 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjefV-00Bc7V-Un for pgsql-general@arkaria.postgresql.org; Fri, 22 Sep 2023 11:49:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qjefU-003Iqc-HE for pgsql-general@arkaria.postgresql.org; Fri, 22 Sep 2023 11:49:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjefU-003IqO-5m for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 11:49:56 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qjefR-006vC4-Dy for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 11:49:55 +0000 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-578d0dcd4e1so1439373a12.2 for ; Fri, 22 Sep 2023 04:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695383391; x=1695988191; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=BZeDndIX0T6Hj/A0pgAOBeR6p307c517SaZYJgyMO6U=; b=BW1fn+3iTVH9+sacaKmeh5EjJZaOoEa1ciIzHiEAQ9TOS8gIO/YfU6Tcs1xcqXu3b5 fY1TL0sG2G4dcjiFx0TCgiDcyDru7fQI5J5pKinl4OBkktGxPDh2BxiO7mjifpfJITWv PA82bKdlHRl3yojPm3wMcTX9Q/qeMd5bas3rq4dnFUCnM0DVEAbucLhAe8i+PQO3KPMb gDnYVyrYB4opra+Bu3Bz51/+oOLebmhekZWbKMB28n8kqhpYXIUm16x+vc/zh5T9vx1Z 02YH5TDaHdv/V5Uj5MAEliir9nY8u7McOVIEzxKRCq+4KMLdByV0/xFeFQqZzkkjOCMN zW6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695383391; x=1695988191; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BZeDndIX0T6Hj/A0pgAOBeR6p307c517SaZYJgyMO6U=; b=v10xt7kcyJjqk1rO0lxiKxznFerFn7uM7Ib3v44xjA6r/0rbEJnWS0tEiAiJGJ5RSJ qyWUDuU/rcu7OIazLv9/rSweMTdfPagHKQt7kHDbXXENrpF2znMBf8fxE/oEjLErJRX7 XaNy+YrFw2oB2PHtRj7vu2EHvDXKzE9ynXbFRrXVPGsLyyxndqhiebwV5cvPHy2h0Q0a oui6r08x7t7LGW2ZKrHixEH+S/Q7bsQs8DJqjj9+3QzT0npK5Iew1vdUsZBit383n3Eb R8lDcrwzBHCkVsTN4nW4j/1n1mRfx/Mp6+7EL1zhx/YYFPqC/Eg+vrTbxfKXweb3i56N 1HBQ== X-Gm-Message-State: AOJu0YxJkjQ9QWtJFS+ZDwNeZD3ceCRSEq/64tD3cj6Ffaw2iJWtu5r8 YHrc3YsHVcSr5p2H1+ypvn8VLzkNk3QGg8eIsls= X-Google-Smtp-Source: AGHT+IGpfK/gXDo50FFKZ4O5tdEEsHvhPJr4ObYfWiKWX2U+O+nKus1l9aLsNT5U4EGcB+QbCoZ5qAe1ySgwhr/a9V0= X-Received: by 2002:a05:6a20:7d89:b0:153:73ec:fe70 with SMTP id v9-20020a056a207d8900b0015373ecfe70mr9858889pzj.13.1695383391238; Fri, 22 Sep 2023 04:49:51 -0700 (PDT) MIME-Version: 1.0 References: <6006191695187640@mail.yandex.ru> <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> In-Reply-To: <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> From: Luca Ferrari Date: Fri, 22 Sep 2023 13:49:14 +0200 Message-ID: Subject: Re: debugger from superuser only.... why? To: Alexander Petrossian Cc: =?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0LXRgtGA0L7RgdGP0L0=?= , "pgsql-general@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 22, 2023 at 1:28=E2=80=AFPM Alexander Petrossian wrote: > SELECT * FROM pldbg_set_global_breakpoint(1, 65695, -1, NULL); > > ERROR: must be a superuser to create a breakpoint > > > I am wondering why is this, why not allow debugging for non-privileged us= ers? Again, I'm suspecting that this debugger works by performing a sandboxing and attaching your session back. In order to communicate back and forth, you probably need such privileges. You should ask the developers why they need such privileges, or dig the code by yourself. > SELECT setting > FROM pg_settings > WHERE name =3D 'shared_preload_libraries'; > nothing to debug at all in here > SELECT * FROM (SELECT > t_namespace.nspname, > t_extension.extname, > t_extension.extversion > FROM pg_extension t_extension > JOIN pg_namespace t_namespace ON t_extension.extn= amespace =3D t_namespace.oid)q; > ditto > SELECT * FROM (SELECT pid, > application_name, > usename, > client_addr > FROM pg_stat_activity > WHERE application_name =3D 'idea_debugger' > AND pid <> pg_backend_pid())q; nothing to debug in here > SELECT * FROM pldbg_create_listener(); uh oh, it mentions a listener...then there must be some "sender" somehwere, that probably needs privileges. Luca From alexander.petrossian@gmail.com Fri Sep 22 12:00:30 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkhOd-00Flcf-0D for pgsql-general@arkaria.postgresql.org; Mon, 25 Sep 2023 08:56:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qkhOb-00H3Lk-Gl for pgsql-general@arkaria.postgresql.org; Mon, 25 Sep 2023 08:56:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjepy-003Pbv-KW for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 12:00:46 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qjepv-006vH0-Uc for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 12:00:46 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9adb9fa7200so512163266b.0 for ; Fri, 22 Sep 2023 05:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695384043; x=1695988843; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lTJ2jT6PC7ZgL7fnaFpDj93xVv6gfbx+zdtYySd2X2o=; b=TA4yQqaFPhRudrX4E1AMJcgejwhHTaRp/rFMPgefwGFOYsFerdey2zab/aGE7vCSkU A1TbyXxeCCtrFVgFQE33HBp6AaVEjIj9dBwzngZUduYLVOBJj8aa0ariZ2PMIJeE5NNK TP1BoQG8crbweZ64oVtsMyW/hLdPV6PTTVsgOKuG2JdxiI3JBxAS+oRAlobgWhIh4Yn2 lvAMvnB4vnh3dlfQ0UkPMjjXtwmQuzMWlU4zlS5BIBA7i+fyqtRdH3Iofb5VaNGnHsdo ke8lqUQN0gbhl3GpTI2oCrdtxuSxxBaNBscq7tzzVXoN0WADTOwf38EGBDyh+VOokWgD 4acw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695384043; x=1695988843; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lTJ2jT6PC7ZgL7fnaFpDj93xVv6gfbx+zdtYySd2X2o=; b=L6uI/bBuxInwVl1ClU6l77zEZ5vI+/ugTfgRF1fXIno4lyNIJLPcTNKgVxGFsEjKuh Q81WCLpZBQasQkeJFYLUkTFF87ki8bDzV5uUD/AY6tjB5zIY7+gsFdb4W+1rrs4aHGnn uUlqJcfZOMRZ47y6z+2IoSFSTaX4XPvIKpiY42AfjjdFh2mHcfDxHhVLYwCDJ9Cn0krz NipUlV5lhGUIyo8drM1VOR18YNO7FxpsfJpbbi7AngLNqxb0m6n1dRTciMTC6OgKG2xh fJ8ym6x9A9Z88f7IS9+aleGAARwceohtHuSTRXguH3nYNKW+Dn5ohKKNQiLDpWjdFcT9 5XBg== X-Gm-Message-State: AOJu0YxPmBsZTTjf/3Rr1oN35Po+tdr2VCRc1LP5GVQhlfs9DcTCWU+E Jo0+HB3IWcbZYiehUvQI8SlMBL7YGNJbx3hDeWv/5J28 X-Google-Smtp-Source: AGHT+IHb70xPKrSZIw6hK4dMz+1iFpXMRjqH5SrrWZqpVCN9IbamReI8PyGUFbgV+9PsGemUBUwVqgz5EPtDHk96tOg= X-Received: by 2002:a17:907:6e8a:b0:9ae:3768:f0ce with SMTP id sh10-20020a1709076e8a00b009ae3768f0cemr4185978ejc.0.1695384042877; Fri, 22 Sep 2023 05:00:42 -0700 (PDT) MIME-Version: 1.0 References: <6006191695187640@mail.yandex.ru> <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> In-Reply-To: From: "Alexander Petrossian (PAF)" Date: Fri, 22 Sep 2023 15:00:30 +0300 Message-ID: Subject: Re: debugger from superuser only.... why? To: Luca Ferrari Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000a237360605f15b22" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a237360605f15b22 Content-Type: text/plain; charset="UTF-8" > > > > SELECT * FROM pldbg_set_global_breakpoint(1, 65695, -1, NULL); > > ERROR: must be a superuser to create a breakpoint > > I am wondering why is this, why not allow debugging for non-privileged > users? > > Again, I'm suspecting that this debugger works by performing a > sandboxing and attaching your session back. In order to communicate > back and forth, you probably need such privileges. > You should ask the developers why they need such privileges, or dig > the code by yourself. > Some mail list you would suggest, Luka? > > SELECT * FROM pldbg_create_listener(); > uh oh, it mentions a listener...then there must be some "sender" > somehwere, that probably needs privileges. > Surprisingly this passes OK under non-privileged user. PAF --000000000000a237360605f15b22 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

> SELEC= T * FROM pldbg_set_global_breakpoint(1, 65695, -1, NULL);
> ERROR: mu= st be a superuser to create a breakpoint
> I am wondering why is this= , why not allow debugging for non-privileged users?

Again, I'm suspecting that this debugger works by performing a
sandboxing and attaching your session back. In order to communicate
back and forth, you probably need such privileges.
You should ask the developers why they need such privileges, or dig
the code by yourself.

Some mail list yo= u would suggest, Luka?
=C2=A0
> SELECT *= FROM pldbg_create_listener();
uh oh, it mentions a listener...then ther= e must be some "sender"
somehwere, that probably needs privileges.

<= div>Surprisingly=C2=A0this passes OK under non-privileged=C2=A0user.
<= div>

PAF
--000000000000a237360605f15b22-- From fluca1978@gmail.com Fri Sep 22 15:00:34 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjhef-00BkzX-KB for pgsql-general@arkaria.postgresql.org; Fri, 22 Sep 2023 15:01:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qjhee-004RDo-3h for pgsql-general@arkaria.postgresql.org; Fri, 22 Sep 2023 15:01:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjhed-004RDT-M3 for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 15:01:15 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qjhea-0062Va-Lr for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 15:01:14 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2749c756bcaso1637140a91.0 for ; Fri, 22 Sep 2023 08:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695394871; x=1695999671; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ao/LxO2R4AUOOvQT8GQX5N7odJJv6IGpkfV4DvC/EfM=; b=fDa56n9adKiik9K1YEwEvj8unVnvQyWLBQ6fflH8bj+yY12h5Q0f2VeC0qhIEN3cif 7oCSOwZ5Veap1fB4Zz1f2V46AFmIz6fGJnbIPPqiPwR3Wce/RDcu1Q+RB+EDXf458hea 6imG+sKDwBfjxFWMoLXQ9kRkGTSK9y/sosyPl6DiVnjEddMgB6Spn+z1wT9y+hmx9/jn FY17DT2hOX3XhYXUazt5QCtBH3MnTs31/CcUBQ1HKhWH8cK8Au9dqVCxePJj5/9uE7oa ifUnojPqxJEpDwFL+XZsWwxYJj4Rxevmn46hEgSpiifRc7HWJsMS6uCeCDezrYgnHlon VaBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695394871; x=1695999671; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ao/LxO2R4AUOOvQT8GQX5N7odJJv6IGpkfV4DvC/EfM=; b=s2BhdqwQCJ39qGMqfv/f2DyNQllAZgBZJ7I7cuvvo6V+fU27fGxWWZT0khg3VdU9LO ob4wh8eDwZxeZycq/2FGHmyH4FT6LzaUClPKtGz6kNTIzOXNVRchuFd4VkjkhpoHVJ3E Z7aCkmqguCm4PdOkx56l5MBQVdJ/UFHKs/cNPP8Yp2lTO5VpKM+fCOrBMUCOJxXGu25c /4hW1lLndDhaTyC+mE02TiTtpHYk93VNUJt80jvw14NMMQ0ufzy3pfPd83rLcx0ayaJs TMQjuvpw1qYlRtToMSJXFJdSG8soELyIbGQTOkdmZQ5vviJVL3owOeOaMPaNHaUalBGz VSGw== X-Gm-Message-State: AOJu0YxjGF32r1GVs4Iem0lAcZ8XzFbXJ7ahc4qDt3JVWoQtChPZShs6 ZdV5ouNWj8VC2/j/PnyWVp6geQgsaRQnyyZxBg4= X-Google-Smtp-Source: AGHT+IEg3YR0JmKKYD1xEoBhgsQWrVSEOskMS1HaftVAOxF7427fYVffAcrHU9LVwUlb334h0u4jZpQ/3gOZQGlwlsQ= X-Received: by 2002:a17:90b:88e:b0:262:d6cb:3567 with SMTP id bj14-20020a17090b088e00b00262d6cb3567mr8824031pjb.26.1695394871481; Fri, 22 Sep 2023 08:01:11 -0700 (PDT) MIME-Version: 1.0 References: <6006191695187640@mail.yandex.ru> <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> In-Reply-To: From: Luca Ferrari Date: Fri, 22 Sep 2023 17:00:34 +0200 Message-ID: Subject: Re: debugger from superuser only.... why? To: "Alexander Petrossian (PAF)" Cc: "pgsql-general@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 22, 2023 at 2:00=E2=80=AFPM Alexander Petrossian (PAF) wrote: > Some mail list you would suggest, Luka? > pgadmin mailing list, or ask EDB somehwere. >> >> > SELECT * FROM pldbg_create_listener(); >> uh oh, it mentions a listener...then there must be some "sender" >> somehwere, that probably needs privileges. > > > Surprisingly this passes OK under non-privileged user. I meant: somewhere else there must be something that connects back and requires privileges. Also, this (not tried) does not seem to require other privileges . Luca From postgresql439848@heinz-it.de Fri Sep 22 19:05:04 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjlSm-00BzMG-Ud for pgsql-general@arkaria.postgresql.org; Fri, 22 Sep 2023 19:05:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qjlSk-005opL-D9 for pgsql-general@arkaria.postgresql.org; Fri, 22 Sep 2023 19:05:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjlSk-005oov-1f for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 19:05:14 +0000 Received: from hvs.heinz-it.de ([2.59.132.93]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjlSe-0064WC-0Z for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 19:05:12 +0000 Received: from hidden.local (hidden.remote[127.0.0.1]) (Authenticated sender: hidden.user) by hvs.heinz-it.de (Postfix) with ESMTPSA id 8F9933E6B4 for ; Fri, 22 Sep 2023 21:05:05 +0200 (CEST) Message-ID: Date: Fri, 22 Sep 2023 21:05:04 +0200 MIME-Version: 1.0 Subject: Re: debugger from superuser only.... why? To: pgsql-general@lists.postgresql.org References: <6006191695187640@mail.yandex.ru> <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> Content-Language: de-DE, en-GB From: postgresql439848@heinz-it.de In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk hi, the first steps to use debugger: 1. modify config file 2. restart server ... i would say, enough reasons to be superuser or not? From fluca1978@gmail.com Mon Sep 25 13:32:22 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkli0-00GLPv-S1 for pgsql-general@arkaria.postgresql.org; Mon, 25 Sep 2023 13:33:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qklhz-001Y3e-IG for pgsql-general@arkaria.postgresql.org; Mon, 25 Sep 2023 13:33:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qklhz-001Y3K-5U for pgsql-general@lists.postgresql.org; Mon, 25 Sep 2023 13:33:07 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qklhs-006Ynk-23 for pgsql-general@lists.postgresql.org; Mon, 25 Sep 2023 13:33:05 +0000 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-27761d85b31so1043686a91.3 for ; Mon, 25 Sep 2023 06:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695648779; x=1696253579; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Kn7DEq8FHDQayCYLgvsuc0AplM79wTsREFHIccaFgPQ=; b=VSdP37HaMahSLONB0L/4iT987+KGlIMWIeMYcch4wckQudr2UrNUFIXRHPJoddf0us lfinGkj40/XFRx/rHvTVaMbTWuBnbUbQCNktT7rhT5epCZHr07HFrmCYLVE6cycsPFlI P4pliJsDNxR1khYrCd9ycFDAiD4v9e4PRjgA3UC4jWTv06NPoqzdKeE2zyWDKnePVMMw lIUQh4NiSTXNbeB43ruEqG5ouTsbyhSC69/eJs/iqD9qSf0yJOfI2niMIamFiD25QrDy Yc8IHeFWig2M250PRryGrYnq6XxteeI7BYABFMoVtmfWYsZyZli70PKxCw2GvDpH6JNK h70w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695648779; x=1696253579; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kn7DEq8FHDQayCYLgvsuc0AplM79wTsREFHIccaFgPQ=; b=ed0e3YD3NES/U/yY3SrkN9B2fxyM7WIr09tVps5qiRHDDtHUWRnlZ0iRmhh3zUPj2F ePeITAD7R4C7maZzMiAJwzdlww6PomvL3RrxJM2fCimc9qDlsHITpZhaxs8e+i2QeoVs ir1YbCSO+w70OyfxBIbMmgzv94CyWJNaRwYPH3JwiQ1zNPMofp/AmVhHj6aQisE11uDj +daArSqJwCRHce+4VhOb4xop3gS/O4+tP6kbRAVbU01Oka9FOvT4wAJ1qP+KfVXM1mYe PfQzaSUmsOQyZnWTjyC6XCKDiZ+b2857Ued2K7+3wQ/Mf4q5lJ8iCb9wjcV5UtlN7iOC b2rQ== X-Gm-Message-State: AOJu0YwseDSyCZ+Yj0bHFOikvyOLdqN5uqo59JaP+jf8NwbsanH+7Lmo QGs60TggbD22yeBSCswNsZnzs/Uw/PcUi0OYoLTRxTAk X-Google-Smtp-Source: AGHT+IEit8uNF053n6ftCJXTx1GZVGPiSDUsrdr+aLAnsPrPPy0KXkOJoy0eNYwr2JXqml3jRsFsNo2SGkOdbgclG3E= X-Received: by 2002:a17:90a:6547:b0:276:d357:c4bd with SMTP id f7-20020a17090a654700b00276d357c4bdmr4510941pjs.28.1695648778960; Mon, 25 Sep 2023 06:32:58 -0700 (PDT) MIME-Version: 1.0 References: <6006191695187640@mail.yandex.ru> <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> In-Reply-To: From: Luca Ferrari Date: Mon, 25 Sep 2023 15:32:22 +0200 Message-ID: Subject: Re: debugger from superuser only.... why? To: postgresql439848@heinz-it.de Cc: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 22, 2023 at 9:05=E2=80=AFPM wrot= e: > > hi, > the first steps to use debugger: > 1. modify config file > 2. restart server > ... > i would say, enough reasons to be superuser or not? Well, the above are not privileges "to use" the debugger, rather "to configure" the debugger. Luca > > From tgl@sss.pgh.pa.us Mon Sep 25 14:28:34 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkmZm-00GRre-Ug for pgsql-general@arkaria.postgresql.org; Mon, 25 Sep 2023 14:28:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qkmZl-001wp9-5z for pgsql-general@arkaria.postgresql.org; Mon, 25 Sep 2023 14:28:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkmZk-001wot-QE for pgsql-general@lists.postgresql.org; Mon, 25 Sep 2023 14:28:40 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkmZi-006ZDA-37 for pgsql-general@lists.postgresql.org; Mon, 25 Sep 2023 14:28:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 38PESYvl170506; Mon, 25 Sep 2023 10:28:34 -0400 From: Tom Lane To: Alexander Petrossian cc: Luca Ferrari , =?utf-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0LXRgtGA0L7RgdGP0L0=?= , "pgsql-general@lists.postgresql.org" Subject: Re: debugger from superuser only.... why? In-reply-to: <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> References: <6006191695187640@mail.yandex.ru> <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> Comments: In-reply-to Alexander Petrossian message dated "Fri, 22 Sep 2023 14:28:22 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <170504.1695652114.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 25 Sep 2023 10:28:34 -0400 Message-ID: <170505.1695652114@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Petrossian writes: >>> I am wondering why is this, why not allow debugging for non-privileged= users? Seems obvious to me that it'd be a nasty security hole, ie you could take control of somebody else's session and make it do things you don't have permissions for. Even if there's a way to restrict debugging connections to sessions owned by the same user, you'd have a big problem with being able to change the behavior of security-definer functions. Clearly, the authors of pldebugger decided that was a can of worms they didn't care to open. regards, tom lane From alexander.petrossian@gmail.com Wed Sep 27 11:30:43 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlSkm-002uR9-9y for pgsql-general@arkaria.postgresql.org; Wed, 27 Sep 2023 11:30:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qlSkk-003L0e-5k for pgsql-general@arkaria.postgresql.org; Wed, 27 Sep 2023 11:30:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlSkj-003L0P-PN for pgsql-general@lists.postgresql.org; Wed, 27 Sep 2023 11:30:49 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qlSkh-007sls-5q for pgsql-general@lists.postgresql.org; Wed, 27 Sep 2023 11:30:49 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2c1886777d9so4782271fa.0 for ; Wed, 27 Sep 2023 04:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695814246; x=1696419046; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WaiTccRHPAitIZJz5BrZBg8pPJvp2tUeisxO0pw5iJs=; b=T0Aj9/2GO3jB4tV2YWfy18Fl/UTlMpCO2kNeuETF/ZrKk9OwJuHLRuOoJr75lTbeXf Q5gmwEpTt+CRfk6g8ZVWFKXV85MLliqXjE/Ar0MG/OF0DYOgjAULN4PShUjn1XFxT0ts BfAxckfpXexgGM+2faHv9jCq+tDDXL68tPO23FpReB/epLqbC8ZxMMLpWM9raY+8/AtB oduXXS5q5apidmoNBuYaEWqKF7QlbpzgWVFBUdV9wVtSt2OcXgkDAuz4tBGC0s4U9RPs HS/U7+WW+R4P2Ijz5ToxrNwLXtgS3S1oL309t9Vhb/fvxeipmXGlH6Xsdik0i46xVRIM hFdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695814246; x=1696419046; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WaiTccRHPAitIZJz5BrZBg8pPJvp2tUeisxO0pw5iJs=; b=udk0n+YIvx9+xg+V7z6p2FkRgvLogohxx5gOIR8i7wNEmyCSdp/cu9XEBqq8Sgy3lv GMIPNQRVN2Y7vH14fKslv+IQGlmFFyio5AYSAk+ui+r3rrsrEov4H8Dg1GxdkrFJCgxL BK1/7dh/hgIb1xAoUgLDTDCShFW0EJ8xL4drUFy8/FjFb41PUNZSI1InnywGkLguQSx9 yXE4Tvw3hV47L6Z1th/eRyf2r1bUf7eiy9qfv+UrtI/Q6qORC0lc8d4BW34AYRYgEszA ivcl1zWhtSSqD52HrtRlAzYRyt9xxYhfa+uum8068YzmvIvs3U418HR+lFDBKBsoF1bS //Dg== X-Gm-Message-State: AOJu0YxSCpCDAUdXFf95j+T/VEIk8fGS82JLbHQ33obmti5Y9KIVoouy DPkjj7MIFZjb21pk3bTKIr69HlBDaIs= X-Google-Smtp-Source: AGHT+IGsG+IJ2lZoi98tOZPl6m147ElUOqfbBhkmXMzTu+AGK4myvRWpf5QyNNoqPkYKVtu8aSnrfA== X-Received: by 2002:a19:674a:0:b0:500:d4d9:25b5 with SMTP id e10-20020a19674a000000b00500d4d925b5mr1328568lfj.56.1695814245889; Wed, 27 Sep 2023 04:30:45 -0700 (PDT) Received: from smtpclient.apple ([185.197.33.6]) by smtp.gmail.com with ESMTPSA id q27-20020ac25a1b000000b004fe48d0b639sm2631115lfn.83.2023.09.27.04.30.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Sep 2023 04:30:44 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: debugger from superuser only.... why? From: Alexander Petrossian In-Reply-To: <170505.1695652114@sss.pgh.pa.us> Date: Wed, 27 Sep 2023 14:30:43 +0300 Cc: Luca Ferrari , =?utf-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0LXRgtGA0L7RgdGP0L0=?= , "pgsql-general@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <938407CE-46E9-4699-AB0C-DB02F2755B2A@gmail.com> References: <6006191695187640@mail.yandex.ru> <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> <170505.1695652114@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3731.600.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > 25 =D1=81=D0=B5=D0=BD=D1=82. 2023 =D0=B3., =D0=B2 17:28, Tom Lane = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): > Alexander Petrossian writes: >>>> I am wondering why is this, why not allow debugging for = non-privileged users? > Even if there's a way to restrict > debugging connections to sessions owned by the same user, I guess, there is such a way. Looks trivial... > you=E2=80=99d have a big problem with being able to change the = behavior of > security-definer functions. Could you please elaborate on this, Tom? My worry is that it is very inconvenient. And if reasons are not super-solid, maybe one can budge the Author? :) > Clearly, the authors of pldebugger > decided that was a can of worms they didn't care to open. Unless one wants to go fishing ;) PAF= From tgl@sss.pgh.pa.us Wed Sep 27 13:52:09 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlUxc-0034Ge-CN for pgsql-general@arkaria.postgresql.org; Wed, 27 Sep 2023 13:52:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qlUxb-004YDP-1O for pgsql-general@arkaria.postgresql.org; Wed, 27 Sep 2023 13:52:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlUxa-004YDG-Ll for pgsql-general@lists.postgresql.org; Wed, 27 Sep 2023 13:52:14 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlUxX-007tqw-T8 for pgsql-general@lists.postgresql.org; Wed, 27 Sep 2023 13:52:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 38RDq9Gh598115; Wed, 27 Sep 2023 09:52:09 -0400 From: Tom Lane To: Alexander Petrossian cc: Luca Ferrari , =?utf-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0LXRgtGA0L7RgdGP0L0=?= , "pgsql-general@lists.postgresql.org" Subject: Re: debugger from superuser only.... why? In-reply-to: <938407CE-46E9-4699-AB0C-DB02F2755B2A@gmail.com> References: <6006191695187640@mail.yandex.ru> <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> <170505.1695652114@sss.pgh.pa.us> <938407CE-46E9-4699-AB0C-DB02F2755B2A@gmail.com> Comments: In-reply-to Alexander Petrossian message dated "Wed, 27 Sep 2023 14:30:43 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <598113.1695822729.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 27 Sep 2023 09:52:09 -0400 Message-ID: <598114.1695822729@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Petrossian writes: > 25 =D1=81=D0=B5=D0=BD=D1=82. 2023 =D0=B3., =D0=B2 17:28, Tom Lane =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): >> you=E2=80=99d have a big problem with being able to change the behavior= of >> security-definer functions. > Could you please elaborate on this, Tom? pldebugger allows you to change the contents of a function's local variables. Obviously the threat level would depend a lot on the details of the particular function, but it's not hard to envision cases where that would be enough to make the function do something other than what it was supposed to. regards, tom lane From fluca1978@gmail.com Thu Sep 28 06:35:01 2023 Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlkck-004Cks-03 for pgsql-general@arkaria.postgresql.org; Thu, 28 Sep 2023 06:35:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qlkch-009YYm-RF for pgsql-general@arkaria.postgresql.org; Thu, 28 Sep 2023 06:35:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlkch-009YYN-Fe for pgsql-general@lists.postgresql.org; Thu, 28 Sep 2023 06:35:43 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qlkcc-0074GT-K6 for pgsql-general@lists.postgresql.org; Thu, 28 Sep 2023 06:35:42 +0000 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-27734d76e1bso6740387a91.2 for ; Wed, 27 Sep 2023 23:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695882937; x=1696487737; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ogZCYqj+V1pHZANUxa7etSLe9kCa4S1YuX314nd30Zs=; b=AS1tD01oBqhM5RmyLMWLy+2Smv5mfksci6/3lH5rJKSAoWwRFvIh885FpQW9HUzggb ejL/YE53XoaiTr7tKHx+gA/9XvvqmJU9Pr7WFZBjUUvZmFXEqBihn+ZhhcJnNvKXG9Yi 1cvS3hSVJLnak1JY4vmjNv823nKDXOwimhrGB1XipI93XGnHW3AfZWGnxVMvDmoP9r7p yugaBQjI2+TPh3d+ThrPF8QkSHTwM4ra+9OuOWDQpo4kjsVb0w4Km6ckPy3Rfz5QR+5j mzlEqrkIFCDWU6uC3L1MvaFHS+NzXNFcD06HZNFsSVhUn17U0Y+4idTZmB6qIus/iaBT hslw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695882937; x=1696487737; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ogZCYqj+V1pHZANUxa7etSLe9kCa4S1YuX314nd30Zs=; b=KiLqTAJvoIt1bMSjIUUJJoV9XwSzNWbrVsbK+EkyoA3G4QIV2f9dO5Q7BRGDRq9yWa 2r9K1ltmCC5nP6BCYZZGixBTaQ2t+L1N7ko1CbameJIf+azD4kYL8xTkriyDHz25PBxv mIeh6u64lDcY+KErc9VfBBxouP09uN8uqiyNCGt75mFWGzSNsFhPDkFNklcDQY2+l/ZH wtGg343nhfU45uRA9vqwVSG2S0DFCSPakh06/MU2PInjPjM2H7BKWH0kxFGK5WReKmJ8 0ySDADqdfZRUOVVJ93Wd7mmdtD8eMMm8PagWE3y9lRP11S1Jwn5j6/74xzJQ9pvXM0E8 TrQg== X-Gm-Message-State: AOJu0YwGVpkZN0EoejinbDPy3L4c74Bqa6LmCz9maGs+myHCoFarUdSg yY+zw+hc0wuJ4Uf4hfptGjtBODWIOJdO3fk84ow= X-Google-Smtp-Source: AGHT+IHDzGb5yq8eZhNc2neyWFAIjZhmf1CgCYdOG6HWoDXwS3v7wtueH54vpBtmXw/iKdM++ob1veokfaBtVdYJMYs= X-Received: by 2002:a17:90b:1e0b:b0:267:faba:705 with SMTP id pg11-20020a17090b1e0b00b00267faba0705mr302121pjb.10.1695882937385; Wed, 27 Sep 2023 23:35:37 -0700 (PDT) MIME-Version: 1.0 References: <6006191695187640@mail.yandex.ru> <086C5BA0-7B8F-42EE-ABEC-3EF403D1599B@gmail.com> <170505.1695652114@sss.pgh.pa.us> <938407CE-46E9-4699-AB0C-DB02F2755B2A@gmail.com> In-Reply-To: <938407CE-46E9-4699-AB0C-DB02F2755B2A@gmail.com> From: Luca Ferrari Date: Thu, 28 Sep 2023 08:35:01 +0200 Message-ID: Subject: Re: debugger from superuser only.... why? To: Alexander Petrossian Cc: Tom Lane , =?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0LXRgtGA0L7RgdGP0L0=?= , "pgsql-general@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Sep 27, 2023 at 1:30=E2=80=AFPM Alexander Petrossian wrote: > > > 25 =D1=81=D0=B5=D0=BD=D1=82. 2023 =D0=B3., =D0=B2 17:28, Tom Lane =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): > > Alexander Petrossian writes: > >>>> I am wondering why is this, why not allow debugging for non-privileg= ed users? > > Even if there's a way to restrict > > debugging connections to sessions owned by the same user, > > I guess, there is such a way. Looks trivial... > I think that any debugger in any environment can be nasty things, being able to trace and modify a running "thing". Having said that, I believe that the reason about why pldebugger needs superuser privileges could be explained only by the authors (or someone reading the code). Quite frankly, I would point out that you probably would not allow pldebugger to run on a production system, as well as you probably will not debug your production application thing. flipping the coin, it could be that requiring superuser privileges to attach the debugger is a good thing, so you normal poor user don't risk to attach a malicious debugger in a production environment (because you don't have superuser privileges in a production environment, right?). But again, I suspect only the authors can explain that. Luca