Bug 712448

Summary: Yast-kerberos-client works wring with DNS kerberos config
Product: [openSUSE] openSUSE 11.4 Reporter: Pavel Baranchikov <pavel>
Component: YaST2Assignee: Jiří Suchomel <jsuchome>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: mvidner
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 11.4   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: patch for /usr/share/YaST2/modules/Kerberos.ycp
y2log after executing yast2 kerberos-client

Description Pavel Baranchikov 2011-08-16 14:33:15 UTC
User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0

We are using DNS Kerberos configuration.

_kerberos._tcp.domain.com. 172800 IN SRV 0 20 88 notitiae.domain.com.
_kerberos._tcp.domain.com. 172800 IN SRV 0 10 88 aranei.domain.com.

Using Yast2 I select to use Kerberos and check the box "use DNS to configure Kerberos". As a result, I have a grayed-out KDC server value "aranei.domain.com.0" instead of "aranei.domain.com:88"

Reproducible: Always

Steps to Reproduce:
1. Configure Kerberos using DNS
2. Use yast-kerberos-client
3. Try to use DNS configuration option
Actual Results:  
I cannot save the Kerberos configuration, using DNS to retrieve server's address.

Expected Results:  
This should save krb5.conf file with options dns_lookup_kdc = true and dns_lookup_realm = true. Without some domain-specific configurations.
Comment 1 Jiří Suchomel 2011-08-26 08:03:07 UTC
What do these commands show:

dig TXT _kerberos.%1 +short
dig SRV _kerberos._udp.%1 +short


(where %1 is your default domain)?
Comment 2 Pavel Baranchikov 2011-08-27 07:13:21 UTC
pavel@pbaranchikov:~> dig TXT _kerberos.domain.com +short
"DOMAIN.COM"
pavel@pbaranchikov:~> dig SRV _kerberos._udp.domain.com +short
0 20 88 notitiae.domain.com.
0 10 88 aranei.domain.com.
Comment 3 Jiří Suchomel 2011-08-29 12:52:03 UTC
Created attachment 448190 [details]
patch for /usr/share/YaST2/modules/Kerberos.ycp

I see, I did not expect more lines in the output.

Please try to patch your  /usr/share/YaST2/modules/Kerberos.ycp with this patch ('patch /usr/share/YaST2/modules/Kerberos.ycp < patch_from_here'), than call 'ycpc -c /usr/share/YaST2/modules/Kerberos.ycp' and try again.
Comment 4 Pavel Baranchikov 2011-08-29 13:52:33 UTC
For now, my "use DNS to configure Kerberos" checkbox is disabled for both original Kerberos.ycp and patched. Maybe, it is due to existing config file? Is there a way to reset config file to YAST-compatible format.

On other computer, patch did the job and wrote the correct /etc/krb5.conf file.
Comment 5 Jiří Suchomel 2011-08-30 13:59:43 UTC
(In reply to comment #4)
> For now, my "use DNS to configure Kerberos" checkbox is disabled for both
> original Kerberos.ycp and patched. Maybe, it is due to existing config file? Is
> there a way to reset config file to YAST-compatible format.

Yes, if kdc and/or realm is found in krb config file, DNS is not offered as an option.

Try to backup your krb5.conf, than delete from it data specific to your realm and try again.
Comment 6 Pavel Baranchikov 2011-08-31 07:46:11 UTC
I have deleted all the contents of the /etc/krb5.conf, so it became empty file. "Use DNS" is not active. I have cleaned krb5.conf from my domain info:

pbaranchikov:/etc # cat /etc/krb5.conf
[libdefaults]
        clockskew = 300

[realms]
#       EXAMPLE.COM = {
#                kdc = kerberos.example.com
#               admin_server = kerberos.example.com
#       }

[logging]
        kdc = FILE:/var/log/krb5/krb5kdc.log
        admin_server = FILE:/var/log/krb5/kadmind.log
        default = SYSLOG:NOTICE:DAEMON
[appdefaults]
pam = {
        ticket_lifetime = 1d
        renew_lifetime = 1d
        forwardable = true
        proxiable = false
        minimum_uid = 1
        clockskew = 300
        external = sshd                                                                                                                     
        use_shmem = sshd                                                                                                                   
}                                                                                                                                           
pbaranchikov:/etc #

"Use DNS" checkbox left unavailable.

Would you please add a button to rewrite the system krb5.conf file contents?
Comment 7 Jiří Suchomel 2011-08-31 08:11:27 UTC
This is strange. Could  you please attach y2log files, after you run yast2 kerberos-client with the above krb5.conf?

It would be better with verbose logging, start:

'Y2DEBUG=ALL yast2 kerberos-client'
Comment 8 Pavel Baranchikov 2011-08-31 11:41:49 UTC
Created attachment 448641 [details]
y2log after executing yast2 kerberos-client
Comment 9 Jiří Suchomel 2011-08-31 13:36:54 UTC
Looks like 'dig TXT _kerberos.aleatis +short' did not return anything, so YaST evaluated it as DNS info is not available.

Is the dig output different on other machine?
Comment 10 Pavel Baranchikov 2011-08-31 13:50:13 UTC
No, other machine does the same.

Full kerberos (and DNS) domain name is ryazan.aleatis.lan
Comment 11 Jiří Suchomel 2011-08-31 14:39:53 UTC
You wrote in comment 4 that for the other machine, DNS is detected correctly, right?

So what does 'dig TXT _kerberos.aleatis +short' return on both of your machines?

And,

(In reply to comment #10)
> Full kerberos (and DNS) domain name is ryazan.aleatis.lan

but hostname --fqdn reports 'pbaranchikov.aleatis'
Comment 12 Pavel Baranchikov 2011-09-02 07:51:52 UTC
I do not understand all the mechanisms of the determining the fqdn, but with the config, mentioned in comment #6, the real kerberos realm is discovered correctly, with the domain name, gathered from the DHCP. Maybe, they use /etc/resolv.conf instead of hostname --fqdn?
Comment 13 Jiří Suchomel 2011-09-02 09:25:49 UTC
hostname --fqdn reports 'pbaranchikov.aleatis'

but you say that DNS domain name is ryazan.aleatis.lan

Because of this setup, Kerberos cannot properly find KDC. Martin, any idea what's the problem with network setup?
Comment 14 Martin Vidner 2011-09-02 11:22:07 UTC
Possibly a wrong entry in /etc/hosts. WebYaST did that wrong (bnc#694283#c8)
Comment 15 Jiří Suchomel 2011-09-02 14:09:27 UTC
Well, to me it seems that your network config is somehow broken. If YaST caused it, please file a new bug report against network configuration.

This one, regarding detecting Kerberos DNS config, is IMHO fixed by patch from comment 3, assuming correct network config.
Comment 16 Bernhard Wiedemann 2011-09-02 15:00:16 UTC
This is an autogenerated message for OBS integration:
This bug (712448) was mentioned in
https://build.opensuse.org/request/show/80687 Factory / yast2-kerberos-client