summaryrefslogtreecommitdiff
path: root/user/openldap/time64.patch
blob: 780d6706968e5cc450aab825ccbd33ff77f427e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
diff -ur a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c
--- a/libraries/libldap/os-ip.c	2022-12-12 23:12:56.618567894 -0600
+++ b/libraries/libldap/os-ip.c	2022-12-13 00:07:17.852129075 -0600
@@ -287,7 +287,7 @@
 	int		rc;
 		
 
-	Debug2(LDAP_DEBUG_TRACE, "ldap_int_poll: fd: %d tm: %ld\n",
+	Debug2(LDAP_DEBUG_TRACE, "ldap_int_poll: fd: %d tm: %lld\n",
 		s, tvp ? tvp->tv_sec : -1L );
 
 #ifdef HAVE_POLL
@@ -439,7 +439,7 @@
 	}
 
 	Debug3(LDAP_DEBUG_TRACE,
-			"ldap_pvt_connect: fd: %d tm: %ld async: %d\n",
+			"ldap_pvt_connect: fd: %d tm: %lld async: %d\n",
 			s, opt_tv ? tv.tv_sec : -1L, async);
 
 	if ( opt_tv && ldap_pvt_ndelay_on(ld, s) == -1 )
diff -ur a/libraries/libldap/os-local.c b/libraries/libldap/os-local.c
--- a/libraries/libldap/os-local.c	2022-12-12 23:12:56.618567894 -0600
+++ b/libraries/libldap/os-local.c	2022-12-12 23:36:15.152936427 -0600
@@ -164,7 +164,7 @@
 	}
 
 	Debug3(LDAP_DEBUG_TRACE,
-		"ldap_connect_timeout: fd: %d tm: %ld async: %d\n",
+		"ldap_connect_timeout: fd: %d tm: %lld async: %d\n",
 		s, opt_tv ? tv.tv_sec : -1L, async);
 
 	if ( ldap_pvt_ndelay_on(ld, s) == -1 ) return -1;
diff -ur a/libraries/libldap/result.c b/libraries/libldap/result.c
--- a/libraries/libldap/result.c	2022-12-12 23:12:56.618567894 -0600
+++ b/libraries/libldap/result.c	2022-12-12 23:34:24.977768222 -0600
@@ -264,8 +264,8 @@
 		Debug2( LDAP_DEBUG_TRACE, "wait4msg ld %p msgid %d (infinite timeout)\n",
 			(void *)ld, msgid );
 	} else {
-		Debug3( LDAP_DEBUG_TRACE, "wait4msg ld %p msgid %d (timeout %ld usec)\n",
-			(void *)ld, msgid, (long)timeout->tv_sec * 1000000 + timeout->tv_usec );
+		Debug3( LDAP_DEBUG_TRACE, "wait4msg ld %p msgid %d (timeout %lld usec)\n",
+			(void *)ld, msgid, (time_t)timeout->tv_sec * 1000000 + timeout->tv_usec );
 	}
 #endif /* LDAP_DEBUG */
 
diff -ur a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c
--- a/servers/slapd/back-ldap/bind.c	2022-12-12 23:12:56.614567788 -0600
+++ b/servers/slapd/back-ldap/bind.c	2022-12-12 23:43:22.086371097 -0600
@@ -2999,14 +2999,14 @@
 	}
 
 	if ( lc->lcb_create_time != 0 ) {
-		len = snprintf( tbuf, sizeof(tbuf), "%ld", lc->lcb_create_time );
+		len = snprintf( tbuf, sizeof(tbuf), "%lld", lc->lcb_create_time );
 		if ( ptr + sizeof(" created=") + len >= end ) return -1;
 		ptr = lutil_strcopy( ptr, " created=" );
 		ptr = lutil_strcopy( ptr, tbuf );
 	}
 
 	if ( lc->lcb_time != 0 ) {
-		len = snprintf( tbuf, sizeof(tbuf), "%ld", lc->lcb_time );
+		len = snprintf( tbuf, sizeof(tbuf), "%lld", lc->lcb_time );
 		if ( ptr + sizeof(" modified=") + len >= end ) return -1;
 		ptr = lutil_strcopy( ptr, " modified=" );
 		ptr = lutil_strcopy( ptr, tbuf );
@@ -3185,7 +3185,7 @@
 		 */
 		slap_wake_listener();
 		Debug( LDAP_DEBUG_TRACE,
-			"ldap_back_conn_prune: scheduled connection expiry timer to %ld sec\n",
+			"ldap_back_conn_prune: scheduled connection expiry timer to %lld sec\n",
 			li->li_conn_expire_task->interval.tv_sec );
 	} else if ( next_timeout == -1 && li->li_conn_expire_task != NULL ) {
 		if ( ldap_pvt_runqueue_isrunning( &slapd_rq, li->li_conn_expire_task ) ) {
@@ -3221,7 +3221,7 @@
 			"ldap_back_conn_expire_timer" );
 		slap_wake_listener();
 		Debug( LDAP_DEBUG_TRACE,
-			"ldap_back_conn_prune: scheduled connection expiry timer to %ld sec\n",
+			"ldap_back_conn_prune: scheduled connection expiry timer to %lld sec\n",
 			li->li_conn_expire_task->interval.tv_sec );
 	}
 	ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
diff -ur a/servers/slapd/overlays/dds.c b/servers/slapd/overlays/dds.c
--- a/servers/slapd/overlays/dds.c	2022-12-12 23:12:56.614567788 -0600
+++ b/servers/slapd/overlays/dds.c	2022-12-12 23:42:29.632772350 -0600
@@ -418,7 +418,7 @@
 		assert( ttl <= DDS_RF2589_MAX_TTL );
 
 		bv.bv_val = ttlbuf;
-		bv.bv_len = snprintf( ttlbuf, sizeof( ttlbuf ), "%ld", ttl );
+		bv.bv_len = snprintf( ttlbuf, sizeof( ttlbuf ), "%lld", ttl );
 		assert( bv.bv_len < sizeof( ttlbuf ) );
 
 		/* FIXME: apparently, values in op->ora_e are malloc'ed
@@ -696,7 +696,7 @@
 					goto done;
 				}
 
-				bv_entryTtl.bv_len = snprintf( textbuf, sizeof( textbuf ), "%ld", entryTtl );
+				bv_entryTtl.bv_len = snprintf( textbuf, sizeof( textbuf ), "%lld", entryTtl );
 				break;
 
 			default:
@@ -918,7 +918,7 @@
 		ttl = (ttl < 0) ? 0 : ttl;
 		assert( ttl <= DDS_RF2589_MAX_TTL );
 
-		len = snprintf( ttlbuf, sizeof(ttlbuf), "%ld", ttl );
+		len = snprintf( ttlbuf, sizeof(ttlbuf), "%lld", ttl );
 		if ( len < 0 )
 		{
 			goto done;
@@ -1178,7 +1178,7 @@
 		ttlmod.sml_values = ttlvalues;
 		ttlmod.sml_numvals = 1;
 		ttlvalues[ 0 ].bv_val = ttlbuf;
-		ttlvalues[ 0 ].bv_len = snprintf( ttlbuf, sizeof( ttlbuf ), "%ld", ttl );
+		ttlvalues[ 0 ].bv_len = snprintf( ttlbuf, sizeof( ttlbuf ), "%lld", ttl );
 		BER_BVZERO( &ttlvalues[ 1 ] );
 
 		/* the entryExpireTimestamp is added by modify */
@@ -1206,7 +1206,7 @@
 				rs->sr_rspoid = ch_strdup( slap_EXOP_REFRESH.bv_val );
 
 				Log( LDAP_DEBUG_TRACE, LDAP_LEVEL_INFO,
-					"%s REFRESH dn=\"%s\" TTL=%ld\n",
+					"%s REFRESH dn=\"%s\" TTL=%lld\n",
 					op->o_log_prefix, op->o_req_ndn.bv_val, ttl );
 			}
 
diff -ur a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c
--- a/servers/slapd/overlays/pcache.c	2022-12-12 23:12:56.614567788 -0600
+++ b/servers/slapd/overlays/pcache.c	2022-12-13 00:07:55.205195373 -0600
@@ -375,12 +375,12 @@
 	attrset_len = sprintf( attrset_buf,
 		"%lu", (unsigned long)q->qtemp->attr_set_index );
 	expiry_len = sprintf( expiry_buf,
-		"%lu", (unsigned long)q->expiry_time );
+		"%llu", (unsigned long long)q->expiry_time );
 	answerable_len = snprintf( answerable_buf, sizeof( answerable_buf ),
 		"%lu", q->answerable_cnt );
 	if ( q->refresh_time )
 		refresh_len = sprintf( refresh_buf,
-			"%lu", (unsigned long)q->refresh_time );
+			"%llu", (unsigned long long)q->refresh_time );
 	else
 		refresh_len = 0;
 
@@ -1601,8 +1601,8 @@
 
 	new_cached_query->lru_up = NULL;
 	new_cached_query->lru_down = NULL;
-	Debug( pcache_debug, "Added query expires at %ld (%s)\n",
-			(long) new_cached_query->expiry_time,
+	Debug( pcache_debug, "Added query expires at %lld (%s)\n",
+			(long long) new_cached_query->expiry_time,
 			pc_caching_reason_str[ why ] );
 
 	new_cached_query->scope = query->scope;
@@ -2729,7 +2729,7 @@
 					pbi->bi_flags |= BI_HASHED;
 			} else {
 				Debug( pcache_debug, "pc_bind_search: cache is stale, "
-					"reftime: %ld, current time: %ld\n",
+					"reftime: %lld, current time: %lld\n",
 					pbi->bi_cq->bindref_time, op->o_time );
 			}
 		} else if ( pbi->bi_si ) {
@@ -3865,7 +3865,7 @@
 		struct berval bv;
 		switch( c->type ) {
 		case PC_MAIN:
-			bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s %d %d %d %ld",
+			bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s %d %d %d %lld",
 				cm->db.bd_info->bi_type, cm->max_entries, cm->numattrsets,
 				cm->num_entries_limit, cm->cc_period );
 			bv.bv_val = c->cr_msg;
@@ -3909,7 +3909,7 @@
 				/* HEADS-UP: always print all;
 				 * if optional == 0, ignore */
 				bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ),
-					" %d %ld %ld %ld %ld",
+					" %d %lld %lld %lld %lld",
 					temp->attr_set_index,
 					temp->ttl,
 					temp->negttl,
@@ -3931,7 +3931,7 @@
 			for (temp=qm->templates; temp; temp=temp->qmnext) {
 				if ( !temp->bindttr ) continue;
 				bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ),
-					" %d %ld %s ",
+					" %d %lld %s ",
 					temp->attr_set_index,
 					temp->bindttr,
 					ldap_pvt_scope2str( temp->bindscope ));