Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
007cbfc8
Commit
007cbfc8
authored
Sep 16, 1998
by
Kurt Zeilenga
Browse files
Insert Y2K fix (hidden behind -DLDAP_Y2K).
parent
916a5f9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
servers/slapd/add.c
View file @
007cbfc8
...
...
@@ -145,7 +145,7 @@ do_add( conn, op )
static
void
add_created_attrs
(
Operation
*
op
,
Entry
*
e
)
{
char
buf
[
2
0
];
char
buf
[
2
2
];
struct
berval
bv
;
struct
berval
*
bvals
[
2
];
Attribute
**
a
,
**
next
;
...
...
@@ -182,8 +182,12 @@ add_created_attrs( Operation *op, Entry *e )
attr_merge
(
e
,
"creatorsname"
,
bvals
);
pthread_mutex_lock
(
&
currenttime_mutex
);
ltm
=
localtime
(
&
currenttime
);
strftime
(
buf
,
sizeof
(
buf
),
"%y%m%d%H%M%SZ"
,
ltm
);
ltm
=
localtime
(
&
currenttime
);
#ifdef LDAP_Y2K
strftime
(
buf
,
sizeof
(
buf
),
"%Y%m%d%H%M%SZ"
,
ltm
);
#else
strftime
(
buf
,
sizeof
(
buf
),
"%y%m%d%H%M%SZ"
,
ltm
);
#endif
pthread_mutex_unlock
(
&
currenttime_mutex
);
bv
.
bv_val
=
buf
;
...
...
servers/slapd/modify.c
View file @
007cbfc8
...
...
@@ -200,7 +200,7 @@ modlist_free(
static
void
add_lastmods
(
Operation
*
op
,
LDAPMod
**
mods
)
{
char
buf
[
2
0
];
char
buf
[
2
2
];
struct
berval
bv
;
struct
berval
*
bvals
[
2
];
LDAPMod
**
m
;
...
...
@@ -251,8 +251,12 @@ add_lastmods( Operation *op, LDAPMod **mods )
*
mods
=
tmp
;
pthread_mutex_lock
(
&
currenttime_mutex
);
ltm
=
localtime
(
&
currenttime
);
strftime
(
buf
,
sizeof
(
buf
),
"%y%m%d%H%M%SZ"
,
ltm
);
ltm
=
localtime
(
&
currenttime
);
#ifdef LDAP_Y2K
strftime
(
buf
,
sizeof
(
buf
),
"%Y%m%d%H%M%SZ"
,
ltm
);
#else
strftime
(
buf
,
sizeof
(
buf
),
"%y%m%d%H%M%SZ"
,
ltm
);
#endif
pthread_mutex_unlock
(
&
currenttime_mutex
);
bv
.
bv_val
=
buf
;
bv
.
bv_len
=
strlen
(
bv
.
bv_val
);
...
...
servers/slapd/monitor.c
View file @
007cbfc8
...
...
@@ -49,7 +49,7 @@ void
monitor_info
(
Connection
*
conn
,
Operation
*
op
)
{
Entry
*
e
;
char
buf
[
BUFSIZ
],
buf2
[
2
0
];
char
buf
[
BUFSIZ
],
buf2
[
2
2
];
struct
berval
val
;
struct
berval
*
vals
[
2
];
int
i
,
nconns
,
nwritewaiters
,
nreadwaiters
;
...
...
@@ -92,7 +92,11 @@ monitor_info( Connection *conn, Operation *op )
}
pthread_mutex_lock
(
&
currenttime_mutex
);
ltm
=
localtime
(
&
c
[
i
].
c_starttime
);
#ifdef LDAP_Y2K
strftime
(
buf2
,
sizeof
(
buf2
),
"%Y%m%d%H%M%SZ"
,
ltm
);
#else
strftime
(
buf2
,
sizeof
(
buf2
),
"%y%m%d%H%M%SZ"
,
ltm
);
#endif
pthread_mutex_unlock
(
&
currenttime_mutex
);
pthread_mutex_lock
(
&
c
[
i
].
c_dnmutex
);
...
...
@@ -155,16 +159,24 @@ monitor_info( Connection *conn, Operation *op )
attr_merge
(
e
,
"bytessent"
,
vals
);
pthread_mutex_lock
(
&
currenttime_mutex
);
ltm
=
localtime
(
&
currenttime
);
strftime
(
buf
,
sizeof
(
buf
),
"%y%m%d%H%M%SZ"
,
ltm
);
ltm
=
localtime
(
&
currenttime
);
#ifdef LDAP_Y2K
strftime
(
buf
,
sizeof
(
buf
),
"%Y%m%d%H%M%SZ"
,
ltm
);
#else
strftime
(
buf
,
sizeof
(
buf
),
"%y%m%d%H%M%SZ"
,
ltm
);
#endif
pthread_mutex_unlock
(
&
currenttime_mutex
);
val
.
bv_val
=
buf
;
val
.
bv_len
=
strlen
(
buf
);
attr_merge
(
e
,
"currenttime"
,
vals
);
pthread_mutex_lock
(
&
currenttime_mutex
);
ltm
=
localtime
(
&
starttime
);
strftime
(
buf
,
sizeof
(
buf
),
"%y%m%d%H%M%SZ"
,
ltm
);
ltm
=
localtime
(
&
starttime
);
#ifdef LDAP_Y2K
strftime
(
buf
,
sizeof
(
buf
),
"%Y%m%d%H%M%SZ"
,
ltm
);
#else
strftime
(
buf
,
sizeof
(
buf
),
"%y%m%d%H%M%SZ"
,
ltm
);
#endif
pthread_mutex_unlock
(
&
currenttime_mutex
);
val
.
bv_val
=
buf
;
val
.
bv_len
=
strlen
(
buf
);
...
...
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