diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-12 02:52:00 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-12 02:52:00 +0000 |
| commit | 6c14cccf7dca02821daed90c9457ee67ffec429f (patch) | |
| tree | 7430ed3ce69a26ee779ff79870e4f8fc4606598e /configure.in | |
| parent | f4344f827925f87b2b57fd28469416445ce2547c (diff) | |
| download | ruby-6c14cccf7dca02821daed90c9457ee67ffec429f.tar.gz ruby-6c14cccf7dca02821daed90c9457ee67ffec429f.tar.xz ruby-6c14cccf7dca02821daed90c9457ee67ffec429f.zip | |
* configure.in (rb_cv_broken_crypt): needs more checks.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
| -rw-r--r-- | configure.in | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/configure.in b/configure.in index a2a7c594e..c0b2d62f2 100644 --- a/configure.in +++ b/configure.in @@ -769,12 +769,25 @@ when(darwin*) RUBY_PREPEND_OPTION(LIBS, -lobjc) #include <stdio.h> #include <unistd.h> #include <string.h> + int main() { - char buf[256]; - strcpy(buf, crypt("", "\xE0\xA0")); - return strcmp(buf, crypt("", "\xE0\xA0")); + int i; + for (i = 0; i < 128*128; i++) { + char salt[2], buf[256], *s; + salt[0] = 0x80 | (i & 0x7f); + salt[1] = 0x80 | (i >> 7); + strcpy(buf, crypt("", salt)); + if (strcmp(buf, s = crypt("", salt))) { +#if 0 + printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1], + buf+2, s+2); +#endif + return 1; + } + } + return 0; } ], rb_cv_broken_crypt=no, |
