Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle spaces in user names? #53

Open
jtpereyda opened this issue Oct 1, 2015 · 4 comments
Open

How to handle spaces in user names? #53

jtpereyda opened this issue Oct 1, 2015 · 4 comments

Comments

@jtpereyda
Copy link
Contributor

I don't know why my location's LDAP server is giving me user names with spaces, but it causes the update command to fail (at least the first time). Sample debug output (names tweaked for privacy):

DEBUG:NssDbShadowHandler:missing: set(['.Rose Rosey', '.Proj Trainer', '.Jim Knuth', '.Jerry Demo', '.Main Supervisors'])

On the error

  • The temp file contents do include strings like ^U^@^ARose Rosey:*:::::::0^@^E^@^A01115^V^@^A, so it's not being read back properly.
  • The cache keys, read back for verification, include items like .Rose and .Proj, with the second half truncated.

Wait a minute

Unix shortnames can't include spaces anyway, right?

Proposed Solutions:

  1. Ignore names with spaces on verification step.
  2. Ignore names with spaces on Write step.

Suggestions welcome. 2 seems like the right thing to do to me.

More error text

DEBUG:NssDbShadowHandler:Map contains 4982 elems
DEBUG:NssDbShadowHandler:executing makedb: /usr/bin/makedb - /var/lib/misc/nsscache-cache-file-qTfB8O
DEBUG:NssDbShadowHandler:4982 entries written, 4982 keys
DEBUG:NssDbShadowHandler:verification started /var/lib/misc/nsscache-cache-file-qTfB8O
DEBUG:NssDbShadowHandler:4982 written keys, 9964 cache keys
WARNING:NssDbShadowHandler:verify failed: written keys missing from the on-disk cache!
DEBUG:NssDbShadowHandler:missing: set(['.Rose Rosey', '.Proj Trainer', '.Jim Knuth', '.Jerry Demo', '.Main Supervisors'])
DEBUG:NssDbShadowHandler:rolling back, (not) deleting temp cache file '/var/lib/misc/nsscache-cache-file-qTfB8O'
WARNING:NssDbShadowHandler:verification failed, exiting
@jtpereyda jtpereyda reopened this Oct 1, 2015
@jaqx0r
Copy link
Contributor

jaqx0r commented Oct 1, 2015

Does the cn or uid field hold spaces on the server? I.e. does an ldapsearch
give you the same results?

On Fri, 2 Oct 2015, 07:53 Joshua Pereyda [email protected] wrote:

Reopened #53 #53.


Reply to this email directly or view it on GitHub
#53 (comment).

@jtpereyda
Copy link
Contributor Author

Yes, here's a sample from ldapsearch (again filtered for privacy):

# Proj Trainer, Users, my.example.com
dn: CN=Proj Trainer,CN=Users,DC=my,DC=example,DC=com

I think this is because I'm talking to an Active Directory server. I've hit a lot of bumps but I've almost got it working.

@jtpereyda
Copy link
Contributor Author

FYI the ignore names on write workaround seems to work fine. I haven't gotten all the other bugs worked out yet, but I can submit a patch. I imagine other LDAP systems have a convention for this situation, though.

@jaqx0r
Copy link
Contributor

jaqx0r commented Apr 22, 2018

We could add a command to choose to either ignore names with whitespace, or apply a transformation function.

@jaqx0r jaqx0r closed this as completed Apr 22, 2018
@jaqx0r jaqx0r reopened this Apr 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants