代码拉取完成,页面将自动刷新
同步操作将从 IvorySQL/IvorySQL 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*-------------------------------------------------------------------------
*
* username.c
* get user name
*
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* src/common/username.c
*
*-------------------------------------------------------------------------
*/
#ifndef FRONTEND
#include "postgres.h"
#else
#include "postgres_fe.h"
#endif
#include <pwd.h>
#include <unistd.h>
#include "common/username.h"
/*
* Returns the current user name in a static buffer
* On error, returns NULL and sets *errstr to point to a palloc'd message
*/
const char *
get_user_name(char **errstr)
{
#ifndef WIN32
struct passwd *pw;
uid_t user_id = geteuid();
*errstr = NULL;
errno = 0; /* clear errno before call */
pw = getpwuid(user_id);
if (!pw)
{
*errstr = psprintf(_("could not look up effective user ID %ld: %s"),
(long) user_id,
errno ? strerror(errno) : _("user does not exist"));
return NULL;
}
return pw->pw_name;
#else
/* Microsoft recommends buffer size of UNLEN+1, where UNLEN = 256 */
/* "static" variable remains after function exit */
static char username[256 + 1];
DWORD len = sizeof(username);
*errstr = NULL;
if (!GetUserName(username, &len))
{
*errstr = psprintf(_("user name lookup failure: error code %lu"),
GetLastError());
return NULL;
}
return username;
#endif
}
/*
* Returns the current user name in a static buffer or exits
*/
const char *
get_user_name_or_exit(const char *progname)
{
const char *user_name;
char *errstr;
user_name = get_user_name(&errstr);
if (!user_name)
{
fprintf(stderr, "%s: %s\n", progname, errstr);
exit(1);
}
return user_name;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。