diff options
author | Uros Majstorovic <majstor@majstor.org> | 2024-05-10 19:49:06 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2024-05-10 19:49:06 +0200 |
commit | ce55165b6952f9325c34b0008b5116b16736c4cb (patch) | |
tree | 7c85cb58e0eff3c9a884c499ad87ba6069dbc6ce /ecp/server/acl.c | |
parent | 3f814b6f30a9ae296805ebab49114fb24ab3b0d1 (diff) |
server support for fragmented dir reply; fixed shadow reply messages accordingly
Diffstat (limited to 'ecp/server/acl.c')
-rw-r--r-- | ecp/server/acl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ecp/server/acl.c b/ecp/server/acl.c index d8cdc6e..7561af8 100644 --- a/ecp/server/acl.c +++ b/ecp/server/acl.c @@ -50,18 +50,18 @@ void acl_destroy_list(ACLItem *head) { } } -static int _add_key(ecp_ecdh_public_t *public, uint8_t capabilities) { +static int _add_key(ecp_ecdh_public_t *public, uint8_t roles) { int rv; if ((acl_keys == NULL) || (acl_keys_dir == NULL)) return ECP_ERR; - if ((srv_config->capabilities & ECP_DIR_CAP_DIR) || (srv_config->capabilities & capabilities & ECP_DIR_CAP_VCONN)) { + if ((srv_config->roles & ECP_ROLE_DIR) || (srv_config->roles & roles & ECP_ROLE_VCONN)) { /* directory server accepts all connections vconn server accepts connections only from other vconn servers */ rv = ecp_ht_insert_uniq(acl_keys, public, &acl_mark); if (rv && (rv != ECP_ERR_DUP)) return rv; } - if (srv_config->capabilities & capabilities & ECP_DIR_CAP_DIR) { + if (srv_config->roles & roles & ECP_ROLE_DIR) { rv = ecp_ht_insert_uniq(acl_keys_dir, public, &acl_mark); if (rv && (rv != ECP_ERR_DUP)) return rv; } @@ -98,7 +98,7 @@ static int _li2ht(ACLItem *head, int is_dir) { while (head) { for (i=0; i<head->key_cnt; i++) { - rv = _add_key(&head->key[i], is_dir ? ECP_DIR_CAP_DIR : 0); + rv = _add_key(&head->key[i], is_dir ? ECP_ROLE_DIR : 0); if (rv) return rv; } head = head->next; @@ -111,7 +111,7 @@ int acl_add_key(ECPDirItem *dir_item) { int rv; pthread_rwlock_wrlock(&acl_ht_rwlock); - rv = _add_key(&dir_item->node.key_perma.public, dir_item->capabilities); + rv = _add_key(&dir_item->node.key_perma.public, dir_item->roles); pthread_rwlock_unlock(&acl_ht_rwlock); return rv; |