Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1630187

Summary: [RFE] adcli join should preserve SPN added by adcli preset-computer
Product: Red Hat Enterprise Linux 7 Reporter: Petr Čech <pcech>
Component: adcliAssignee: Sumit Bose <sbose>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: dpal, lslebodn, pcech, sgoveas
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: adcli-0.8.1-9.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 13:11:03 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 Petr Čech 2018-09-18 07:29:55 UTC
Description of problem:


Version-Release number of selected component (if applicable):
adcli-0.8.1-6.el7


How reproducible:
Firstly, preset computer with option --service-name, then do adcli join.

Steps to Reproduce:
1. adcli preset-computer --service-name abc
2. adcli join
3. check, if spn abc is still present

Actual results:
adcli join rewrite all preset SPNs

Expected results:
adcli join preserve preset SPNs

Additional info:
There is a workaround:
1. adcli preset-computer --service-name abc
2. adcli join --service-name abc

Comment 6 Sumit Bose 2019-04-15 08:38:37 UTC
*** Bug 1693092 has been marked as a duplicate of this bug. ***

Comment 8 Lukas Slebodnik 2019-04-15 20:06:26 UTC
(In reply to Sumit Bose from comment #7)
> Additionally
> 
>  -
> https://gitlab.freedesktop.org/realmd/adcli/commit/
> a64cce9830c2e9c26e120f671b247ee71b45c888
> 
> is needed.

Return value of strdup is check on many places in  library/adenroll.c
e.g. https://gitlab.freedesktop.org/realmd/adcli/blob/master/library/adenroll.c#L1554

Is there any reason why it was not checked in commit a64cce9830c2e9c ?

Comment 9 Sumit Bose 2019-04-16 07:54:13 UTC
Hi Lukas,

thank you for the comment. _adcli_strv_add_unique() call _adcli_strv_add() which does the NULL check and returns the unmodified list in this case. Using strdup() in the argument list of _adcli_strv_add() is a typical pattern in the current adcli code and so I used it here as well.

I think the question is if the NULL should be treated as an error or if it should be ignored and processing should continue. You know that in SSSD I typically tend to error out as soon as possible but I think adcli has a different philosophy here. Given that I might not always pick the right choice and while looking at your example I wonder if it might be more consistent to ignore the NULL in load_keytab_entry() for the service principals as well?

Btw, are you interested in doing code reviews for adcli and/or realmd? If yes, please let me know on which terms.

bye,
Sumit

Comment 13 errata-xmlrpc 2019-08-06 13:11:03 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, 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/RHEA-2019:2256