Re: Global variables in exec()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Global variables in exec()
Date: 2003-05-06 05:28:17
Message-ID: 22783.1052198897@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> -
> - typedef uint32 IpcMemoryKey; /* shared memory key passed to shmget(2) */

IpcMemoryKey is a SysV-specific typedef and has *no* business being
moved out of the sysv-specific port file. Once again I urge you to
consider making a Windows-specific shmem port file, instead of tromping
all over the Unix code in order to support an API that Windows doesn't
like in the first place :-(

> ! /* database name at the end because it might contain commas */
> ! sprintf(pbuf, "%d,%d,%s", port->sock, UsedShmemSegID, port->database_name);

snprintf please. I don't think there's any guaranteed limit on the size
of port->database_name these days.

> + sscanf(optarg, "%d,%d,", &MyProcPort->sock, &UsedShmemSegID);
> + DBName = strdup(strrchr(optarg, ',') + 1);

What happens when the dbname contains a comma?

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-05-06 15:21:37 Re: Global variables in exec()
Previous Message Bruce Momjian 2003-05-06 04:40:00 Global variables in exec()