Home > Archive > Slony1 PostgreSQL Replication > July 2005 > [PATCH] Fix for slonik get_sharepath









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [PATCH] Fix for slonik get_sharepath
Magnus Hagander

2005-07-17, 9:23 am

Hi!

The function get_sharepath() in slonik (used only on win32) is badly
broken as it is now. For one thing, it loops on an unsigned int var with
a condition of ">=0", which is always true. Which results in it happily
overwriting argv[] (and probably other such things!) makeing it
impossible to run a simple command like "slonik foo" (because once it
tries to open the file, argv[1] is now NULL).

Attached patch cleans that up. Still uses the same logic (assuming I
read the original logic correctly). It's a bit simplistic, but I think
it will be enough for most cases.

//Magnus

Dave Page

2005-07-18, 3:23 am

If there are no objections I will apply this patch within th next day or
so.

Regards, Dave.=20

> -----Original Message-----
> From: slony1-general-bounces- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org=20
> [mailto:slony1-general-bounces- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org] On=20
> Behalf Of Magnus Hagander
> Sent: 17 July 2005 15:46
> To: slony1-general- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org
> Subject: [Slony1-general] [PATCH] Fix for slonik get_sharepath
>=20
> Hi!
>=20
> The function get_sharepath() in slonik (used only on win32) is badly
> broken as it is now. For one thing, it loops on an unsigned=20
> int var with
> a condition of ">=3D0", which is always true. Which results in=20
> it happily
> overwriting argv[] (and probably other such things!) makeing it
> impossible to run a simple command like "slonik foo" (because once it
> tries to open the file, argv[1] is now NULL).
>=20
> Attached patch cleans that up. Still uses the same logic (assuming I
> read the original logic correctly). It's a bit simplistic, but I think
> it will be enough for most cases.
>=20
> //Magnus
>=20

Dave Page

2005-07-18, 8:24 pm

Patch applied.

/D=20

> -----Original Message-----
> From: slony1-general-bounces- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org=20
> [mailto:slony1-general-bounces- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org] On=20
> Behalf Of Magnus Hagander
> Sent: 17 July 2005 15:46
> To: slony1-general- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org
> Subject: [Slony1-general] [PATCH] Fix for slonik get_sharepath
>=20
> Hi!
>=20
> The function get_sharepath() in slonik (used only on win32) is badly
> broken as it is now. For one thing, it loops on an unsigned=20
> int var with
> a condition of ">=3D0", which is always true. Which results in=20
> it happily
> overwriting argv[] (and probably other such things!) makeing it
> impossible to run a simple command like "slonik foo" (because once it
> tries to open the file, argv[1] is now NULL).
>=20
> Attached patch cleans that up. Still uses the same logic (assuming I
> read the original logic correctly). It's a bit simplistic, but I think
> it will be enough for most cases.
>=20
> //Magnus
>=20

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com