Em ter., 2 de jul. de 2024 às 06:44, Daniel Gustafsson
escreveu:
> > On 2 Jul 2024, at 02:33, Michael Paquier wrote:
> >
> > On Mon, Jul 01, 2024 at 09:19:59PM +0200, Daniel Gustafsson wrote:
> >>> The bit I don't understand about this discussion is what will happen
> >>> with users that current
> On 2 Jul 2024, at 02:33, Michael Paquier wrote:
>
> On Mon, Jul 01, 2024 at 09:19:59PM +0200, Daniel Gustafsson wrote:
>>> The bit I don't understand about this discussion is what will happen
>>> with users that currently have exactly 1024 chars in backup names today.
>>> With this change, we'l
On Mon, Jul 01, 2024 at 09:19:59PM +0200, Daniel Gustafsson wrote:
>> The bit I don't understand about this discussion is what will happen
>> with users that currently have exactly 1024 chars in backup names today.
>> With this change, we'll be truncating their names to 1023 chars instead.
>> Why w
> On 1 Jul 2024, at 21:58, Ranier Vilela wrote:
> We only have to replace it with strlcpy.
Thanks, I'll have a look at applying this in the tomorrow morning.
--
Daniel Gustafsson
Em seg., 1 de jul. de 2024 às 16:20, Daniel Gustafsson
escreveu:
> > On 1 Jul 2024, at 21:15, Alvaro Herrera wrote:
> > On 2024-Jul-01, Ranier Vilela wrote:
>
> >>> - charname[MAXPGPATH + 1];
> >>> + charname[MAXPGPATH];/* backup label name */
> >>>
> >>> With
Em seg., 1 de jul. de 2024 às 16:15, Alvaro Herrera
escreveu:
> On 2024-Jul-01, Ranier Vilela wrote:
>
> > > - charname[MAXPGPATH + 1];
> > > + charname[MAXPGPATH];/* backup label name */
> > >
> > > With the introduced use of strlcpy, why do we need to change
> On 1 Jul 2024, at 21:15, Alvaro Herrera wrote:
> On 2024-Jul-01, Ranier Vilela wrote:
>>> - charname[MAXPGPATH + 1];
>>> + charname[MAXPGPATH];/* backup label name */
>>>
>>> With the introduced use of strlcpy, why do we need to change this field?
>>>
>> Th
On 2024-Jul-01, Ranier Vilela wrote:
> > - charname[MAXPGPATH + 1];
> > + charname[MAXPGPATH];/* backup label name */
> >
> > With the introduced use of strlcpy, why do we need to change this field?
> >
> The part about being the only reference in the entire cod
Em seg., 1 de jul. de 2024 às 14:35, Ranier Vilela
escreveu:
> Em seg., 1 de jul. de 2024 às 06:20, Daniel Gustafsson
> escreveu:
>
>> > On 27 Jun 2024, at 13:50, Ranier Vilela wrote:
>>
>> > Now with file patch really attached.
>>
>> - if (strlen(backupidstr) > MAXPGPATH)
>> + if (
Em seg., 1 de jul. de 2024 às 06:20, Daniel Gustafsson
escreveu:
> > On 27 Jun 2024, at 13:50, Ranier Vilela wrote:
>
> > Now with file patch really attached.
>
> - if (strlen(backupidstr) > MAXPGPATH)
> + if (strlcpy(state->name, backupidstr, sizeof(state->name)) >=
> sizeof(state->
> On 27 Jun 2024, at 13:50, Ranier Vilela wrote:
> Now with file patch really attached.
- if (strlen(backupidstr) > MAXPGPATH)
+ if (strlcpy(state->name, backupidstr, sizeof(state->name)) >=
sizeof(state->name))
ereport(ERROR,
Stylistic nit perhaps, I would keep the
> On 27 Jun 2024, at 06:01, Yugo NAGATA wrote:
>> Em dom., 23 de jun. de 2024 às 23:56, Richard Guo
>> escreveu:
>>> On Mon, Jun 24, 2024 at 7:51 AM Ranier Vilela wrote:
memcpy with strlen does not copy the whole string.
strlen returns the exact length of the string, without
the
Em qui., 27 de jun. de 2024 às 08:48, Ranier Vilela
escreveu:
> Em qui., 27 de jun. de 2024 às 01:01, Yugo NAGATA
> escreveu:
>
>> On Mon, 24 Jun 2024 08:25:36 -0300
>> Ranier Vilela wrote:
>>
>> > Em dom., 23 de jun. de 2024 às 23:56, Richard Guo <
>> guofengli...@gmail.com>
>> > escreveu:
>>
Em qui., 27 de jun. de 2024 às 01:01, Yugo NAGATA
escreveu:
> On Mon, 24 Jun 2024 08:25:36 -0300
> Ranier Vilela wrote:
>
> > Em dom., 23 de jun. de 2024 às 23:56, Richard Guo <
> guofengli...@gmail.com>
> > escreveu:
> >
> > > On Mon, Jun 24, 2024 at 7:51 AM Ranier Vilela
> wrote:
> > > > In s
On Thu, Jun 27, 2024 at 12:17:04PM +0900, Yugo NAGATA wrote:
> I don't think it is better to show a string longer than MAXPGPATH (=1024)
> in the error message.
+1. I am not convinced that this is useful in this context.
--
Michael
signature.asc
Description: PGP signature
On Mon, 24 Jun 2024 08:25:36 -0300
Ranier Vilela wrote:
> Em dom., 23 de jun. de 2024 às 23:56, Richard Guo
> escreveu:
>
> > On Mon, Jun 24, 2024 at 7:51 AM Ranier Vilela wrote:
> > > In src/include/access/xlogbackup.h, the field *name*
> > > has one byte extra to store null-termination.
> >
On Mon, 24 Jun 2024 08:37:26 -0300
Ranier Vilela wrote:
> Em seg., 24 de jun. de 2024 às 00:27, Yugo NAGATA
> escreveu:
>
> > On Sun, 23 Jun 2024 22:34:03 -0300
> > Ranier Vilela wrote:
> >
> > > Em dom., 23 de jun. de 2024 às 22:14, Ranier Vilela > >
> > > escreveu:
> > >
> > > > Em dom., 23
Em seg., 24 de jun. de 2024 às 00:27, Yugo NAGATA
escreveu:
> On Sun, 23 Jun 2024 22:34:03 -0300
> Ranier Vilela wrote:
>
> > Em dom., 23 de jun. de 2024 às 22:14, Ranier Vilela >
> > escreveu:
> >
> > > Em dom., 23 de jun. de 2024 às 22:05, Ranier Vilela <
> ranier...@gmail.com>
> > > escreveu
Em dom., 23 de jun. de 2024 às 23:56, Richard Guo
escreveu:
> On Mon, Jun 24, 2024 at 7:51 AM Ranier Vilela wrote:
> > In src/include/access/xlogbackup.h, the field *name*
> > has one byte extra to store null-termination.
> >
> > But, in the function *do_pg_backup_start*,
> > I think that is a m
On Sun, 23 Jun 2024 22:34:03 -0300
Ranier Vilela wrote:
> Em dom., 23 de jun. de 2024 às 22:14, Ranier Vilela
> escreveu:
>
> > Em dom., 23 de jun. de 2024 às 22:05, Ranier Vilela
> > escreveu:
> >
> >> Em dom., 23 de jun. de 2024 às 21:54, Michael Paquier <
> >> mich...@paquier.xyz> escreveu:
On Mon, Jun 24, 2024 at 7:51 AM Ranier Vilela wrote:
> In src/include/access/xlogbackup.h, the field *name*
> has one byte extra to store null-termination.
>
> But, in the function *do_pg_backup_start*,
> I think that is a mistake in the line (8736):
>
> memcpy(state->name, backupidstr, strlen(bac
Em dom., 23 de jun. de 2024 às 22:14, Ranier Vilela
escreveu:
> Em dom., 23 de jun. de 2024 às 22:05, Ranier Vilela
> escreveu:
>
>> Em dom., 23 de jun. de 2024 às 21:54, Michael Paquier <
>> mich...@paquier.xyz> escreveu:
>>
>>> On Sun, Jun 23, 2024 at 09:34:45PM -0300, Ranier Vilela wrote:
>>>
Em dom., 23 de jun. de 2024 às 22:05, Ranier Vilela
escreveu:
> Em dom., 23 de jun. de 2024 às 21:54, Michael Paquier
> escreveu:
>
>> On Sun, Jun 23, 2024 at 09:34:45PM -0300, Ranier Vilela wrote:
>> > It's not critical code, so I think it's ok to use strlen, even because
>> the
>> > result of
Em dom., 23 de jun. de 2024 às 21:54, Michael Paquier
escreveu:
> On Sun, Jun 23, 2024 at 09:34:45PM -0300, Ranier Vilela wrote:
> > It's not critical code, so I think it's ok to use strlen, even because
> the
> > result of strlen will already be available using modern compilers.
> >
> > So, I th
On Sun, Jun 23, 2024 at 09:34:45PM -0300, Ranier Vilela wrote:
> It's not critical code, so I think it's ok to use strlen, even because the
> result of strlen will already be available using modern compilers.
>
> So, I think it's ok to use memcpy with strlen + 1.
It seems to me that there is a pr
Em dom., 23 de jun. de 2024 às 21:24, Michael Paquier
escreveu:
> On Sun, Jun 23, 2024 at 09:08:47PM -0300, Fabrízio de Royes Mello wrote:
> > Doesn’t “sizeof” solve the problem? It take in account the
> null-termination
> > character.
>
> The size of BackupState->name is fixed with MAXPGPATH + 1
Em dom., 23 de jun. de 2024 às 21:08, Fabrízio de Royes Mello <
fabriziome...@gmail.com> escreveu:
>
> On Sun, 23 Jun 2024 at 20:51 Ranier Vilela wrote:
>
>> Hi.
>>
>> In src/include/access/xlogbackup.h, the field *name*
>> has one byte extra to store null-termination.
>>
>> But, in the function
On Sun, Jun 23, 2024 at 09:08:47PM -0300, Fabrízio de Royes Mello wrote:
> Doesn’t “sizeof” solve the problem? It take in account the null-termination
> character.
The size of BackupState->name is fixed with MAXPGPATH + 1, so it would
be a better practice to use strlcpy() with sizeof(name) anyway?
On Sun, 23 Jun 2024 at 20:51 Ranier Vilela wrote:
> Hi.
>
> In src/include/access/xlogbackup.h, the field *name*
> has one byte extra to store null-termination.
>
> But, in the function *do_pg_backup_start*,
> I think that is a mistake in the line (8736):
>
> memcpy(state->name, backupidstr, strl
Hi.
In src/include/access/xlogbackup.h, the field *name*
has one byte extra to store null-termination.
But, in the function *do_pg_backup_start*,
I think that is a mistake in the line (8736):
memcpy(state->name, backupidstr, strlen(backupidstr));
memcpy with strlen does not copy the whole strin
30 matches
Mail list logo