Bug 2334 - [patch] pgsql passdb case sensitive for machine accounts
[patch] pgsql passdb case sensitive for machine accounts
Status: RESOLVED WONTFIX
Product: Samba 3.0
Classification: Unclassified
Component: pdb_sql
3.0.11
All All
: P3 normal
: none
Assigned To: pdb_sql maintainers mail alias
Samba QA Contact
:
: 1996 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-02-11 10:27 UTC by Fernando Schapachnik
Modified: 2006-02-10 08:42 UTC (History)
2 users (show)

See Also:


Attachments
Lowercases username before DB lookup. (905 bytes, patch)
2005-02-11 10:28 UTC, Fernando Schapachnik
no flags Details
Trigger to lowercase usernames on insert/update. (325 bytes, text/plain)
2005-05-02 06:15 UTC, Fernando Schapachnik
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fernando Schapachnik 2005-02-11 10:27:54 UTC
Using the pgsql passdb, the lookups for machine accounts are case sensitive (a
mere string equal comparison). This looks like a regression on previous behavior.

The attached patch solves this by lowercasing the account previous to a lookup.

We would like the patch to be incorporated into the tree, so if any change is
required for that, please let me know.

Thanks & kind regards.

Fernando.
Comment 1 Fernando Schapachnik 2005-02-11 10:28:45 UTC
Created attachment 963 [details]
Lowercases username before DB lookup.
Comment 2 Jelmer Vernooij 2005-03-10 15:22:24 UTC
How does this patch make sure that current names in the database are already
lowercase? 
Comment 3 Jelmer Vernooij 2005-03-10 15:52:36 UTC
*** Bug 1996 has been marked as a duplicate of this bug. ***
Comment 4 Fernando Schapachnik 2005-03-11 06:07:31 UTC
(In reply to comment #2)
> How does this patch make sure that current names in the database are already
> lowercase? 

I doesn't. Maybe it should be documented or a constraint added to the schema
(something like username=lower(username))?
Comment 5 Jelmer Vernooij 2005-04-30 08:09:52 UTC
Samba will attempt to add non-lowercased names so a constraint wouldn't work...
Comment 6 Fernando Schapachnik 2005-05-02 06:14:31 UTC
(In reply to comment #5)
> Samba will attempt to add non-lowercased names so a constraint wouldn't work...

A trigger then (doing it in the database is good in this case because it
provides consistency independently of the input method. Ie, somebody can have
their own tool to populate the DB).
Comment 7 Fernando Schapachnik 2005-05-02 06:15:59 UTC
Created attachment 1201 [details]
Trigger to lowercase usernames on insert/update.
Comment 8 Jelmer Vernooij 2005-09-23 11:17:27 UTC
The experimental pdb modules (pdb_mysql, pdb_pgsql and pdb_xml) have 
been a bit neglected during the last few releases of Samba 3 as they 
haven't been actively maintained. I was the original author and 
maintainer, but I no longer work on Samba 3 and I no longer use any of 
the modules in production. I was hoping I could nonetheless keep the code 
working for those that still use it, but this turned out to be harder then I 
expected. 
 
I'll remove these modules unless somebody steps up as a maintainer. If 
there's anyone willing to take over maintainance of either one of 
these modules, please let me know. Otherwise, I'll put the modules up 
on my samba.org homepage as a separate tarball for those interested 
(including some of the patches that have been published). 
Comment 9 Gerald (Jerry) Carter 2006-02-10 08:42:03 UTC
See bug 3375.  If someone wants to maintain these modules outside
the Samba source tree, that is fine.  But the source has been removed
from the upcoming 3.0.22 release.