Re: Global variables in exec()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Global variables in exec()
Дата
Msg-id 22783.1052198897@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Global variables in exec()  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Global variables in exec()  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.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


В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Global variables in exec()
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Global variables in exec()