mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 18:56:25 +00:00
Make rhizome_add_manifest() stricter for MeshMS
If author not given, use 'sender' as author Ensure that author and 'sender' field are identical
This commit is contained in:
parent
ddd17db1c4
commit
c2de68449b
@ -163,6 +163,12 @@ int rhizome_add_manifest(rhizome_manifest *m_in,
|
|||||||
return WHY("Manifest missing 'sender' field");
|
return WHY("Manifest missing 'sender' field");
|
||||||
if (!validateSid(sender))
|
if (!validateSid(sender))
|
||||||
return WHY("Manifest contains invalid 'sender' field");
|
return WHY("Manifest contains invalid 'sender' field");
|
||||||
|
/* If the author was not specified, use the 'sender' as the author, otherwise ensure that they
|
||||||
|
match. */
|
||||||
|
if (!author || !author[0])
|
||||||
|
author = sender;
|
||||||
|
else if (strcasecmp(author, sender))
|
||||||
|
return WHYF("Author inconsistent with sender: author=%s, sender=%s", author, sender);
|
||||||
if (recipient == NULL || !recipient[0])
|
if (recipient == NULL || !recipient[0])
|
||||||
return WHY("Manifest missing 'recipient' field");
|
return WHY("Manifest missing 'recipient' field");
|
||||||
if (!validateSid(recipient))
|
if (!validateSid(recipient))
|
||||||
|
Loading…
Reference in New Issue
Block a user