Index: src/backend/port/sysv_shmem.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/port/sysv_shmem.c,v
retrieving revision 1.33
diff -w -c -r1.33 sysv_shmem.c
*** src/backend/port/sysv_shmem.c	19 Apr 2004 17:42:58 -0000	1.33
--- src/backend/port/sysv_shmem.c	3 May 2004 06:02:47 -0000
***************
*** 250,256 ****
  
  #ifdef EXEC_BACKEND
  	/* If Exec case, just attach and return the pointer */
! 	if (UsedShmemSegAddr != NULL && !makePrivate)
  	{
  		void* origUsedShmemSegAddr = UsedShmemSegAddr;
  
--- 250,256 ----
  
  #ifdef EXEC_BACKEND
  	/* If Exec case, just attach and return the pointer */
! 	if (UsedShmemSegAddr != NULL && !makePrivate && IsUnderPostmaster)
  	{
  		void* origUsedShmemSegAddr = UsedShmemSegAddr;
  
Index: src/backend/postmaster/pgstat.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/postmaster/pgstat.c,v
retrieving revision 1.67
diff -w -c -r1.67 pgstat.c
*** src/backend/postmaster/pgstat.c	19 Apr 2004 17:42:58 -0000	1.67
--- src/backend/postmaster/pgstat.c	3 May 2004 06:02:48 -0000
***************
*** 485,495 ****
  	snprintf(pgstatBuf[bufc++],MAXPGPATH,"%d",MaxBackends);
  
  	/* + the pstat file names, and postgres pathname */
! 	/* FIXME: [fork/exec] whitespaces in directories? */
! 	snprintf(pgstatBuf[bufc++],MAXPGPATH,"%s",pgStat_tmpfname);
! 	snprintf(pgstatBuf[bufc++],MAXPGPATH,"%s",pgStat_fname);
! 	snprintf(pgstatBuf[bufc++],MAXPGPATH,"%s",pg_pathname);
! 	snprintf(pgstatBuf[bufc++],MAXPGPATH,"%s",DataDir);
  
  	/* Add to the arg list */
  	Assert(bufc <= lengthof(pgstatBuf));
--- 485,494 ----
  	snprintf(pgstatBuf[bufc++],MAXPGPATH,"%d",MaxBackends);
  
  	/* + the pstat file names, and postgres pathname */
! 	snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",pgStat_tmpfname);
! 	snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",pgStat_fname);
! 	snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",pg_pathname);
! 	snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",DataDir);
  
  	/* Add to the arg list */
  	Assert(bufc <= lengthof(pgstatBuf));
Index: src/backend/postmaster/postmaster.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/postmaster/postmaster.c,v
retrieving revision 1.381
diff -w -c -r1.381 postmaster.c
*** src/backend/postmaster/postmaster.c	19 Apr 2004 17:42:58 -0000	1.381
--- src/backend/postmaster/postmaster.c	3 May 2004 06:02:51 -0000
***************
*** 2741,2748 ****
  
  	/* Format up context to pass to exec'd process */
  	snprintf(buf[bufc++],MAXPGPATH,"%lu",tmpBackendFileNum);
! 	/* FIXME: [fork/exec] whitespaces in directories? */
! 	snprintf(buf[bufc++],MAXPGPATH,"%s",DataDir);
  
  	/* Add to the arg list */
  	Assert(bufc <= lengthof(buf));
--- 2741,2747 ----
  
  	/* Format up context to pass to exec'd process */
  	snprintf(buf[bufc++],MAXPGPATH,"%lu",tmpBackendFileNum);
! 	snprintf(buf[bufc++],MAXPGPATH,"\"%s\"",DataDir);
  
  	/* Add to the arg list */
  	Assert(bufc <= lengthof(buf));
***************
*** 3039,3044 ****
--- 3038,3044 ----
  #endif
  #else
  	char		idbuf[32];
+ 	char		ddirbuf[MAXPGPATH];
  #endif
  
  	fflush(stdout);
***************
*** 3097,3104 ****
  
  #ifdef EXEC_BACKEND
  		/* pass data dir before end of secure switches (-p) */
  		av[ac++] = "-D";
! 		av[ac++] = DataDir;
  
  		/* and the backend identifier + dbname */
  		snprintf(idbuf, sizeof(idbuf), "-p%lu,template1", tmpBackendFileNum);
--- 3097,3105 ----
  
  #ifdef EXEC_BACKEND
  		/* pass data dir before end of secure switches (-p) */
+ 		snprintf(ddirbuf, MAXPGPATH, "\"%s\"", DataDir);
  		av[ac++] = "-D";
! 		av[ac++] = ddirbuf;
  
  		/* and the backend identifier + dbname */
  		snprintf(idbuf, sizeof(idbuf), "-p%lu,template1", tmpBackendFileNum);
***************
*** 3490,3496 ****
  	HANDLE waiterThread;
  
  	/* Format the cmd line */
! 	snprintf(cmdLine,sizeof(cmdLine),"%s",path);
  	i = 0;
  	while (argv[++i] != NULL)
  	{
--- 3491,3497 ----
  	HANDLE waiterThread;
  
  	/* Format the cmd line */
! 	snprintf(cmdLine,sizeof(cmdLine),"\"%s\"",path);
  	i = 0;
  	while (argv[++i] != NULL)
  	{
