Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 143904 Details for
Bug 208034
dev-db/firebird: < 2.0.3.12981.0-r5 "username" buffer overflow (CVE-2008-0387,CVE-2008-0467)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
firebird-2.0.3.12981.0 CVE-2008-0467 patch
firebird-2.0.3.12981.0-CVE-2008-0467.patch (text/plain), 21.23 KB, created by
William L. Thomson Jr. (RETIRED)
on 2008-02-18 21:50:18 UTC
(
hide
)
Description:
firebird-2.0.3.12981.0 CVE-2008-0467 patch
Filename:
MIME Type:
Creator:
William L. Thomson Jr. (RETIRED)
Created:
2008-02-18 21:50:18 UTC
Size:
21.23 KB
patch
obsolete
>diff -Naur Firebird-2.0.3.12981-0_orig/src/jrd/constants.h Firebird-2.0.3.12981-0/src/jrd/constants.h >--- Firebird-2.0.3.12981-0_orig/src/jrd/constants.h 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/jrd/constants.h 2008-02-17 19:31:25.000000000 -0500 >@@ -56,7 +56,7 @@ > > /* Misc constant values */ > >-const int USERNAME_LENGTH = 31; /* Characters */ >+const unsigned int USERNAME_LENGTH = 31; /* Characters */ > > const size_t MAX_SQL_IDENTIFIER_SIZE = 32; > const size_t MAX_SQL_IDENTIFIER_LEN = MAX_SQL_IDENTIFIER_SIZE - 1; >diff -Naur Firebird-2.0.3.12981-0_orig/src/jrd/isc.cpp Firebird-2.0.3.12981-0/src/jrd/isc.cpp >--- Firebird-2.0.3.12981-0_orig/src/jrd/isc.cpp 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/jrd/isc.cpp 2008-02-17 19:31:04.000000000 -0500 >@@ -87,14 +87,13 @@ > > #include <windows.h> > #include <aclapi.h> >+#include <lmcons.h> > > static USHORT os_type; > static SECURITY_ATTRIBUTES security_attr; > > //static TEXT interbase_directory[MAXPATHLEN]; > >-static bool check_user_privilege(); >- > #endif // WIN_NT > > static TEXT user_name[256]; >@@ -393,14 +392,29 @@ > } > #endif > >+const TEXT* ISC_get_host(Firebird::string& host) >+{ >+/************************************** >+ * >+ * I S C _ g e t _ h o s t >+ * >+ ************************************** >+ * >+ * Functional description >+ * Get host name in non-plain buffer. >+ * >+ **************************************/ >+ TEXT buffer[BUFFER_SMALL]; >+ ISC_get_host(buffer, sizeof(buffer)); >+ host = buffer; >+ return host.c_str(); >+} >+ > #ifdef UNIX >-int ISC_get_user(TEXT* name, >- int* id, >- int* group, >- TEXT* project, >- TEXT* organization, >- int* node, >- const TEXT* user_string) >+bool ISC_get_user(Firebird::string* name, >+ int* id, >+ int* group, >+ const TEXT* user_string) > { > /************************************** > * >@@ -448,7 +462,7 @@ > } > > if (name) >- strcpy(name, p); >+ *name = p; > > if (id) > *id = euid; >@@ -456,15 +470,6 @@ > if (group) > *group = egid; > >- if (project) >- *project = 0; >- >- if (organization) >- *organization = 0; >- >- if (node) >- *node = 0; >- > return (euid == 0); > } > #endif >@@ -573,13 +578,10 @@ > #endif > > #ifdef WIN_NT >-int ISC_get_user(TEXT* name, >- int* id, >- int* group, >- TEXT* project, >- TEXT* organization, >- int* node, >- const TEXT* user_string) >+bool ISC_get_user(Firebird::string* name, >+ int* id, >+ int* group, >+ const TEXT* user_string) > { > /************************************** > * >@@ -597,162 +599,25 @@ > if (group) > *group = -1; > >- if (project) >- *project = 0; >- >- if (organization) >- *organization = 0; >- >- if (node) >- *node = 0; >- > if (name) > { >- name[0] = 0; >- DWORD name_len = 128; >- if (GetUserName(name, &name_len)) >- { >- name[name_len] = 0; >- >- /* NT user name is case insensitive */ >- >- for (DWORD i = 0; i < name_len; i++) >- { >- name[i] = UPPER7(name[i]); >- } >- >-/* This check is not internationalized, the security model needs to be >- * reengineered, especially on SUPERSERVER where none of these local >- * user (in process) assumptions are valid. >- if (!strcmp(name, "ADMINISTRATOR")) >- { >- if (id) >- *id = 0; >- >- if (group) >- *group = 0; >- } >- */ >- } >- } >- >- return check_user_privilege(); >-} >- >- >-//____________________________________________________________ >-// >-// Check to see if the user belongs to the administrator group. >-// >-// This routine was adapted from code in routine RunningAsAdminstrator >-// in \mstools\samples\regmpad\regdb.c. >-// >-static bool check_user_privilege() >-{ >- HANDLE tkhandle; >- SID_IDENTIFIER_AUTHORITY system_sid_authority = {SECURITY_NT_AUTHORITY}; >- >- // First we must open a handle to the access token for this thread. >- >- if (!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, FALSE, &tkhandle)) >- { >- if (GetLastError() == ERROR_NO_TOKEN) >+ DWORD name_len = UNLEN; >+ TEXT* nm = name->getBuffer(name_len + 1); >+ if (GetUserName(nm, &name_len)) > { >- // If the thread does not have an access token, we'll examine the >- // access token associated with the process. >+ nm[name_len] = 0; > >- if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &tkhandle)) >- { >- CloseHandle(tkhandle); >- return false; >- } >+ // NT user name is case insensitive >+ CharUpperBuff(nm, name_len); >+ name->recalculate_length(); > } > else > { >- return false; >+ *name = ""; > } > } > >- TOKEN_GROUPS* ptg = NULL; >- DWORD token_len = 0; >- >- while (true) >- { >- /* Then we must query the size of the group information associated with >- the token. This is guarenteed to fail the first time through >- because there is no buffer. */ >- >- if (GetTokenInformation(tkhandle, >- TokenGroups, >- ptg, >- token_len, >- &token_len)) >- { >- break; >- } >- >- /* If there had been a buffer, it's either too small or something >- else is wrong. Either way, we can dispose of it. */ >- >- if (ptg) >- { >- gds__free(ptg); >- } >- >- /* Here we verify that GetTokenInformation failed for lack of a large >- enough buffer. */ >- >- if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) >- { >- CloseHandle(tkhandle); >- return false; >- } >- >- // Allocate a buffer for the group information. >- ptg = (TOKEN_GROUPS *) gds__alloc((SLONG) token_len); >- >- if (!ptg) >- { >- CloseHandle(tkhandle); >- return false; /* NOMEM: */ >- } >- // FREE: earlier in this loop, and at procedure return >- } >- >- // Create a System Identifier for the Admin group. >- >- PSID admin_sid; >- >- if (!AllocateAndInitializeSid(&system_sid_authority, 2, >- SECURITY_BUILTIN_DOMAIN_RID, >- DOMAIN_ALIAS_RID_ADMINS, >- 0, 0, 0, 0, 0, 0, &admin_sid)) >- { >- gds__free(ptg); >- CloseHandle(tkhandle); >- return false; >- } >- >- // Finally we'll iterate through the list of groups for this access >- // token looking for a match against the SID we created above. >- >- bool admin_priv = false; >- >- for (DWORD i = 0; i < ptg->GroupCount; i++) >- { >- if (EqualSid(ptg->Groups[i].Sid, admin_sid)) >- { >- admin_priv = true; >- break; >- } >- } >- >- // Deallocate the SID we created. >- >- FreeSid(admin_sid); >- gds__free(ptg); >- CloseHandle(tkhandle); >- return admin_priv; >+ return false; > } > #endif > >diff -Naur Firebird-2.0.3.12981-0_orig/src/jrd/isc_proto.h Firebird-2.0.3.12981-0/src/jrd/isc_proto.h >--- Firebird-2.0.3.12981-0_orig/src/jrd/isc_proto.h 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/jrd/isc_proto.h 2008-02-17 19:32:26.000000000 -0500 >@@ -25,6 +25,7 @@ > #define JRD_ISC_PROTO_H > > #include "../jrd/isc.h" >+#include "../common/classes/fb_string.h" > > void ISC_ast_enter(void); > void ISC_ast_exit(void); >@@ -33,8 +34,8 @@ > //void ISC_get_config(TEXT *, struct ipccfg *); > //int ISC_set_config(TEXT *, struct ipccfg *); > TEXT* ISC_get_host(TEXT *, USHORT); >-int ISC_get_user(TEXT*, int*, int*, TEXT*, >- TEXT*, int*, const TEXT*); >+const TEXT* ISC_get_host(Firebird::string&); >+bool ISC_get_user(Firebird::string*, int*, int*, const TEXT*); > SLONG ISC_get_user_group_id(const TEXT*); > void ISC_set_user(const TEXT*); > SLONG ISC_get_prefix(const TEXT*); >diff -Naur Firebird-2.0.3.12981-0_orig/src/jrd/jrd.cpp Firebird-2.0.3.12981-0/src/jrd/jrd.cpp >--- Firebird-2.0.3.12981-0_orig/src/jrd/jrd.cpp 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/jrd/jrd.cpp 2008-02-17 19:31:56.000000000 -0500 >@@ -6699,12 +6699,9 @@ > **/ > static void getUserInfo(UserId& user, const DatabaseOptions& options) > { >- TEXT name[129] = ""; >- TEXT project[33] = ""; >- TEXT organization[33] = ""; >- >- int node_id = 0; > int id = -1, group = -1; // CVC: This var contained trash >+ int node_id = 0; >+ Firebird::string name; > > #ifdef BOOT_BUILD > bool wheel = true; >@@ -6712,12 +6709,9 @@ > bool wheel = false; > if (options.dpb_user_name.isEmpty()) > { >- wheel = ISC_get_user(name, >+ wheel = ISC_get_user(&name, > &id, > &group, >- project, >- organization, >- &node_id, > options.dpb_sys_user_name.nullStr()); > } > >@@ -6738,18 +6732,18 @@ > { > if (options.dpb_user_name.hasData()) > { >- options.dpb_user_name.copyTo(name, sizeof name); >+ name = options.dpb_user_name; > } > else > { >- strcpy(name, "<Unknown>"); >+ name = "<Unknown>"; > } > } > > // if the name from the user database is defined as SYSDBA, > // we define that user id as having system privileges > >- if (!strcmp(name, SYSDBA_USER_NAME)) >+ if (name == SYSDBA_USER_NAME) > { > wheel = true; > } >@@ -6761,12 +6755,12 @@ > > if (wheel) > { >- strcpy(name, SYSDBA_USER_NAME); >+ name = SYSDBA_USER_NAME; > } > > user.usr_user_name = name; >- user.usr_project_name = project; >- user.usr_org_name = organization; >+ user.usr_project_name = ""; >+ user.usr_org_name = ""; > user.usr_sql_role_name = options.dpb_role_name; > user.usr_user_id = id; > user.usr_group_id = group; >diff -Naur Firebird-2.0.3.12981-0_orig/src/jrd/jrd_pwd.h Firebird-2.0.3.12981-0/src/jrd/jrd_pwd.h >--- Firebird-2.0.3.12981-0_orig/src/jrd/jrd_pwd.h 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/jrd/jrd_pwd.h 2008-02-17 19:34:10.000000000 -0500 >@@ -66,11 +66,11 @@ > > static void initialize(); > static void shutdown(); >- static void verifyUser(TEXT*, const TEXT*, const TEXT*, const TEXT*, >+ static void verifyUser(Firebird::string&, const TEXT*, const TEXT*, const TEXT*, > int*, int*, int*, const Firebird::string&); > > static void hash(Firebird::string& h, >- const TEXT* userName, >+ const Firebird::string& userName, > const TEXT* passwd) > { > Firebird::string salt; >@@ -79,7 +79,7 @@ > } > > static void hash(Firebird::string& h, >- const TEXT* userName, >+ const Firebird::string& userName, > const TEXT* passwd, > const Firebird::string& oldHash) > { >@@ -110,7 +110,7 @@ > > void fini(); > void init(); >- bool lookup_user(TEXT*, int*, int*, TEXT*); >+ bool lookup_user(const TEXT*, int*, int*, TEXT*); > bool prepare(); > > static SecurityDatabase instance; >diff -Naur Firebird-2.0.3.12981-0_orig/src/jrd/pwd.cpp Firebird-2.0.3.12981-0/src/jrd/pwd.cpp >--- Firebird-2.0.3.12981-0_orig/src/jrd/pwd.cpp 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/jrd/pwd.cpp 2008-02-17 19:33:59.000000000 -0500 >@@ -263,7 +263,7 @@ > counter += (is_cached) ? 1 : 0; > } > >-bool SecurityDatabase::lookup_user(TEXT * user_name, int *uid, int *gid, TEXT * pwd) >+bool SecurityDatabase::lookup_user(const TEXT* user_name, int* uid, int* gid, TEXT* pwd) > { > bool found = false; // user found flag > TEXT uname[129]; // user name buffer >@@ -433,7 +433,7 @@ > instance.fini(); > } > >-void SecurityDatabase::verifyUser(TEXT* name, >+void SecurityDatabase::verifyUser(Firebird::string& name, > const TEXT* user_name, > const TEXT* password, > const TEXT* password_enc, >@@ -444,12 +444,11 @@ > { > if (user_name) > { >- TEXT* p = name; >- for (const TEXT* q = user_name; *q; ++q, ++p) >+ name = user_name; >+ for (unsigned int n = 0; n < name.length(); ++n) > { >- *p = UPPER7(*q); >+ name[n] = UPPER7(name[n]); > } >- *p = 0; > } > > #ifndef EMBEDDED >@@ -459,7 +458,7 @@ > // that means the current context must be saved and restored. > > TEXT pw1[MAX_PASSWORD_LENGTH + 1]; >- const bool found = instance.lookup_user(name, uid, gid, pw1); >+ const bool found = instance.lookup_user(name.c_str(), uid, gid, pw1); > pw1[MAX_PASSWORD_LENGTH] = 0; > Firebird::string storedHash(pw1, MAX_PASSWORD_LENGTH); > storedHash.rtrim(); >diff -Naur Firebird-2.0.3.12981-0_orig/src/jrd/svc.cpp Firebird-2.0.3.12981-0/src/jrd/svc.cpp >--- Firebird-2.0.3.12981-0_orig/src/jrd/svc.cpp 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/jrd/svc.cpp 2008-02-17 19:31:37.000000000 -0500 >@@ -516,7 +516,7 @@ > } > else > { >- TEXT name[129]; // unused after retrieved >+ Firebird::string name; // unused after retrieved > int id, group, node_id; > > Firebird::string remote = options.spb_network_protocol + >diff -Naur Firebird-2.0.3.12981-0_orig/src/remote/inet.cpp Firebird-2.0.3.12981-0/src/remote/inet.cpp >--- Firebird-2.0.3.12981-0_orig/src/remote/inet.cpp 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/remote/inet.cpp 2008-02-17 19:33:09.000000000 -0500 >@@ -94,7 +94,7 @@ > #endif > #endif // !(defined VMS || defined WIN_NT) > >-#ifdef DARWIN >+#if (defined DARWIN || defined HPUX) > extern "C" int innetgr(const char*, const char*, const char*, const char*); > #endif > >@@ -119,7 +119,7 @@ > #include "../common/utils_proto.h" > #include "../common/classes/ClumpletWriter.h" > >-#if (defined hpux || defined SCO_UNIX) >+#if (defined HPUX || defined SCO_UNIX) > extern int h_errno; > #endif > >@@ -461,20 +461,16 @@ > > /* Pick up some user identification information */ > Firebird::ClumpletWriter user_id(Firebird::ClumpletReader::UnTagged, MAX_DPB_SIZE); >- char buffer[BUFFER_SMALL]; >- >+ Firebird::string buffer; > int eff_gid; > int eff_uid; >- ISC_get_user(buffer, &eff_uid, &eff_gid, 0, 0, 0, user_string); >- user_id.insertString(CNCT_user, buffer, strlen(buffer)); > >- ISC_get_host(buffer, sizeof(buffer)); >- for (char* p = buffer; *p; p++) { >- if (*p >= 'A' && *p <= 'Z') { >- *p = *p - 'A' + 'a'; >- } >- } >- user_id.insertString(CNCT_host, buffer, strlen(buffer)); >+ ISC_get_user(&buffer, &eff_uid, &eff_gid, user_string); >+ user_id.insertString(CNCT_user, buffer); >+ >+ ISC_get_host(buffer); >+ buffer.lower(); >+ user_id.insertString(CNCT_host, buffer); > > if ((eff_uid == -1) || uv_flag) { > user_id.insertTag(CNCT_user_verification); >diff -Naur Firebird-2.0.3.12981-0_orig/src/remote/inet_server.cpp Firebird-2.0.3.12981-0/src/remote/inet_server.cpp >--- Firebird-2.0.3.12981-0_orig/src/remote/inet_server.cpp 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/remote/inet_server.cpp 2008-02-17 19:30:41.000000000 -0500 >@@ -96,6 +96,7 @@ > #include "../jrd/sch_proto.h" > #include "../jrd/thread_proto.h" > #include "../common/utils_proto.h" >+#include "../common/classes/fb_string.h" > > #ifdef UNIX > #ifdef NETBSD >@@ -105,16 +106,21 @@ > #endif > #endif > >+#ifdef HAVE_SYS_RESOURCE_H >+#include <sys/resource.h> >+#endif >+ > #if (defined SUPERSERVER && defined UNIX && defined SERVER_SHUTDOWN) > #include "../common/classes/semaphore.h" > #define SHUTDOWN_THREAD > #endif > >-#ifdef SUPERSERVER >-#ifndef WIN_NT >+#ifdef UNIX > const char* TEMP_DIR = "/tmp"; > #define CHANGE_DIR chdir > #endif >+ >+#ifdef SUPERSERVER > const char* INTERBASE_USER_NAME = "interbase"; > const char* INTERBASE_USER_SHORT = "interbas"; > const char* FIREBIRD_USER_NAME = "firebird"; >@@ -280,9 +286,12 @@ > set_signal(SIGUSR2, signal_handler); > #endif > >-#if defined(UNIX) && defined(DEV_BUILD) >+#if defined(UNIX) && defined(HAVE_SETRLIMIT) && defined(HAVE_GETRLIMIT) >+#if !(defined(DEV_BUILD)) >+ if (Config::getBugcheckAbort()) >+#endif > { >- // try to force core files creation for DEV_BUILD >+ // try to force core files creation > struct rlimit core; > if (getrlimit(RLIMIT_CORE, &core) == 0) > { >@@ -296,6 +305,14 @@ > { > gds__log("getrlimit() failed, errno=%d", errno); > } >+ >+ // we need some writable directory for core file >+ // on any unix /tmp seems to be the best place >+ if (CHANGE_DIR(TEMP_DIR)) { >+ /* error on changing the directory */ >+ gds__log("Could not change directory to %s due to errno %d", >+ TEMP_DIR, errno); >+ } > } > #endif > >@@ -328,14 +345,14 @@ > // Remove restriction on username, for DEV builds > // restrict only for production builds. MOD 21-July-2002 > #ifndef DEV_BUILD >- TEXT user_name[256]; /* holds the user name */ >+ Firebird::string user_name; /* holds the user name */ > /* check user id */ >- ISC_get_user(user_name, NULL, NULL, NULL, NULL, NULL, NULL); >+ ISC_get_user(&user_name, NULL, NULL, NULL); > >- if (strcmp(user_name, "root") && >- strcmp(user_name, FIREBIRD_USER_NAME) && >- strcmp(user_name, INTERBASE_USER_NAME) && >- strcmp(user_name, INTERBASE_USER_SHORT)) >+ if (user_name != "root" && >+ user_name != FIREBIRD_USER_NAME && >+ user_name != INTERBASE_USER_NAME && >+ user_name != INTERBASE_USER_SHORT) > { > /* invalid user -- bail out */ > fprintf(stderr, >@@ -546,7 +563,7 @@ > #endif > > #ifdef SHUTDOWN_THREAD >-static Firebird::Semaphore shutSem; >+static Firebird::SignalSafeSemaphore shutSem; > static bool alreadyClosing = false; > > static THREAD_ENTRY_DECLARE shutdown_thread(THREAD_ENTRY_PARAM arg) >diff -Naur Firebird-2.0.3.12981-0_orig/src/remote/os/win32/wnet.cpp Firebird-2.0.3.12981-0/src/remote/os/win32/wnet.cpp >--- Firebird-2.0.3.12981-0_orig/src/remote/os/win32/wnet.cpp 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/remote/os/win32/wnet.cpp 2008-02-17 19:33:41.000000000 -0500 >@@ -135,25 +135,17 @@ > PACKET* packet = &rdb->rdb_packet; > > /* Pick up some user identification information */ >- TEXT buffer[128]; >+ Firebird::string buffer; > TEXT *p; > Firebird::ClumpletWriter user_id(Firebird::ClumpletReader::UnTagged, MAX_DPB_SIZE); > >- ISC_get_user(buffer, 0, 0, 0, 0, 0, 0); >- for (p = buffer; *p; p++) { >- if (*p >= 'A' && *p <= 'Z') { >- *p = *p - 'A' + 'a'; >- } >- } >- user_id.insertString(CNCT_user, buffer, strlen(buffer)); >- >- ISC_get_host(buffer, sizeof(buffer)); >- for (p = buffer; *p; p++) { >- if (*p >= 'A' && *p <= 'Z') { >- *p = *p - 'A' + 'a'; >- } >- } >- user_id.insertString(CNCT_host, buffer, strlen(buffer)); >+ ISC_get_user(&buffer, 0, 0, 0); >+ buffer.lower(); >+ user_id.insertString(CNCT_user, buffer); >+ >+ ISC_get_host(buffer); >+ buffer.lower(); >+ user_id.insertString(CNCT_host, buffer); > > if (uv_flag) { > user_id.insertTag(CNCT_user_verification); >diff -Naur Firebird-2.0.3.12981-0_orig/src/remote/xnet.cpp Firebird-2.0.3.12981-0/src/remote/xnet.cpp >--- Firebird-2.0.3.12981-0_orig/src/remote/xnet.cpp 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/remote/xnet.cpp 2008-02-17 19:34:28.000000000 -0500 >@@ -214,25 +214,16 @@ > > // Pick up some user identification information > >- TEXT buffer[BUFFER_TINY]; >- TEXT *p; >+ Firebird::string buffer; > Firebird::ClumpletWriter user_id(Firebird::ClumpletReader::UnTagged, MAX_DPB_SIZE); > >- ISC_get_user(buffer, 0, 0, 0, 0, 0, 0); >- for (p = buffer; *p; p++) { >- if (*p >= 'A' && *p <= 'Z') { >- *p = *p - 'A' + 'a'; >- } >- } >- user_id.insertString(CNCT_user, buffer, strlen(buffer)); >- >- ISC_get_host(buffer, sizeof(buffer)); >- for (p = buffer; *p; p++) { >- if (*p >= 'A' && *p <= 'Z') { >- *p = *p - 'A' + 'a'; >- } >- } >- user_id.insertString(CNCT_host, buffer, strlen(buffer)); >+ ISC_get_user(&buffer, 0, 0, 0); >+ buffer.lower(); >+ user_id.insertString(CNCT_user, buffer); >+ >+ ISC_get_host(buffer); >+ buffer.lower(); >+ user_id.insertString(CNCT_host, buffer); > > if (uv_flag) { > user_id.insertTag(CNCT_user_verification); >@@ -760,11 +751,11 @@ > > // send events channel > xps->xps_channels[XPS_CHANNEL_C2S_EVENTS].xch_client_ptr = >- ((UCHAR *) xpm->xpm_address + sizeof(struct xps)); >+ ((UCHAR *) xcc->xcc_mapped_addr + sizeof(struct xps)); > > // receive events channel > xps->xps_channels[XPS_CHANNEL_S2C_EVENTS].xch_client_ptr = >- ((UCHAR *) xpm->xpm_address + sizeof(struct xps) + (XNET_EVENT_SPACE)); >+ ((UCHAR *) xcc->xcc_mapped_addr + sizeof(struct xps) + (XNET_EVENT_SPACE)); > > xcc->xcc_send_channel = &xps->xps_channels[XPS_CHANNEL_C2S_EVENTS]; > xcc->xcc_recv_channel = &xps->xps_channels[XPS_CHANNEL_S2C_EVENTS]; >@@ -894,11 +885,11 @@ > > // send events channel > xps->xps_channels[XPS_CHANNEL_S2C_EVENTS].xch_client_ptr = >- ((UCHAR *) xpm->xpm_address + sizeof(struct xps) + (XNET_EVENT_SPACE)); >+ ((UCHAR *) xcc->xcc_mapped_addr + sizeof(struct xps) + (XNET_EVENT_SPACE)); > > // receive events channel > xps->xps_channels[XPS_CHANNEL_C2S_EVENTS].xch_client_ptr = >- ((UCHAR *) xpm->xpm_address + sizeof(struct xps)); >+ ((UCHAR *) xcc->xcc_mapped_addr + sizeof(struct xps)); > > xcc->xcc_send_channel = &xps->xps_channels[XPS_CHANNEL_S2C_EVENTS]; > xcc->xcc_recv_channel = &xps->xps_channels[XPS_CHANNEL_C2S_EVENTS]; >diff -Naur Firebird-2.0.3.12981-0_orig/src/utilities/guard/guard.cpp Firebird-2.0.3.12981-0/src/utilities/guard/guard.cpp >--- Firebird-2.0.3.12981-0_orig/src/utilities/guard/guard.cpp 2007-11-05 21:07:50.000000000 -0500 >+++ Firebird-2.0.3.12981-0/src/utilities/guard/guard.cpp 2008-02-17 19:32:51.000000000 -0500 >@@ -15,7 +15,7 @@ > * > * All Rights Reserved. > * Contributor(s): ______________________________________. >- * $Id: guard.cpp,v 1.8.12.3 2006/04/18 08:56:34 alexpeshkoff Exp $ >+ * $Id: guard.cpp,v 1.8.12.4 2007/11/22 12:30:43 alexpeshkoff Exp $ > */ > /* contains the main() and not shared routines for ibguard */ > >@@ -45,6 +45,7 @@ > #include "../jrd/gds_proto.h" > #include "../jrd/file_params.h" > #include "../utilities/guard/util_proto.h" >+#include "../common/classes/fb_string.h" > > const USHORT FOREVER = 1; > const USHORT ONETIME = 2; >@@ -107,12 +108,13 @@ > } /* while */ > > /* check user id */ >- TEXT user_name[256]; /* holds the user name */ >- ISC_get_user(user_name, NULL, NULL, NULL, NULL, NULL, NULL); >+ Firebird::string user_name; /* holds the user name */ >+ ISC_get_user(&user_name, NULL, NULL, NULL); > >- if (strcmp(user_name, INTERBASE_USER) && strcmp(user_name, "root") >- && strcmp(user_name, FIREBIRD_USER) >- && strcmp(user_name, INTERBASE_USER_SHORT)) >+ if (user_name != INTERBASE_USER && >+ user_name != "root" && >+ user_name != FIREBIRD_USER && >+ user_name != INTERBASE_USER_SHORT) > { > /* invalid user bail out */ > fprintf(stderr,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 208034
: 143904