Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
15fffeda
Commit
15fffeda
authored
23 years ago
by
Julius Enarusai
Browse files
Options
Downloads
Patches
Plain Diff
Added LDAP_LOG Messages
parent
31944003
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slurpd/replog.c
+39
-0
39 additions, 0 deletions
servers/slurpd/replog.c
with
39 additions
and
0 deletions
servers/slurpd/replog.c
+
39
−
0
View file @
15fffeda
...
...
@@ -57,9 +57,14 @@ copy_replog(
static
char
rbuf
[
1024
];
char
*
p
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"replog"
,
LDAP_LEVEL_ARGS
,
"copy_replog: "
"copy replog
\"
%s
\"
to
\"
%s
\"\n
"
,
src
,
dst
));
#else
Debug
(
LDAP_DEBUG_ARGS
,
"copy replog
\"
%s
\"
to
\"
%s
\"\n
"
,
src
,
dst
,
0
);
#endif
/*
* Make sure the destination directory is writable. If not, exit
...
...
@@ -72,9 +77,15 @@ copy_replog(
*
p
=
'\0'
;
}
if
(
access
(
buf
,
W_OK
)
<
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"replog"
,
LDAP_LEVEL_ERR
,
"copy_replog: "
"Error: (%ld): Directory %s is not writable
\n
"
,
(
long
)
getpid
(),
buf
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"Error: copy_replog (%ld): Directory %s is not writable
\n
"
,
(
long
)
getpid
(),
buf
,
0
);
#endif
return
(
-
1
);
}
strcpy
(
buf
,
dst
);
...
...
@@ -84,27 +95,45 @@ copy_replog(
*
p
=
'\0'
;
}
if
(
access
(
buf
,
W_OK
)
<
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"replog"
,
LDAP_LEVEL_ERR
,
"copy_replog: "
"Error: (%ld): Directory %s is not writable
\n
"
,
(
long
)
getpid
(),
buf
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"Error: copy_replog (%ld): Directory %s is not writable
\n
"
,
(
long
)
getpid
(),
buf
,
0
);
#endif
return
(
-
1
);
}
/* lock src */
rfp
=
lock_fopen
(
src
,
"r"
,
&
lfp
);
if
(
rfp
==
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"replog"
,
LDAP_LEVEL_ERR
,
"copy_replog: "
"Error: Can't lock replog
\"
%s
\"
for read: %s
\n
"
,
src
,
sys_errlist
[
errno
]
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"Error: copy_replog: Can't lock replog
\"
%s
\"
for read: %s
\n
"
,
src
,
sys_errlist
[
errno
],
0
);
#endif
return
(
1
);
}
/* lock dst */
dfp
=
lock_fopen
(
dst
,
"a"
,
&
dlfp
);
if
(
dfp
==
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"replog"
,
LDAP_LEVEL_ERR
,
"copy_replog: "
"Error: Can't lock replog
\"
%s
\"
for write: %s
\n
"
,
src
,
sys_errlist
[
errno
]
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"Error: copy_replog: Can't lock replog
\"
%s
\"
for write: %s
\n
"
,
src
,
sys_errlist
[
errno
],
0
);
#endif
lock_fclose
(
rfp
,
lfp
);
return
(
1
);
}
...
...
@@ -122,14 +151,24 @@ copy_replog(
}
if
(
lock_fclose
(
dfp
,
dlfp
)
==
EOF
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"replog"
,
LDAP_LEVEL_ERR
,
"copy_replog: "
"Error: Error closing
\"
%s
\"\n
"
,
src
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"Error: copy_replog: Error closing
\"
%s
\"\n
"
,
src
,
0
,
0
);
#endif
}
if
(
lock_fclose
(
rfp
,
lfp
)
==
EOF
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"replog"
,
LDAP_LEVEL_ERR
,
"copy_replog: "
"Error: Error closing
\"
%s
\"\n
"
,
src
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"Error: copy_replog: Error closing
\"
%s
\"\n
"
,
src
,
0
,
0
);
#endif
}
return
(
rc
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment