Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion XEngine_Module/XEngine_AIApi/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
// 添加要在此处预编译的标头
#define _CRT_SECURE_NO_WARNINGS
#include "framework.h"
#include <io.h>
#endif
#endif //PCH_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <io.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <json/json.h>
#include <thread>
#include <memory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,17 @@ bool CVerification_XAuthKey::Verification_XAuthKey_FileWrite(VERIFICATION_XAUTHK
{
return false;
}
//打开文件
FILE* pSt_File = _xtfopen(lpszKeyFile, _X("wb"));
//打开文件(限制为仅当前用户可读写)
#ifdef _MSC_BUILD
int nFile = _xtopen(lpszKeyFile, _O_WRONLY | _O_CREAT | _O_TRUNC | _O_BINARY, _S_IREAD | _S_IWRITE);
FILE* pSt_File = _fdopen(nFile, "wb");
#else
int nFile = _xtopen(lpszKeyFile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
FILE* pSt_File = fdopen(nFile, "wb");
#endif
if (NULL == pSt_File)
{
_close(nFile);
Verification_IsErrorOccur = true;
Verification_dwErrorCode = ERROR_XENGINE_MODULE_VERIFICATION_XAUTH_OPENFILE;
return false;
Expand Down
5 changes: 3 additions & 2 deletions XEngine_Module/XEngine_Verification/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@
#define PCH_H
#ifdef _MSC_BUILD
#define _CRT_SECURE_NO_WARNINGS
#include <io.h>
// 添加要在此处预编译的标头
#include "framework.h"
#include <io.h>
#else
#include <unistd.h>
#include <fcntl.h>
#endif
#endif //PCH_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <json/json.h>
#include <shared_mutex>
#include <thread>
Expand Down