Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dsconf should prevent setting the replicaID for hub and consumer roles #5848

Closed
kimettog opened this issue Jul 21, 2023 · 2 comments
Closed
Labels
needs triage The issue will be triaged during scrum

Comments

@kimettog
Copy link
Contributor

Issue Description
dsconf accepts the "replica-id" option when setting a hub or a consumer.
The replica configuration entry is correctly created ( replicaID is set to 65535 ).

It would nice to prevent users setting the replicaID for hub and consumer roles because the value is set automatically anyway.
Customers could try creating hubs and consumers using a replicaID different of 65535.

Package Version and Platform:

  • Platform: RHEL
  • Package and version: 389-ds-base-1.4.3.22-1.module+el8dsrv+10501+8ce33e95.x86_64

Steps to Reproduce
Steps to reproduce the behavior:

  1. Try to create a consumer using a replicaID different of 65535:
    $ dsconf -v -D "cn=Directory Manager" ldap://localhost:1389 replication enable --suffix="dc=test,dc=com" --role="consumer" --replica-id=1

  2. Check the actual configured value:
    $ dsconf -D "cn=Directory Manager" ldap://localhost:1389 replication get --suffix="dc=test,dc=com" | grep -i replicaIDEnter password for cn=Directory Manager on ldap://localhost:1389:
    nsDS5ReplicaId: 65535
    Actual results:
    One can pass the parameter "replica-id" to dsconf when creating hubs or consumers.

Expected results
Don't allow to set the "replica-id" manually for hubs and consumers.

Additional context
$ dsconf -v -D "cn=Directory Manager" ldap://localhost:1389 replication enable --suffix="dc=test,dc=com" --role="consumer" --replica-id=1
DEBUG: The 389 Directory Server Configuration Tool
...
DEBUG: Checking "None" under None : {'cn': 'changelog5', 'nsslapd-changelogdir': '/var/lib/dirsrv/slapd-alps9/changelogdb'}
DEBUG: Validated dn cn=changelog5,cn=config
DEBUG: Creating cn=changelog5,cn=config
DEBUG: updating dn: cn=changelog5,cn=config
DEBUG: updated dn: cn=changelog5,cn=config with {'objectclass': [b'top', b'nsChangelogConfig']}
DEBUG: updating dn: cn=changelog5,cn=config
DEBUG: updated dn: cn=changelog5,cn=config with {'cn': [b'changelog5'], 'nsslapd-changelogdir': [b'/var/lib/dirsrv/slapd-alps9/changelogdb']}
DEBUG: Checking "None" under cn=mapping tree,cn=config : {'cn': 'replica', 'nsDS5ReplicaRoot': 'dc=test,dc=com', 'nsDS5Flags': '0', 'nsDS5ReplicaType': '2', 'nsDS5ReplicaId': '65535'}
DEBUG: Using first property cn: replica as rdn
DEBUG: _gen_selector filter = (&(&(objectclass=nsMappingTree))(|(cn=dc=test,dc=com)(nsslapd-backend=dc=test,dc=com)))
DEBUG: Validated dn cn=replica,cn=dc\3Dtest\2Cdc\3Dcom,cn=mapping tree,cn=config
DEBUG: Creating cn=replica,cn=dc\3Dtest\2Cdc\3Dcom,cn=mapping tree,cn=config
DEBUG: updating dn: cn=replica,cn=dc\3Dtest\2Cdc\3Dcom,cn=mapping tree,cn=config
DEBUG: updated dn: cn=replica,cn=dc\3Dtest\2Cdc\3Dcom,cn=mapping tree,cn=config with {'objectclass': [b'top', b'nsds5Replica']}
DEBUG: updating dn: cn=replica,cn=dc\3Dtest\2Cdc\3Dcom,cn=mapping tree,cn=config
DEBUG: updated dn: cn=replica,cn=dc\3Dtest\2Cdc\3Dcom,cn=mapping tree,cn=config with {'cn': [b'replica'], 'nsDS5ReplicaRoot': [b'dc=test,dc=com'], 'nsDS5Flags': [b'0'], 'nsDS5ReplicaType': [b'2'], 'nsDS5ReplicaId': [b'65535']}
DEBUG: Created entry cn=replica,cn=dc\3Dtest\2Cdc\3Dcom,cn=mapping tree,cn=config : {'objectclass': [b'top', b'nsds5Replica'], 'cn': [b'replica'], 'nsDS5ReplicaRoot': [b'dc=test,dc=com'], 'nsDS5Flags': [b'0'], 'nsDS5ReplicaType': [b'2'], 'nsDS5ReplicaId': [b'65535']}
INFO: Replication successfully enabled for "dc=test,dc=com"
INFO: Command successful.

@kimettog kimettog added the needs triage The issue will be triaged during scrum label Jul 21, 2023
kimettog added a commit to kimettog/389-ds-base that referenced this issue Jul 21, 2023
…consumer roles

Bug Description:

dsconf accepts the "replica-id" option when setting a hub or a consumer.
The replica configuration entry is correctly created ( replicaID is set to 65535 ).
we should  prevent users setting the replicaID for hub and consumer roles because the value is set automatically anyway.

Fix Description:
Check if role is "consumer" or "hub" and if so deny option to set the ReplicaID

relates: 389ds#5848

Author: Gilbert Kimetto

Reviewed by: Simon Pichugi
kimettog added a commit to kimettog/389-ds-base that referenced this issue Aug 3, 2023
…consumer roles

Bug Description:

dsconf accepts the "replica-id" option when setting a hub or a consumer.
The replica configuration entry is correctly created ( replicaID is set to 65535 ).
we should  prevent users setting the replicaID for hub and consumer roles because the value is set automatically anyway.

Fix Description:
Check if role is "consumer" or "hub" and if so deny option to set the ReplicaID

relates: 389ds#5848

Author: Gilbert Kimetto

Reviewed by: Simon Pichugi
droideck pushed a commit that referenced this issue Aug 7, 2023
…consumer roles (#5849)

Bug Description: dsconf accepts the "replica-id" option when setting a hub or a consumer.
The replica configuration entry is correctly created ( replicaID is set to 65535 ).
we should  prevent users setting the replicaID for hub and consumer roles because
the value is set automatically anyway.

Fix Description: Check if role is "consumer" or "hub" and if so deny option to set the ReplicaID.
Add tests.

Fixes: #5848

Author: Gilbert Kimetto

Reviewed by: Simon Pichugin
droideck pushed a commit that referenced this issue Aug 7, 2023
…consumer roles (#5849)

Bug Description: dsconf accepts the "replica-id" option when setting a hub or a consumer.
The replica configuration entry is correctly created ( replicaID is set to 65535 ).
we should  prevent users setting the replicaID for hub and consumer roles because
the value is set automatically anyway.

Fix Description: Check if role is "consumer" or "hub" and if so deny option to set the ReplicaID.
Add tests.

Fixes: #5848

Author: Gilbert Kimetto

Reviewed by: Simon Pichugin
droideck pushed a commit that referenced this issue Aug 7, 2023
…consumer roles (#5849)

Bug Description: dsconf accepts the "replica-id" option when setting a hub or a consumer.
The replica configuration entry is correctly created ( replicaID is set to 65535 ).
we should  prevent users setting the replicaID for hub and consumer roles because
the value is set automatically anyway.

Fix Description: Check if role is "consumer" or "hub" and if so deny option to set the ReplicaID.
Add tests.

Fixes: #5848

Author: Gilbert Kimetto

Reviewed by: Simon Pichugin
droideck pushed a commit that referenced this issue Aug 7, 2023
…consumer roles (#5849)

Bug Description: dsconf accepts the "replica-id" option when setting a hub or a consumer.
The replica configuration entry is correctly created ( replicaID is set to 65535 ).
we should  prevent users setting the replicaID for hub and consumer roles because
the value is set automatically anyway.

Fix Description: Check if role is "consumer" or "hub" and if so deny option to set the ReplicaID.
Add tests.

Fixes: #5848

Author: Gilbert Kimetto

Reviewed by: Simon Pichugin
droideck pushed a commit that referenced this issue Aug 7, 2023
…consumer roles (#5849)

Bug Description: dsconf accepts the "replica-id" option when setting a hub or a consumer.
The replica configuration entry is correctly created ( replicaID is set to 65535 ).
we should  prevent users setting the replicaID for hub and consumer roles because
the value is set automatically anyway.

Fix Description: Check if role is "consumer" or "hub" and if so deny option to set the ReplicaID.
Add tests.

Fixes: #5848

Author: Gilbert Kimetto

Reviewed by: Simon Pichugin
@droideck
Copy link
Member

droideck commented Aug 7, 2023

ccff99d..4cfea0c 389-ds-base-1.4.3 -> 389-ds-base-1.4.3
68b3c59..2568c54 389-ds-base-2.0 -> 389-ds-base-2.0
561d80e..a00bbca 389-ds-base-2.1 -> 389-ds-base-2.1
efe7385..a042329 389-ds-base-2.2 -> 389-ds-base-2.2
f08d15a..434d63e 389-ds-base-2.3 -> 389-ds-base-2.3

droideck added a commit to droideck/389-ds-base that referenced this issue Aug 30, 2023
Description: Add a "positive" test for the issue and fix condition
to make sure that 65535 and no --replica-id are correctly accepted.

Related: 389ds#5848

Reviewed by: ?
droideck added a commit to droideck/389-ds-base that referenced this issue Aug 30, 2023
Description: Add a "positive" test for the issue and fix condition
to make sure that 65535 and no --replica-id are correctly accepted.

Related: 389ds#5848

Reviewed by: ?
droideck added a commit that referenced this issue Aug 31, 2023
Description: Add a "positive" test for the issue and fix the condition
to make sure that 65535 and no --replica-id are correctly accepted.

Related: #5848

Reviewed by: @mreynolds389 @tbordaz (Thanks!)
droideck added a commit that referenced this issue Aug 31, 2023
Description: Add a "positive" test for the issue and fix the condition
to make sure that 65535 and no --replica-id are correctly accepted.

Related: #5848

Reviewed by: @mreynolds389 @tbordaz (Thanks!)
droideck added a commit that referenced this issue Aug 31, 2023
Description: Add a "positive" test for the issue and fix the condition
to make sure that 65535 and no --replica-id are correctly accepted.

Related: #5848

Reviewed by: @mreynolds389 @tbordaz (Thanks!)
droideck added a commit that referenced this issue Aug 31, 2023
Description: Add a "positive" test for the issue and fix the condition
to make sure that 65535 and no --replica-id are correctly accepted.

Related: #5848

Reviewed by: @mreynolds389 @tbordaz (Thanks!)
droideck added a commit that referenced this issue Aug 31, 2023
Description: Add a "positive" test for the issue and fix the condition
to make sure that 65535 and no --replica-id are correctly accepted.

Related: #5848

Reviewed by: @mreynolds389 @tbordaz (Thanks!)
droideck added a commit that referenced this issue Aug 31, 2023
Description: Add a "positive" test for the issue and fix the condition
to make sure that 65535 and no --replica-id are correctly accepted.

Related: #5848

Reviewed by: @mreynolds389 @tbordaz (Thanks!)
@droideck
Copy link
Member

837b47d..c9131d6 389-ds-base-1.4.3 -> 389-ds-base-1.4.3
faa725f..8787f73 389-ds-base-2.0 -> 389-ds-base-2.0
5584ef6..0fe1082 389-ds-base-2.1 -> 389-ds-base-2.1
4fee296..9c75a6c 389-ds-base-2.2 -> 389-ds-base-2.2
f1b891f..8b4b830 389-ds-base-2.3 -> 389-ds-base-2.3

droideck added a commit to droideck/389-ds-base that referenced this issue Aug 31, 2023
Description: Add a "positive" test for the issue and fix the condition
to make sure that 65535 and no --replica-id are correctly accepted.

Related: 389ds#5848

Reviewed by: @mreynolds389 @tbordaz (Thanks!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage The issue will be triaged during scrum
Projects
None yet
Development

No branches or pull requests

2 participants