Skip to content

Commit 489b480

Browse files
committed
emsmdb: delete ftstream_producer_read_svreid
References: GXH-130
1 parent 2731b29 commit 489b480

File tree

3 files changed

+21
-68
lines changed

3 files changed

+21
-68
lines changed

exch/emsmdb/ftstream_parser.cpp

Lines changed: 9 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -201,57 +201,6 @@ static BOOL ftstream_parser_read_guid(fxstream_parser *pstream, GUID *pguid)
201201
return TRUE;
202202
}
203203

204-
static BOOL ftstream_parser_read_svreid(fxstream_parser *pstream,
205-
SVREID *psvreid, BOOL *pb_continue)
206-
{
207-
uint32_t len;
208-
uint8_t ours;
209-
uint32_t origin_offset;
210-
211-
*pb_continue = FALSE;
212-
origin_offset = pstream->offset;
213-
if (!ftstream_parser_read_uint32(pstream, &len))
214-
return FALSE;
215-
if (origin_offset + sizeof(uint32_t) + len >
216-
pstream->st_size) {
217-
*pb_continue = TRUE;
218-
return FALSE;
219-
}
220-
if (len == 0)
221-
abort(); /* if this ever happens, make cb=0,pb=NULL */
222-
if (read(pstream->fd, &ours, sizeof(uint8_t)) != sizeof(uint8_t))
223-
return FALSE;
224-
pstream->offset += sizeof(uint8_t);
225-
if (0 == ours) {
226-
psvreid->pbin = cu_alloc<BINARY>();
227-
if (psvreid->pbin == nullptr)
228-
return FALSE;
229-
psvreid->pbin->cb = len - 1;
230-
if (0 == psvreid->pbin->cb) {
231-
psvreid->pbin->pb = NULL;
232-
} else {
233-
psvreid->pbin->pv = common_util_alloc(psvreid->pbin->cb);
234-
if (psvreid->pbin->pv == nullptr)
235-
return FALSE;
236-
auto ret = read(pstream->fd, psvreid->pbin->pv, psvreid->pbin->cb);
237-
if (ret < 0 || static_cast<size_t>(ret) != psvreid->pbin->cb)
238-
return FALSE;
239-
pstream->offset += psvreid->pbin->cb;
240-
}
241-
return TRUE;
242-
}
243-
if (len != 21)
244-
return FALSE;
245-
psvreid->pbin = NULL;
246-
if (!ftstream_parser_read_uint64(pstream, &psvreid->folder_id))
247-
return FALSE;
248-
if (!ftstream_parser_read_uint64(pstream, &psvreid->message_id))
249-
return FALSE;
250-
if (!ftstream_parser_read_uint32(pstream, &psvreid->instance))
251-
return FALSE;
252-
return TRUE;
253-
}
254-
255204
static BOOL ftstream_parser_read_binary(fxstream_parser *pstream, BINARY *pbin,
256205
BOOL *pb_continue)
257206
{
@@ -462,17 +411,16 @@ static int ftstream_parser_read_element(fxstream_parser &stream,
462411
propval.pvalue = v;
463412
return ftstream_parser_read_guid(pstream, v) ? FTSTREAM_PARSER_READ_OK : FTSTREAM_PARSER_READ_FAIL;
464413
}
465-
case PT_SVREID: {
466-
auto v = cu_alloc<SVREID>();
467-
if (v == nullptr)
468-
return FTSTREAM_PARSER_READ_FAIL;
469-
propval.pvalue = v;
470-
if (ftstream_parser_read_svreid(pstream, v, &b_continue))
471-
return FTSTREAM_PARSER_READ_OK;
472-
if (b_continue)
473-
goto CONTINUE_WAITING;
414+
case PT_SVREID:
415+
/*
416+
* You cannot create these property types in MSMAPI. This
417+
* precludes them from truly existing on the client side, and
418+
* so they have never been observed of being transferred in
419+
* either direction.
420+
* PT_SVREID only seems to show up in restrictions.
421+
*/
422+
mlog(LV_ERR, "E-2273: Reception of PT_SVREID in fxstream is unsupported");
474423
return FTSTREAM_PARSER_READ_FAIL;
475-
}
476424
case PT_OBJECT:
477425
case PT_BINARY: {
478426
auto v = cu_alloc<BINARY>();

exch/emsmdb/ftstream_producer.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,11 @@ static BOOL ftstream_producer_write_propvalue(fxstream_producer *pstream,
304304
uint16_t write_type;
305305
auto propid = PROP_ID(ppropval->proptag);
306306
auto proptype = PROP_TYPE(ppropval->proptag);
307-
/* ignore PT_SVREID */
307+
/*
308+
* The ftstream reader on the MSMAPI side does not know what to do with
309+
* these and usually throws an error (e.g. when using FXCopyMessages,
310+
* or FXSynchronizeConfigure).
311+
*/
308312
if (proptype == PT_SVREID)
309313
return TRUE;
310314
if (ppropval->proptag == PR_MESSAGE_CLASS)
@@ -385,11 +389,6 @@ static BOOL ftstream_producer_write_propvalue(fxstream_producer *pstream,
385389
return ftstream_producer_write_wstring(pstream, static_cast<char *>(ppropval->pvalue));
386390
case PT_CLSID:
387391
return ftstream_producer_write_guid(pstream, static_cast<GUID *>(ppropval->pvalue));
388-
/*
389-
case PT_SVREID:
390-
return ftstream_producer_write_svreid(
391-
pstream, ppropval->pvalue);
392-
*/
393392
case PT_OBJECT:
394393
case PT_BINARY:
395394
return ftstream_producer_write_binary(pstream, static_cast<BINARY *>(ppropval->pvalue));

exch/emsmdb/oxctabl.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ static inline bool table_acceptable_type(uint16_t type)
5959
case PT_UNICODE:
6060
case PT_SYSTIME:
6161
case PT_CLSID:
62-
case PT_SVREID:
6362
case PT_SRESTRICTION:
6463
case PT_ACTIONS:
6564
case PT_BINARY:
@@ -76,6 +75,13 @@ static inline bool table_acceptable_type(uint16_t type)
7675
case PT_MV_CLSID:
7776
case PT_MV_BINARY:
7877
return true;
78+
case PT_SVREID:
79+
/*
80+
* MSMAPI rejects SetColumns with PT_SVREID tags even before
81+
* calling rop_setcolumns. So this line is never reached in
82+
* reality.
83+
*/
84+
return true;
7985
default:
8086
return false;
8187
}

0 commit comments

Comments
 (0)