Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
91f628bf
Commit
91f628bf
authored
Jun 20, 2011
by
Hallvard Furuseth
Committed by
Quanah Gibson-Mount
Jun 21, 2011
Browse files
Tweak back-ldif messages about CRC checksums.
parent
994e07f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-ldif/ldif.c
View file @
91f628bf
...
...
@@ -420,6 +420,7 @@ ldif_read_file( const char *path, char **datap )
int
res
=
-
1
;
/* 0:success, <0:error, >0:file too big/growing. */
struct
stat
st
;
char
*
data
=
NULL
,
*
ptr
=
NULL
;
const
char
*
msg
;
if
(
datap
==
NULL
)
{
res
=
stat
(
path
,
&
st
);
...
...
@@ -453,14 +454,13 @@ ldif_read_file( const char *path, char **datap )
done:
if
(
res
==
0
)
{
#ifdef LDAP_DEBUG
Debug
(
LDAP_DEBUG_TRACE
,
"ldif_read_file: %s:
\"
%s
\"\n
"
,
datap
?
"read entry file"
:
"entry file exists"
,
path
,
0
);
msg
=
"entry file exists"
;
if
(
datap
)
{
msg
=
"read entry file"
;
len
=
ptr
-
data
;
ptr
=
strstr
(
data
,
"
\n
# CRC32"
);
if
(
!
ptr
)
{
Debug
(
LDAP_DEBUG_TRACE
,
"ldif_read_file: no checksum
\"
%s
\"\n
"
,
path
,
0
,
0
);
msg
=
"read entry file without checksum"
;
}
else
{
unsigned
int
crc1
=
0
,
crc2
=
1
;
if
(
sscanf
(
ptr
+
9
,
"%08x"
,
&
crc1
)
==
1
)
{
...
...
@@ -474,9 +474,11 @@ ldif_read_file( const char *path, char **datap )
if
(
crc1
!=
crc2
)
{
Debug
(
LDAP_DEBUG_ANY
,
"ldif_read_file: checksum error on
\"
%s
\"\n
"
,
path
,
0
,
0
);
return
rc
;
}
}
}
Debug
(
LDAP_DEBUG_TRACE
,
"ldif_read_file: %s:
\"
%s
\"\n
"
,
msg
,
path
,
0
);
#endif
/* LDAP_DEBUG */
}
else
{
if
(
res
<
0
&&
errno
==
ENOENT
)
{
...
...
@@ -484,7 +486,7 @@ ldif_read_file( const char *path, char **datap )
"no entry file
\"
%s
\"\n
"
,
path
,
0
,
0
);
rc
=
LDAP_NO_SUCH_OBJECT
;
}
else
{
const
char
*
msg
=
res
<
0
?
STRERROR
(
errno
)
:
"bad stat() size"
;
msg
=
res
<
0
?
STRERROR
(
errno
)
:
"bad stat() size"
;
Debug
(
LDAP_DEBUG_ANY
,
"ldif_read_file: %s for
\"
%s
\"\n
"
,
msg
,
path
,
0
);
rc
=
LDAP_OTHER
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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