Message ID | 20190904133938.9000-1-alialnu@mellanox.com |
---|---|
State | Accepted |
Headers | show |
Series | sql: Fix table lists | expand |
On Wed, 2019-09-04 at 13:40 +0000, Ali Alnubani wrote: > The patch adds missing commas in the table lists where > missing, and removes where unnecessary. > This fixes errors such as the following when feeding the > script to psql: > > ``` > psql:lib/sql/grant-all.postgres.sql:37: ERROR: syntax error at or near > "patchwork_emailconfirmation" > LINE 19: patchwork_emailconfirmation, > ... > ``` > > Fixes: ca0e79d4db34 ("sql: Sort 'grant-all' scripts alphabetically") > > Signed-off-by: Ali Alnubani <alialnu@mellanox.com> Nicely done. Applied and backported to stable/2.1. Thanks! Stephen
Thanks Stephen. I see the following section in the docs https://patchwork.readthedocs.io/en/latest/deployment/installation/#mail-transfer-agent-mta: """ This assumes your Postfix process is running as the nobody user. If this is not correct (use of postfix user is also common), you should change both the username in the createuser command above and substitute the username in the grant-all-postgres.sql script with the appropriate alternative. """ But I believe that it doesn’t have to be the user running the postfix process, It's the permissions defined by postfix's conf default_privs: http://www.postfix.org/postconf.5.html#default_privs Can you confirm my thought? Thanks, Ali > -----Original Message----- > From: Stephen Finucane <stephen@that.guru> > Sent: Friday, September 6, 2019 4:31 PM > To: Ali Alnubani <alialnu@mellanox.com>; patchwork@lists.ozlabs.org > Cc: Thomas Monjalon <thomas@monjalon.net> > Subject: Re: [PATCH] sql: Fix table lists > > On Wed, 2019-09-04 at 13:40 +0000, Ali Alnubani wrote: > > The patch adds missing commas in the table lists where missing, and > > removes where unnecessary. > > This fixes errors such as the following when feeding the script to > > psql: > > > > ``` > > psql:lib/sql/grant-all.postgres.sql:37: ERROR: syntax error at or > > near "patchwork_emailconfirmation" > > LINE 19: patchwork_emailconfirmation, ... > > ``` > > > > Fixes: ca0e79d4db34 ("sql: Sort 'grant-all' scripts alphabetically") > > > > Signed-off-by: Ali Alnubani <alialnu@mellanox.com> > > Nicely done. Applied and backported to stable/2.1. > > Thanks! > > Stephen
On Sun, 2019-09-08 at 07:13 +0000, Ali Alnubani wrote: > Thanks Stephen. > > I see the following section in the docs https://patchwork.readthedocs.io/en/latest/deployment/installation/#mail-transfer-agent-mta: > """ > This assumes your Postfix process is running as the nobody user. If > this is not correct (use of postfix user is also common), you should > change both the username in the createuser command above and > substitute the username in the grant-all-postgres.sql script with the > appropriate alternative. > """ > But I believe that it doesn’t have to be the user running the postfix process, > It's the permissions defined by postfix's conf default_privs: > http://www.postfix.org/postconf.5.html#default_privs > > Can you confirm my thought? To be honest, I'll have to let somone else answer this. I wrote that quite a long time ago and haven't really touched it since, so I've long since forgotten the reason I included that /o\ What you've said does make sense though, so if you've tested it and it works as expected or you can find a blog that says the same thing, I'd be happy to accept a patch to correct this. Sorry I can't be of more help, Stephen > Thanks, > Ali > > > -----Original Message----- > > From: Stephen Finucane <stephen@that.guru> > > Sent: Friday, September 6, 2019 4:31 PM > > To: Ali Alnubani <alialnu@mellanox.com>; patchwork@lists.ozlabs.org > > Cc: Thomas Monjalon <thomas@monjalon.net> > > Subject: Re: [PATCH] sql: Fix table lists > > > > On Wed, 2019-09-04 at 13:40 +0000, Ali Alnubani wrote: > > > The patch adds missing commas in the table lists where missing, and > > > removes where unnecessary. > > > This fixes errors such as the following when feeding the script to > > > psql: > > > > > > ``` > > > psql:lib/sql/grant-all.postgres.sql:37: ERROR: syntax error at or > > > near "patchwork_emailconfirmation" > > > LINE 19: patchwork_emailconfirmation, ... > > > ``` > > > > > > Fixes: ca0e79d4db34 ("sql: Sort 'grant-all' scripts alphabetically") > > > > > > Signed-off-by: Ali Alnubani <alialnu@mellanox.com> > > > > Nicely done. Applied and backported to stable/2.1. > > > > Thanks! > > > > Stephen
Hi Stephen, > -----Original Message----- > From: Stephen Finucane <stephen@that.guru> > Sent: Sunday, September 8, 2019 8:51 PM > To: Ali Alnubani <alialnu@mellanox.com>; patchwork@lists.ozlabs.org > Cc: Thomas Monjalon <thomas@monjalon.net> > Subject: Re: [PATCH] sql: Fix table lists > > On Sun, 2019-09-08 at 07:13 +0000, Ali Alnubani wrote: > > Thanks Stephen. > > > > I see the following section in the docs > https://patchwork.readthedocs.io/en/latest/deployment/installation/#mail- > transfer-agent-mta: > > """ > > This assumes your Postfix process is running as the nobody user. If > > this is not correct (use of postfix user is also common), you should > > change both the username in the createuser command above and > > substitute the username in the grant-all-postgres.sql script with the > > appropriate alternative. > > """ > > But I believe that it doesn’t have to be the user running the postfix > > process, It's the permissions defined by postfix's conf default_privs: > > http://www.postfix.org/postconf.5.html#default_privs > > > > Can you confirm my thought? > > To be honest, I'll have to let somone else answer this. I wrote that quite a > long time ago and haven't really touched it since, so I've long since forgotten > the reason I included that /o\ What you've said does make sense though, so > if you've tested it and it works as expected or you can find a blog that says > the same thing, I'd be happy to accept a patch to correct this. > > Sorry I can't be of more help, > Stephen I just sent a patch http://patchwork.ozlabs.org/patch/1180692/. > > > Thanks, > > Ali > > > > > -----Original Message----- > > > From: Stephen Finucane <stephen@that.guru> > > > Sent: Friday, September 6, 2019 4:31 PM > > > To: Ali Alnubani <alialnu@mellanox.com>; patchwork@lists.ozlabs.org > > > Cc: Thomas Monjalon <thomas@monjalon.net> > > > Subject: Re: [PATCH] sql: Fix table lists > > > > > > On Wed, 2019-09-04 at 13:40 +0000, Ali Alnubani wrote: > > > > The patch adds missing commas in the table lists where missing, > > > > and removes where unnecessary. > > > > This fixes errors such as the following when feeding the script to > > > > psql: > > > > > > > > ``` > > > > psql:lib/sql/grant-all.postgres.sql:37: ERROR: syntax error at or > > > > near "patchwork_emailconfirmation" > > > > LINE 19: patchwork_emailconfirmation, ... > > > > ``` > > > > > > > > Fixes: ca0e79d4db34 ("sql: Sort 'grant-all' scripts > > > > alphabetically") > > > > > > > > Signed-off-by: Ali Alnubani <alialnu@mellanox.com> > > > > > > Nicely done. Applied and backported to stable/2.1. The patch doesn't seem to be in stable/2.1 yet. I also noticed that it doesn't apply there. Let me know if you want me to backport it. > > > > > > Thanks! > > > > > > Stephen Thanks, Ali
>> > > Subject: Re: [PATCH] sql: Fix table lists >> > > >> > > On Wed, 2019-09-04 at 13:40 +0000, Ali Alnubani wrote: >> > > > The patch adds missing commas in the table lists where missing, >> > > > and removes where unnecessary. >> > > > This fixes errors such as the following when feeding the script to >> > > > psql: >> > > > >> > > > ``` >> > > > psql:lib/sql/grant-all.postgres.sql:37: ERROR: syntax error at or >> > > > near "patchwork_emailconfirmation" >> > > > LINE 19: patchwork_emailconfirmation, ... >> > > > ``` >> > > > >> > > > Fixes: ca0e79d4db34 ("sql: Sort 'grant-all' scripts >> > > > alphabetically") >> > > > >> > > > Signed-off-by: Ali Alnubani <alialnu@mellanox.com> >> > > >> > > Nicely done. Applied and backported to stable/2.1. > > The patch doesn't seem to be in stable/2.1 yet. I also noticed that it doesn't apply there. > Let me know if you want me to backport it. If you're able to send a backport I'll happily apply it. Regards, Daniel > >> > > >> > > Thanks! >> > > >> > > Stephen > > Thanks, > Ali > _______________________________________________ > Patchwork mailing list > Patchwork@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/patchwork
Hi Daniel, > -----Original Message----- > From: Daniel Axtens <dja@axtens.net> > Sent: Tuesday, October 29, 2019 8:16 AM > To: Ali Alnubani <alialnu@mellanox.com>; Stephen Finucane > <stephen@that.guru>; patchwork@lists.ozlabs.org > Cc: Thomas Monjalon <thomas@monjalon.net> > Subject: RE: [PATCH] sql: Fix table lists > > >> > > Subject: Re: [PATCH] sql: Fix table lists > >> > > > >> > > On Wed, 2019-09-04 at 13:40 +0000, Ali Alnubani wrote: > >> > > > The patch adds missing commas in the table lists where missing, > >> > > > and removes where unnecessary. > >> > > > This fixes errors such as the following when feeding the script > >> > > > to > >> > > > psql: > >> > > > > >> > > > ``` > >> > > > psql:lib/sql/grant-all.postgres.sql:37: ERROR: syntax error at > >> > > > or near "patchwork_emailconfirmation" > >> > > > LINE 19: patchwork_emailconfirmation, ... > >> > > > ``` > >> > > > > >> > > > Fixes: ca0e79d4db34 ("sql: Sort 'grant-all' scripts > >> > > > alphabetically") > >> > > > > >> > > > Signed-off-by: Ali Alnubani <alialnu@mellanox.com> > >> > > > >> > > Nicely done. Applied and backported to stable/2.1. > > > > The patch doesn't seem to be in stable/2.1 yet. I also noticed that it doesn't > apply there. > > Let me know if you want me to backport it. > > If you're able to send a backport I'll happily apply it. Backported: http://patchwork.ozlabs.org/patch/1185906/ Thanks, Ali
diff --git a/lib/sql/grant-all.postgres.sql b/lib/sql/grant-all.postgres.sql index 8f500e9..10ec8d2 100644 --- a/lib/sql/grant-all.postgres.sql +++ b/lib/sql/grant-all.postgres.sql @@ -18,7 +18,7 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_check, patchwork_comment, patchwork_coverletter, - patchwork_delegationrule + patchwork_delegationrule, patchwork_emailconfirmation, patchwork_emailoptout, patchwork_patch, @@ -32,7 +32,7 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_submission, patchwork_tag, patchwork_userprofile, - patchwork_userprofile_maintainer_projects, + patchwork_userprofile_maintainer_projects TO "www-data"; GRANT SELECT, UPDATE ON auth_group_id_seq, @@ -48,7 +48,7 @@ GRANT SELECT, UPDATE ON patchwork_bundlepatch_id_seq, patchwork_check_id_seq, patchwork_comment_id_seq, - patchwork_delegationrule_id_seq + patchwork_delegationrule_id_seq, patchwork_emailconfirmation_id_seq, patchwork_patch_id_seq, patchwork_patchtag_id_seq, @@ -59,7 +59,7 @@ GRANT SELECT, UPDATE ON patchwork_state_id_seq, patchwork_tag_id_seq, patchwork_userprofile_id_seq, - patchwork_userprofile_maintainer_projects_id_seq, + patchwork_userprofile_maintainer_projects_id_seq TO "www-data"; -- allow the mail user (in this case, 'nobody') to add submissions (patches, @@ -67,30 +67,30 @@ TO "www-data"; GRANT INSERT, SELECT ON patchwork_comment, patchwork_coverletter, - patchwork_event + patchwork_event, patchwork_seriesreference, - patchwork_submission, + patchwork_submission TO "nobody"; GRANT INSERT, SELECT, UPDATE, DELETE ON patchwork_patch, patchwork_patchtag, - patchwork_person - patchwork_series, + patchwork_person, + patchwork_series TO "nobody"; GRANT SELECT ON - patchwork_delegationrule + patchwork_delegationrule, patchwork_project, patchwork_state, - patchwork_tag, + patchwork_tag TO "nobody"; GRANT UPDATE, SELECT ON patchwork_comment_id_seq, - patchwork_event_id_seq + patchwork_event_id_seq, patchwork_patch_id_seq, patchwork_patchtag_id_seq, patchwork_person_id_seq, patchwork_series_id_seq, - patchwork_seriesreference_id_seq, + patchwork_seriesreference_id_seq TO "nobody"; COMMIT;
The patch adds missing commas in the table lists where missing, and removes where unnecessary. This fixes errors such as the following when feeding the script to psql: ``` psql:lib/sql/grant-all.postgres.sql:37: ERROR: syntax error at or near "patchwork_emailconfirmation" LINE 19: patchwork_emailconfirmation, ... ``` Fixes: ca0e79d4db34 ("sql: Sort 'grant-all' scripts alphabetically") Signed-off-by: Ali Alnubani <alialnu@mellanox.com> --- lib/sql/grant-all.postgres.sql | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)