From: Erik Faye-Lund <kusmabite@gmail.com>
To: Rafael Gieschke <rafael@gieschke.de>
Cc: Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] compat: add a getpass() compatibility function
Date: Thu, 19 May 2011 23:16:48 +0200 [thread overview]
Message-ID: <BANLkTingSqEM5=4=rLq7Yu1x9YXstiSsNw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTimG8E_Riz3rYC9PMw_2-D=Za0Ar6w@mail.gmail.com>
On Thu, May 19, 2011 at 10:12 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:
> On Thu, May 19, 2011 at 9:42 PM, Rafael Gieschke <rafael@gieschke.de> wrote:
>>
>> Am 19.05.2011 um 21:19 schrieb Erik Faye-Lund:
>>
>>> On Thu, May 19, 2011 at 9:16 PM, Rafael Gieschke <rafael@gieschke.de> wrote:
>>>>
>>>> Am 19.05.2011 um 20:07 schrieb Erik Faye-Lund:
>>>>> diff --git a/compat/mingw.h b/compat/mingw.h
>>>>> index 62eccd3..e37d557 100644
>>>>> --- a/compat/mingw.h
>>>>> +++ b/compat/mingw.h
>>>>> @@ -48,6 +48,8 @@ typedef int socklen_t;
>>>>> #define EAFNOSUPPORT WSAEAFNOSUPPORT
>>>>> #define ECONNABORTED WSAECONNABORTED
>>>>>
>>>>> +#define PASS_MAX 512
>>>>> +
>>>>
>>>> It might be worth to have this in git-compat-util.h, so it can also be used by compat/getpass.c. I'm not sure about the name, however; it's a remote password and MAX_PASS is about local passwords AFAIK. Maybe PASS_MAX_REMOTE or something similiar. Like that, compat/getpass.c could also be used in case MAX_PASS has some insanely low value on a platform.
>>>>
>>>>
>>>
>>> PASS_MAX should be defined in limits.h (which is included by
>>> git-compat-util.h) on POSIX platforms:
>>> http://pubs.opengroup.org/onlinepubs/007908799/xsh/limits.h.html
>>>
>>> If it turns out it's not on some platforms, perhaps a define-guarded
>>> version would make sense in git-compat-util.h instead.
>>
>> It is defined even on Android :-).
>>
>
> Good to hear.
>
>> But I still wonder whether it's the right thing or if you should use it only for local passwords.
>>
>> If you imagine a platform with MAX_PASS=8, git couldn't connect to an IMAP server with a password of 10 chars on this platform without any proper reason.
>>
>
> Well, those platforms would currently fail, since that's the limit on
> the string returned from getpass. Since that hasn't happened yet, I
> suspect that this is a very theoretical problem.
>
> If we created our own define we could fix such problems by setting
> NO_GETPASS and having a reasonable lengthy GIT_MAX_PASS. But let's
> leave that theoretical fix for when/if it turns out to be real, huh?
>
Whoa: http://www.opengroup.org/csq/view.mhtml?norationale=1&noreferences=1&RID=sun%2FSE2%2F10
It seems that Solaris has a MAX_PASS of 8... That should mean that
prompted passwords can't be above 8 characters there (without using
GIT_ASKPASS). Can this really be the case?
next prev parent reply other threads:[~2011-05-19 21:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-19 11:37 [PATCH] compat: add a getpass() compatibility function Rafael Gieschke
2011-05-19 12:17 ` Erik Faye-Lund
2011-05-19 16:30 ` Junio C Hamano
2011-05-19 17:01 ` Rafael Gieschke
2011-05-19 17:27 ` Junio C Hamano
2011-05-19 18:07 ` Erik Faye-Lund
2011-05-19 19:16 ` Rafael Gieschke
2011-05-19 19:19 ` Erik Faye-Lund
2011-05-19 19:42 ` Rafael Gieschke
2011-05-19 20:12 ` Erik Faye-Lund
2011-05-19 21:16 ` Erik Faye-Lund [this message]
2011-05-20 10:06 ` Rafael Gieschke
2011-05-20 10:48 ` Erik Faye-Lund
2011-05-20 17:18 ` Junio C Hamano
2011-05-20 17:26 ` Erik Faye-Lund
2011-05-19 12:21 ` Erik Faye-Lund
2011-05-19 15:14 ` Jonathan Nieder
2011-05-19 15:29 ` Erik Faye-Lund
2011-05-19 17:17 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTingSqEM5=4=rLq7Yu1x9YXstiSsNw@mail.gmail.com' \
--to=kusmabite@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=rafael@gieschke.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).