On Wed, Sep 14, 2011 at 4:01 AM, John Szakmeister <john@xxxxxxxxxxxxxxx> wrote: >> +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. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html