MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / attachRemoteServiceManager

Function attachRemoteServiceManager

src/common/call_service.cpp:156–201  ·  view source on GitHub ↗

attachRemoteServiceManager @brief Opens connection with service manager on server using protocol, login username/password. @param status @param username @param password @param protocol @param server **/

Source from the content-addressed store, hash-verified

154
155 **/
156isc_svc_handle attachRemoteServiceManager(ISC_STATUS* status,
157 const TEXT* username,
158 const TEXT* password,
159 bool trusted,
160 int protocol,
161 const TEXT* server)
162{
163 char service[SERVICE_SIZE];
164
165 if (! serverSizeValidate(status, server))
166 {
167 return 0;
168 }
169
170 switch (protocol)
171 {
172 case sec_protocol_tcpip:
173 if (! isValidServer(status, server))
174 {
175 return 0;
176 }
177 strncpy(service, server, SERVER_PART);
178 strcat(service, ":");
179 break;
180
181 case sec_protocol_netbeui:
182 if (! isValidServer(status, server))
183 {
184 return 0;
185 }
186 strcpy(service, "\\\\");
187 strncat(service, server, SERVER_PART);
188 strcat(service, "\\");
189 break;
190
191 case sec_protocol_local:
192 service[0] = 0;
193 break;
194
195 default:
196 isValidServer(status, 0); // let it to set the error status
197 return 0;
198 }
199
200 return attachRemoteServiceManager(status, username, password, trusted, service, true);
201}
202
203
204/**

Callers 2

gsecFunction · 0.85
executeSecurityCommandFunction · 0.85

Calls 5

serverSizeValidateFunction · 0.85
isValidServerFunction · 0.85
stuffSpbByteFunction · 0.85
stuffSpbFunction · 0.85
init_statusFunction · 0.85

Tested by

no test coverage detected