Database 来自服务的CreateProcessAsUser在访问远程计算机时遇到安全问题
我正在尝试将本地(远程)数据库与服务器上的集中整合数据库同步(使用Sybase数据库)。同步必须在预定的时间进行,我使用的是“CreateProcessByUser”。为了启动同步过程,我使用sybase提供的dbremote.exe 构造的命令行参数为:Database 来自服务的CreateProcessAsUser在访问远程计算机时遇到安全问题,database,security,permissions,createprocessasuser,Database,Security,Permissions,Createprocessasuser,我正在尝试将本地(远程)数据库与服务器上的集中整合数据库同步(使用Sybase数据库)。同步必须在预定的时间进行,我使用的是“CreateProcessByUser”。为了启动同步过程,我使用sybase提供的dbremote.exe 构造的命令行参数为: commandLine=dbremote.exe-l 512K-x-k-c“dsn=HOME**;uid=dba;pwd=***;cs=none;DBKEY=***”-os 10000000-o“c:\data\test\dbremote.l
commandLine=dbremote.exe-l 512K-x-k-c“dsn=HOME**;uid=dba;pwd=***;cs=none;DBKEY=***”-os 10000000-o“c:\data\test\dbremote.log”“c:\data\test” 该过程在远程计算机上执行,当同步发生时,消息应该在远程数据库和整合数据库之间交换 如果从windows命令提示符执行上述命令行,则同步工作将成功。但当CreateProcessAsUser在预定时间触发时,我在日志文件中看到以下错误消息: 日志文件: I.2013-04-11 11:17:11。将消息发送到“BTI”
I.2013-04-11 11:17:11。sopen“\\IPaddress\Databases\Production\messages\consolid\Rem00005.g” 失败1326:无效参数
I.2013-04-11 11:17:11。sopen“\\IPaddress\Databases\Production\messages\consolid\Rem00005.h” 失败1326:无效参数
I.2013-04-11 11:17:13。sopen“\\IPaddress\Databases\Production\messages\consolid\Rem00005.i” 失败1326:无效参数
I.2013-04-11 11:17:13。sopen“\\IPaddress\Databases\Production\messages\consolid\Rem00005.j” 失败1326:无效参数
I.2013-04-11 11:17:13。sopen“\\IPaddress\Databases\Production\messages\consolid\Rem00005.k” 失败1326:无效参数
E.2013-04-11 11:17:13。发送消息时出错
I.2013-04-11 11:17:13。重新发送请求正在排队
I.2013-04-11 11:17:14。执行完成
其中“\\IP address\Databases\Production\messages\consolid”是服务器上复制来自远程计算机的消息的文件夹 我请求你在这方面给予帮助。为什么我可以从命令提示符进行同步,为什么不能从“CreateProcessAsUser”进行同步?为什么进程无法将消息发送到服务器上的上述路径 我已经尝试过的几件事:
非常感谢您的建议。我找到了答案: 我的远程数据库和整合数据库位于属于不同域的两台不同机器上。与我一起登录到远程数据库的用户无法访问整合计算机上的文件夹。 授予用户对合并计算机的访问权限解决了此问题
BOOL startA_Process( HANDLE hToken, _TCHAR *commandLine, PROCESS_INFORMATION *pi, BOOL wait, _TCHAR *errBuf){
STARTUPINFO sStartupInfo;
DWORD dwExitCode;
DWORD dwStatus = 0;
DWORD dwCreationFlags = CREATE_NEW_CONSOLE;
int iResult;
BOOL bInheritHandles = FALSE;
LPCTSTR pszApplicationName = NULL;
LPCTSTR pszCurrentDirectory = NULL;
LPVOID pvEnvironment = NULL;
LPSECURITY_ATTRIBUTES psProcessAttributes = NULL;
LPSECURITY_ATTRIBUTES psThreadAttributes = NULL;
//
// Initilize STARTUPINFO structure
//
ZeroMemory( &sStartupInfo, sizeof( sStartupInfo ) );
sStartupInfo.cb = sizeof( sStartupInfo );
sStartupInfo.lpTitle = _T("AutoSychDBRemote");
sStartupInfo.lpDesktop = _T("winsta0\\default");
//
// Initilize PROCESS_INFORMATION structure
//
ZeroMemory( pi, sizeof( PROCESS_INFORMATION ) );
iResult = ::CreateProcessAsUser(
hToken, // handle to a token representing the logged-on user
pszApplicationName, // name of executable module
(LPTSTR)commandLine, // command line string
psProcessAttributes, // process security attributes
psThreadAttributes, // thread security attributes
bInheritHandles, // whether new process inherits handles
dwCreationFlags, // creation flags
pvEnvironment, // pointer to new environment block
pszCurrentDirectory, // pointer to current directory name
&sStartupInfo, // pointer to STARTUPINFO
pi // pointer to PROCESS_INFORMATION
);