Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2147388

Summary: CLI and UI should reject trying to index a virtual attribute
Product: Red Hat Directory Server Reporter: mreynolds
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: LDAP QA Team <idm-ds-qe-bugs>
Severity: unspecified Docs Contact: Zuzana Zoubkova <zzoubkov>
Priority: high    
Version: 12.2CC: bsmejkal, emartyny, idm-ds-dev-bugs, pasik, tbordaz, vashirov
Target Milestone: DS12.2Keywords: TestCaseProvided, Triaged
Target Release: dirsrv-12.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: redhat-ds-12-9020020230124183402-1674d574 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-30 09:40:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mreynolds 2022-11-23 21:20:23 UTC
Description of problem:

Indexing a virtual attribute will break how the virtual attribute actually works.  The CLI and UI should reject any attempt to index a virtual attribute.

Comment 1 Viktor Ashirov 2023-02-09 16:33:41 UTC
# pytest -v dirsrvtests/tests/suites/indexes/regression_test.py::test_reject_virtual_attr_for_indexing
============================================================= test session starts =============================================================
platform linux -- Python 3.9.16, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
389-ds-base: 2.2.6-1.module+el9dsrv+17949+63c5b04e
nss: 3.79.0-14.el9_0
nspr: 4.34.0-14.el9_0
openldap: 2.6.2-3.el9
cyrus-sasl: not installed
FIPS: disabled
rootdir: /root/ds/dirsrvtests, configfile: pytest.ini
collected 1 item

dirsrvtests/tests/suites/indexes/regression_test.py::test_reject_virtual_attr_for_indexing PASSED                                       [100%]

======================================================= 1 passed, 2 warnings in 33.04s ========================================================


Both CLI and UI reject virtual attribute with an error:
# dsconf standalone1 backend index add --attr nsrole --index-type eq userRoot
Error: You should not index a virtual attribute (nsrole)

Marking as Verified:Tested

Comment 5 errata-xmlrpc 2023-05-30 09:40:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (redhat-ds:12 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:3344