From patchwork Tue Apr 14 05:57:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 1270121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 491ZYN0hwzz9s71 for ; Tue, 14 Apr 2020 15:58:48 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=LsPqUMfm; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 491ZYM518QzDqKT for ; Tue, 14 Apr 2020 15:58:47 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 491ZYF5w8DzDq62 for ; Tue, 14 Apr 2020 15:58:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=LsPqUMfm; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1023) id 491ZYF58MRz9sSq; Tue, 14 Apr 2020 15:58:41 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1586843921; bh=gQszXDfN/fkaiJ8Nj9AtPQ29zluPHxRcJa53blUH3Sg=; h=From:To:Subject:Date:From; b=LsPqUMfmjGRPjxKRPXJPGFC6gznyt3uMccTmOjcCYi6PZlDMPpCd4CpcweD48dcQB w8UIteSN7qPbyp3KneX+apcwkwsE68h3lTnlQIisvQMg4UMIJXSdwpRq50sQgG2oGl scnOI05wn4cbgNQ/B8DILBOKrY8WhrUYNFXdxHVykDSIohDtMuQBQo1R+6orf5T4Xv mowv4vbXZIabThtuXC0MrReQfeQ1/+uy2f7Q9Vd/8tGtqHQ5ZYMV3tb0Tpdk9h7FLS er5AjqIm9LXYmcCGw0w5f4ZfyDrNinCeu20KQsN4IByWt3Zy8qorTrFGrvhwrI7hI6 4xwGRxHdrchjg== From: Jeremy Kerr To: patchwork@lists.ozlabs.org Subject: [PATCH] lib/sql: Update grant script for recent schema changes Date: Tue, 14 Apr 2020 13:57:53 +0800 Message-Id: <20200414055753.10657-1-jk@ozlabs.org> X-Mailer: git-send-email 2.17.1 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" This change fixes a few omissions in the grant scripts: - patchrelation is missing from both mysql and postgres scripts; it's only needed for web user access. - event is missing from the web grants on postgres, and the mail grants on mysql. Tested on postgres only. Fixes: 27c2acf56c ("models, templates: Add patch relations") Fixes: 34e3c9c493 ("sql: Update 'grant-all.mysql' script with missing tables") Fixes: 234bc7c316 ("lib/sql: fix permissions for v2.0.0 on postgres") Signed-off-by: Jeremy Kerr --- lib/sql/grant-all.mysql.sql | 2 ++ lib/sql/grant-all.postgres.sql | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib/sql/grant-all.mysql.sql b/lib/sql/grant-all.mysql.sql index 0277077..100cd38 100644 --- a/lib/sql/grant-all.mysql.sql +++ b/lib/sql/grant-all.mysql.sql @@ -23,6 +23,7 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_emailoptout TO 'www-data'@loca GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_event TO 'www-data'@localhost; GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patch TO 'www-data'@localhost; GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patchchangenotification TO 'www-data'@localhost; +GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patchrelation TO 'www-data'@localhost; GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patchtag TO 'www-data'@localhost; GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_person TO 'www-data'@localhost; GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_project TO 'www-data'@localhost; @@ -38,6 +39,7 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_userprofile_maintainer_project -- cover letters) and series GRANT INSERT, SELECT ON patchwork_comment TO 'nobody'@localhost; GRANT INSERT, SELECT ON patchwork_coverletter TO 'nobody'@localhost; +GRANT INSERT, SELECT ON patchwork_event TO 'nobody'@localhost; GRANT INSERT, SELECT ON patchwork_patch TO 'nobody'@localhost; GRANT INSERT, SELECT ON patchwork_person TO 'nobody'@localhost; GRANT INSERT, SELECT ON patchwork_series TO 'nobody'@localhost; diff --git a/lib/sql/grant-all.postgres.sql b/lib/sql/grant-all.postgres.sql index 10ec8d2..56a2486 100644 --- a/lib/sql/grant-all.postgres.sql +++ b/lib/sql/grant-all.postgres.sql @@ -21,8 +21,10 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_delegationrule, patchwork_emailconfirmation, patchwork_emailoptout, + patchwork_event, patchwork_patch, patchwork_patchchangenotification, + patchwork_patchrelation, patchwork_patchtag, patchwork_person, patchwork_project, @@ -50,7 +52,9 @@ GRANT SELECT, UPDATE ON patchwork_comment_id_seq, patchwork_delegationrule_id_seq, patchwork_emailconfirmation_id_seq, + patchwork_event_id_seq, patchwork_patch_id_seq, + patchwork_patchrelation_id_seq, patchwork_patchtag_id_seq, patchwork_person_id_seq, patchwork_project_id_seq,