1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00
Through some minor changes, I have been able to compile the libpq
client libraries on the Win32 platform. Since the libpq communications
part has been rewritten, this has become much easier. Enclosed is
a patch that will allow at least Microsoft Visual C++ to compile
libpq into both a static and a dynamic library.  I will take a look
at porting the psql frontend as well, but I figured it was a good
idea to send in these patches first - so no major changes are done
to the files before it gets applied (if it does).

Regards,
  Magnus Hagander
This commit is contained in:
Bruce Momjian
1998-07-03 04:24:16 +00:00
parent d5283ccd3e
commit c765b4b052
12 changed files with 334 additions and 12 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.17 1998/06/15 19:30:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.18 1998/07/03 04:24:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -24,6 +24,9 @@
*
*
*/
#ifdef WIN32
#include "win32.h"
#else
#include <stdio.h>
#include <string.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */
@ -33,6 +36,7 @@
#endif
#include <unistd.h>
#include <pwd.h>
#endif /* WIN32 */
#include "postgres.h"
@ -600,10 +604,18 @@ fe_getauthname(char *PQerrormsg)
#endif
case STARTUP_MSG:
{
#ifdef WIN32
char username[128];
DWORD namesize = sizeof(username) - 1;
if (GetUserName(username,&namesize))
name = username;
#else
struct passwd *pw = getpwuid(geteuid());
if (pw)
name = pw->pw_name;
#endif
}
break;
default: