Bug 674164

Summary: sss_obfuscate fails if there's no domain named "default".
Product: Red Hat Enterprise Linux 6 Reporter: Gowrishankar Rajaiyan <grajaiya>
Component: sssdAssignee: Stephen Gallagher <sgallagh>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1CC: benl, dpal, grajaiya, jgalipea, kbanerje, prc
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sssd-1.5.1-5.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 11:38:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gowrishankar Rajaiyan 2011-01-31 20:16:59 UTC
Description of problem:
sss_obfuscate fails if there's no domain named "default". 

Version-Release number of selected component (if applicable):
sssd-1.5.1-3.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Configure sssd.conf for a single domain. (check additional info for relevant sssd.conf)
2. Make sure domain name is not "default".
3. Execute "sss_obfuscate" to obfuscate password.


Actual results:

# sss_obfuscate 
Enter password: 
Re-enter password: 
No such domain default

Expected results:
Should check if there exists only one domain and assume the existing one domain as default. 

Additional info:

Relevant section of sssd.conf 
[domain/LDAP]
ldap_tls_reqcert = demand
auth_provider = ldap
ldap_search_base = dc=example,dc=com
id_provider = ldap
ldap_tls_cacert = /etc/openldap/cacerts/cacert.asc
debug_level = 9
ldap_uri = ldaps://sssdldap.redhat.com:636
enumerate = True
cache_credentials = True
ldap_tls_cacertdir = /etc/openldap/cacerts

Comment 1 Stephen Gallagher 2011-01-31 20:29:54 UTC
I'd just like one clarification here. There are active domains and inactive domains in SSSD.

An active domain is one that is configured in [domain/DOMAINNAME] and is also specified in the domains= line in the [sssd] section. An inactive domain is one that is configured in [domain/DOMAINNAME] but is NOT listed in the domains= line.

Under which situation do we assume that one is the default. Should it be only if there is exactly one domain (active or inactive) specified in sssd.conf, or should it be if there is exactly one active domain specified in the [sssd] section?

Also, what error message would you like to see when if we try to update sssd.conf without specifying a domain and there are two domains in play. Perhaps "Unable to determine default domain, please use -d <domain>"?

Comment 5 Gowrishankar Rajaiyan 2011-02-01 13:42:33 UTC
I would suggest for e.g. if we have DOMAIN1 and DOMAIN2

case1: [domain/DOMAIN1]
- DOMAIN1 is default domain.

case 2: [domain/DOMAIN2] and DOMAIN1 is inactive
- DOMAIN2 is default domain.
 
case 3: [domain/DOMAIN1,DOMAIN2]
- "Unable to determine default domain, please use -d <domain>"

Comment 6 Stephen Gallagher 2011-02-01 13:47:49 UTC
(In reply to comment #5)
Just trying to make sure I have this right:

> I would suggest for e.g. if we have DOMAIN1 and DOMAIN2
> 
> case1: [domain/DOMAIN1]
> - DOMAIN1 is default domain.
> 

There is only one domain (active or inactive) named DOMAIN1. In this case it's the default.

> case 2: [domain/DOMAIN2] and DOMAIN1 is inactive
> - DOMAIN2 is default domain.
> 

Multiple domains are available in the config file, but only one is active. In this case, the active domain is the default.

> case 3: [domain/DOMAIN1,DOMAIN2]
> - "Unable to determine default domain, please use -d <domain>"

Two domains are active, so we should force a command-line option.



I'm beginning to think that this isn't going to be easy to explain to a user. Perhaps we should just drop the "default" domain completely and always mandate the use of -d <domain>. Would that be an acceptable move? It seems like that would be the least-ambiguous approach.

Comment 7 Jenny Severance 2011-02-01 13:59:23 UTC
I think that makes sense to just make -d option required.  Then there isn't any question.

Comment 10 Gowrishankar Rajaiyan 2011-03-21 06:59:57 UTC
sss_obfuscate command now always mandate the use of -d <domain>.


# sss_obfuscate -h
Usage: sss_obfuscate [options]

sss_obfuscate converts a given password into
human-unreadable format and places it into
appropriate domain section of the SSSD config
file. The password can be passed in by stdin,
specified on the command-line or entered
interactively

Options:
  -h, --help            show this help message and exit
  -s, --stdin           Read the password from stdin.
  -d DOMNAME, --domain=DOMNAME
                        The domain to use the password in (mandatory)
  -f FILE, --file=FILE  Set input file to FILE (default: Use system default,
                        usually /etc/sssd/sssd.conf)

[root@pogolinux-2 ~]# sss_obfuscate -s < /tmp/pwd.txt 
No domain specified


# rpm -qi sssd | head
Name        : sssd                         Relocations: (not relocatable)
Version     : 1.5.1                             Vendor: Red Hat, Inc.
Release     : 14.el6                        Build Date: Wed 09 Mar 2011 02:30:12 PM EST
Install Date: Mon 21 Mar 2011 01:14:19 AM EDT      Build Host: x86-009.build.bos.redhat.com
Group       : Applications/System           Source RPM: sssd-1.5.1-14.el6.src.rpm
Size        : 3418526                          License: GPLv3+
Signature   : RSA/8, Thu 10 Mar 2011 11:27:42 AM EST, Key ID 938a80caf21541eb
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://fedorahosted.org/sssd/
Summary     : System Security Services Daemon

Comment 11 errata-xmlrpc 2011-05-19 11:38:27 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0560.html

Comment 12 errata-xmlrpc 2011-05-19 13:09:23 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0560.html