Summary: | stdin-password dont seem to work. | ||
---|---|---|---|
Product: | realmd | Reporter: | steverweber |
Component: | adcli | Assignee: | Stef Walter <stefw> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | sbose, stefw |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
[PATCH] Remove \n from stdin password
[PATCH] Remove \n or \r\n from stdin password |
Description
steverweber
2014-05-08 17:12:20 UTC
You need to use 'echo -n | ....' Created attachment 123916 [details] [review] [PATCH] Remove \n from stdin password This patch removes a trailing new-line character from the password given via stdin, this should fix all typical command-libe use-case. Comment on attachment 123916 [details] [review] [PATCH] Remove \n from stdin password Review of attachment 123916 [details] [review]: ----------------------------------------------------------------- Are there no cases where \n is in a valid AD password? If so, this patch has no tradeoffs. Just double checking. ::: tools/tools.c @@ +250,5 @@ > > } else if (res == 0) { > buffer[offset] = '\0'; > + /* remove new line character */ > + if (offset > 0 && buffer[offset - 1] == '\n') { Should this remove \r\n? (In reply to Stef Walter from comment #3) > Comment on attachment 123916 [details] [review] [review] > [PATCH] Remove \n from stdin password > > Review of attachment 123916 [details] [review] [review]: > ----------------------------------------------------------------- > > Are there no cases where \n is in a valid AD password? If so, this patch has > no tradeoffs. Just double checking. According to https://msdn.microsoft.com/en-us/library/bb726984.aspx "Valid characters for passwords are letters, numbers, and symbols." > > ::: tools/tools.c > @@ +250,5 @@ > > > > } else if (res == 0) { > > buffer[offset] = '\0'; > > + /* remove new line character */ > > + if (offset > 0 && buffer[offset - 1] == '\n') { > > Should this remove \r\n? I'll add a check for \r\n as well although I doubt that we see this often with Unix/Linux shell usage. But if the password is stored in a file with \r\n linebreaks this will help. Created attachment 123942 [details] [review] [PATCH] Remove \n or \r\n from stdin password New version which can remove \r\n as well. Wonderful. Merged into master. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.