git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] contrib: add a credential helper for Mac OS X's keychain

From
Jay Soffian <jaysoffian@gmail.com>
Date
Sep 14, 2011, 13:31 UTC
Message-ID
<CAG+J_Dw-vf7FtyT-vPpj-LHBo0rCBJi39bHh=8vWjc52QBMM2A@mail.gmail.com>
In-Reply-To
<CAEBDL5UprYM0=SgNQrsY8_aCGf+pxKc1NP0AFjJy8igzt3vDZQ@mail.gmail.com>
On Wed, Sep 14, 2011 at 4:01 AM, John Szakmeister <john@szakmeister.net> wrote:
Show 20 quoted lines
>> +def add_internet_password(protocol, hostname, username, password):
>> +    # We do this over a pipe so that we can provide the password more
>> +    # securely than as an argument which would show up in ps output.
>> +    # Unfortunately this is possibly less robust since the security man
>> +    # page does not document how to quote arguments. Emprically it seems
>> +    # that using the double-quote, escaping \ and " works properly.
>
> I'm not sure this comment is correct... it looks like you're passing
> the password on the command line...
>
>> +    username = username.replace('\\', '\\\\').replace('"', '\\"')
>> +    password = password.replace('\\', '\\\\').replace('"', '\\"')
>> +    command = ' '.join([
>> +        'add-internet-password', '-U',
>> +        '-r', protocol,
>> +        '-s', hostname,
>> +        '-a "%s"' % username,
>> +        '-w "%s"' % password,
>
> ...right here. :-(

Nope, you snipped out too much context. That command is turned into a string and then sent to /usr/bin/security on its stdin. It is absolutely not passed on the command-line.

j.
Previous: John SzakmeisterNext: John Szakmeister
Message 3 of 5 in “contrib: add a credential helper for Mac OS X's keychain”
  1. contrib: add a credential helper for Mac OS X's keychainJay Soffian, Sep 10, 2011
  2. John SzakmeisterSep 14, 2011
  3. Jay SoffianSep 14, 2011
  4. John SzakmeisterSep 14, 2011
  5. John SzakmeisterSep 14, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.