Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
bbb3705e
Commit
bbb3705e
authored
Mar 22, 2013
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3535. [bug] Minor win32 cleanups. [RT #32962]
parent
80f1365a
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
29 additions
and
34 deletions
+29
-34
CHANGES
CHANGES
+2
-0
lib/isc/win32/dir.c
lib/isc/win32/dir.c
+2
-1
lib/isc/win32/entropy.c
lib/isc/win32/entropy.c
+1
-2
lib/isc/win32/file.c
lib/isc/win32/file.c
+3
-3
lib/isc/win32/fsaccess.c
lib/isc/win32/fsaccess.c
+3
-4
lib/isc/win32/net.c
lib/isc/win32/net.c
+0
-1
lib/isc/win32/ntgroups.c
lib/isc/win32/ntgroups.c
+0
-2
lib/isc/win32/os.c
lib/isc/win32/os.c
+1
-1
lib/isc/win32/socket.c
lib/isc/win32/socket.c
+7
-13
lib/isc/win32/win32os.c
lib/isc/win32/win32os.c
+2
-2
lib/lwres/win32/lwconfig.c
lib/lwres/win32/lwconfig.c
+8
-5
No files found.
CHANGES
View file @
bbb3705e
3535. [bug] Minor win32 cleanups. [RT #32962]
3534. [bug] Extra text after an embedded NULL was ignored when
parsing zone files. [RT #32699]
...
...
lib/isc/win32/dir.c
View file @
bbb3705e
...
...
@@ -267,7 +267,8 @@ isc_dir_createunique(char *templet) {
do
{
i
=
mkdir
(
templet
);
i
=
chmod
(
templet
,
0700
);
if
(
i
==
0
)
i
=
chmod
(
templet
,
0700
);
if
(
i
==
0
||
errno
!=
EEXIST
)
break
;
...
...
lib/isc/win32/entropy.c
View file @
bbb3705e
...
...
@@ -242,7 +242,6 @@ isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) {
isc_result_t
ret
;
isc_entropysource_t
*
source
;
HCRYPTPROV
hcryptprov
;
DWORD
errval
;
BOOL
err
;
REQUIRE
(
VALID_ENTROPY
(
ent
));
...
...
@@ -258,7 +257,7 @@ isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) {
err
=
CryptAcquireContext
(
&
hcryptprov
,
NULL
,
NULL
,
PROV_RSA_FULL
,
CRYPT_VERIFYCONTEXT
);
if
(
!
err
){
errval
=
GetLastError
();
(
void
)
GetLastError
();
ret
=
ISC_R_IOERROR
;
goto
errout
;
}
...
...
lib/isc/win32/file.c
View file @
bbb3705e
...
...
@@ -210,7 +210,7 @@ isc_file_safemovefile(const char *oldname, const char *newname) {
tmpfd
=
mkstemp
(
buf
,
ISC_TRUE
);
if
(
tmpfd
>
0
)
_close
(
tmpfd
);
DeleteFile
(
buf
);
(
void
)
DeleteFile
(
buf
);
_chmod
(
newname
,
_S_IREAD
|
_S_IWRITE
);
filestatus
=
MoveFile
(
newname
,
buf
);
...
...
@@ -237,7 +237,7 @@ isc_file_safemovefile(const char *oldname, const char *newname) {
* Delete the backup file if it got created
*/
if
(
exists
==
TRUE
)
filestatus
=
DeleteFile
(
buf
);
(
void
)
DeleteFile
(
buf
);
return
(
0
);
}
...
...
@@ -335,7 +335,7 @@ isc_file_template(const char *path, const char *templet, char *buf,
isc_result_t
isc_file_renameunique
(
const
char
*
file
,
char
*
templet
)
{
int
fd
=
-
1
;
int
fd
;
int
res
=
0
;
isc_result_t
result
=
ISC_R_SUCCESS
;
...
...
lib/isc/win32/fsaccess.c
View file @
bbb3705e
...
...
@@ -168,7 +168,6 @@ NTFS_Access_Control(const char *filename, const char *user, int access,
char
domainBuffer
[
100
];
DWORD
domainBufferSize
=
sizeof
(
domainBuffer
);
SID_NAME_USE
snu
;
int
errval
;
DWORD
NTFSbits
;
int
caccess
;
...
...
@@ -184,13 +183,13 @@ NTFS_Access_Control(const char *filename, const char *user, int access,
domainBufferSize
=
sizeof
(
domainBuffer
);
if
(
!
LookupAccountName
(
0
,
"Administrators"
,
padminsid
,
&
adminSidBufferSize
,
domainBuffer
,
&
domainBufferSize
,
&
snu
))
{
errval
=
GetLastError
();
(
void
)
GetLastError
();
return
(
ISC_R_NOPERM
);
}
domainBufferSize
=
sizeof
(
domainBuffer
);
if
(
!
LookupAccountName
(
0
,
"Everyone"
,
pothersid
,
&
otherSidBufferSize
,
domainBuffer
,
&
domainBufferSize
,
&
snu
))
{
errval
=
GetLastError
();
(
void
)
GetLastError
();
return
(
ISC_R_NOPERM
);
}
...
...
@@ -287,7 +286,7 @@ NTFS_fsaccess_set(const char *path, isc_fsaccess_t access,
* For NTFS we first need to get the name of the account under
* which BIND is running
*/
if
(
namelen
<
=
0
)
{
if
(
namelen
=
=
0
)
{
namelen
=
sizeof
(
username
);
if
(
GetUserName
(
username
,
&
namelen
)
==
0
)
return
(
ISC_R_FAILURE
);
...
...
lib/isc/win32/net.c
View file @
bbb3705e
...
...
@@ -64,7 +64,6 @@ void InitSockets(void);
static
isc_result_t
try_proto
(
int
domain
)
{
SOCKET
s
;
isc_result_t
result
=
ISC_R_SUCCESS
;
char
strbuf
[
ISC_STRERRORSIZE
];
int
errval
;
...
...
lib/isc/win32/ntgroups.c
View file @
bbb3705e
...
...
@@ -62,7 +62,6 @@ isc_ntsecurity_getaccountgroups(char *username, char **GroupList,
DWORD
dwEntriesRead
=
0
;
DWORD
dwTotalEntries
=
0
;
NET_API_STATUS
nStatus
;
DWORD
dwTotalCount
=
0
;
size_t
retlen
;
wchar_t
user
[
MAX_NAME_LENGTH
];
...
...
@@ -97,7 +96,6 @@ isc_ntsecurity_getaccountgroups(char *username, char **GroupList,
dwEntriesRead
=
0
;
}
dwTotalCount
=
0
;
if
(
pBuf
!=
NULL
)
{
pTmpLBuf
=
pBuf
;
/*
...
...
lib/isc/win32/os.c
View file @
bbb3705e
...
...
@@ -35,7 +35,7 @@ initialize_action(void) {
unsigned
int
isc_os_ncpus
(
void
)
{
long
ncpus
=
1
;
long
ncpus
;
initialize_action
();
ncpus
=
SystemInfo
.
dwNumberOfProcessors
;
if
(
ncpus
<=
0
)
...
...
lib/isc/win32/socket.c
View file @
bbb3705e
...
...
@@ -718,7 +718,6 @@ static void
queue_receive_request
(
isc_socket_t
*
sock
)
{
DWORD
Flags
=
0
;
DWORD
NumBytes
=
0
;
int
total_bytes
=
0
;
int
Result
;
int
Error
;
int
need_retry
;
...
...
@@ -1096,9 +1095,8 @@ dump_msg(struct msghdr *msg, isc_socket_t *sock) {
printf
(
"
\t
name %p, namelen %d
\n
"
,
msg
->
msg_name
,
msg
->
msg_namelen
);
printf
(
"
\t
iov %p, iovlen %d
\n
"
,
msg
->
msg_iov
,
msg
->
msg_iovlen
);
for
(
i
=
0
;
i
<
(
unsigned
int
)
msg
->
msg_iovlen
;
i
++
)
printf
(
"
\t\t
%d
\t
base %p, len %d
\n
"
,
i
,
msg
->
msg_iov
[
i
].
buf
,
msg
->
msg_iov
[
i
].
len
);
printf
(
"
\t\t
%u
\t
base %p, len %u
\n
"
,
i
,
msg
->
msg_iov
[
i
].
buf
,
msg
->
msg_iov
[
i
].
len
);
}
#endif
...
...
@@ -1609,21 +1607,21 @@ free_socket(isc_socket_t **sockp, int lineno) {
isc_socket_t
*
sock
=
*
sockp
;
*
sockp
=
NULL
;
manager
=
sock
->
manager
;
/*
* Seems we can free the socket after all.
*/
manager
=
sock
->
manager
;
socket_log
(
__LINE__
,
sock
,
NULL
,
CREATION
,
isc_msgcat
,
ISC_MSGSET_SOCKET
,
ISC_MSG_DESTROYING
,
"freeing socket line %d fd %d lock %p semaphore %p"
,
socket_log
(
__LINE__
,
sock
,
NULL
,
CREATION
,
isc_msgcat
,
ISC_MSGSET_SOCKET
,
ISC_MSG_DESTROYING
,
"freeing socket line %d fd %d lock %p semaphore %p"
,
lineno
,
sock
->
fd
,
&
sock
->
lock
,
sock
->
lock
.
LockSemaphore
);
sock
->
magic
=
0
;
DESTROYLOCK
(
&
sock
->
lock
);
if
(
sock
->
recvbuf
.
base
!=
NULL
)
isc_mem_put
(
manager
->
mctx
,
sock
->
recvbuf
.
base
,
sock
->
recvbuf
.
len
);
isc_mem_put
(
manager
->
mctx
,
sock
->
recvbuf
.
base
,
sock
->
recvbuf
.
len
);
LOCK
(
&
manager
->
lock
);
if
(
ISC_LINK_LINKED
(
sock
,
link
))
...
...
@@ -1880,7 +1878,6 @@ isc__socket_attach(isc_socket_t *sock, isc_socket_t **socketp) {
void
isc__socket_detach
(
isc_socket_t
**
socketp
)
{
isc_socket_t
*
sock
;
isc_boolean_t
kill_socket
=
ISC_FALSE
;
REQUIRE
(
socketp
!=
NULL
);
sock
=
*
socketp
;
...
...
@@ -2779,10 +2776,7 @@ static isc_result_t
socket_recv
(
isc_socket_t
*
sock
,
isc_socketevent_t
*
dev
,
isc_task_t
*
task
,
unsigned
int
flags
)
{
int
cc
=
0
;
isc_task_t
*
ntask
=
NULL
;
isc_result_t
result
=
ISC_R_SUCCESS
;
int
recv_errno
=
0
;
dev
->
ev_sender
=
task
;
...
...
lib/isc/win32/win32os.c
View file @
bbb3705e
...
...
@@ -44,7 +44,7 @@ initialize_action(void) {
*/
if
(
!
bSuccess
)
{
osVer
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFO
);
bSuccess
=
GetVersionEx
((
OSVERSIONINFO
*
)
&
osVer
);
(
void
)
GetVersionEx
((
OSVERSIONINFO
*
)
&
osVer
);
}
bInit
=
TRUE
;
}
...
...
@@ -98,4 +98,4 @@ isc_win32os_versioncheck(unsigned int major, unsigned int minor,
/* Exact */
return
(
0
);
}
\ No newline at end of file
}
lib/lwres/win32/lwconfig.c
View file @
bbb3705e
...
...
@@ -70,6 +70,10 @@ get_win32_searchlist(lwres_context_t *ctx) {
}
confdata
->
searchnxt
=
0
;
if
(
!
keyFound
)
return
;
cp
=
strtok
((
char
*
)
searchlist
,
",
\0
"
);
while
(
cp
!=
NULL
)
{
if
(
confdata
->
searchnxt
==
LWRES_CONFMAXSEARCH
)
...
...
@@ -85,8 +89,7 @@ get_win32_searchlist(lwres_context_t *ctx) {
lwres_result_t
lwres_conf_parse
(
lwres_context_t
*
ctx
,
const
char
*
filename
)
{
lwres_result_t
ret
=
LWRES_R_SUCCESS
;
lwres_result_t
res
;
lwres_result_t
ret
;
lwres_conf_t
*
confdata
;
FIXED_INFO
*
FixedInfo
;
ULONG
BufLen
=
sizeof
(
FIXED_INFO
);
...
...
@@ -137,11 +140,11 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename) {
if
(
confdata
->
nsnext
>=
LWRES_CONFMAXNAMESERVERS
)
break
;
re
s
=
lwres_create_addr
(
pIPAddr
->
IpAddress
.
String
,
re
t
=
lwres_create_addr
(
pIPAddr
->
IpAddress
.
String
,
&
confdata
->
nameservers
[
confdata
->
nsnext
++
],
1
);
if
(
re
s
!=
LWRES_R_SUCCESS
)
{
if
(
re
t
!=
LWRES_R_SUCCESS
)
{
GlobalFree
(
FixedInfo
);
return
(
re
s
);
return
(
re
t
);
}
pIPAddr
=
pIPAddr
->
Next
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment