<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>153487</bug_id>
          
          <creation_ts>2006-10-30 15:43 0000</creation_ts>
          <short_desc>app-crypt/rainbowcrack default charset.txt file path in code</short_desc>
          <delta_ts>2006-11-01 11:26:30 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Unspecified</component>
          <version>2006.1</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>rogerw@gmail.com</reporter>
          <assigned_to>dragonheart@gentoo.org</assigned_to>
          <cc>crypto@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>rogerw@gmail.com</who>
            <bug_when>2006-10-30 15:43:34 0000</bug_when>
            <thetext>rainbowcrack, a password hash algorithm, has no default charset.txt path in its code.  In Gentoo, the charset.txt file gets installed to /usr/share/rainbowcrack/charset.txt, but this file is never (automatically) chosen - it fails if one is not found in the local path (i.e. where the code is executed from).  While this is normal for most uses of the program, it is somewhat expected  that programs will try and use a set of &quot;Defaults&quot; especially when first running a program and before customizations begin.  

Some uses might not even require this patch - but it would help usability, in general.

I&apos;m sure there is a standard way to patch this, but here&apos;s the patch I came up with that makes it work (tm) :).

Please respond with patch format questions, mainly because I&apos;d like to fix the patch even if its not accepted into Gentoo, to know how to do it in the future.

-Roger Ward


-- 
rainbowcrack-1.2-src-charsetpath.patch
--
diff -rU9 rainbowcrack-1.2-src/src/ChainWalkContext.cpp rainbowcrack-1.2-src.orig/src/ChainWalkContext.cpp
--- rainbowcrack-1.2-src/src/ChainWalkContext.cpp	2006-10-30 18:39:55.000000000 -0500
+++ rainbowcrack-1.2-src.orig/src/ChainWalkContext.cpp	2003-11-23 00:33:44.000000000 -0500
@@ -52,25 +52,19 @@
 		for (i = 0x00; i &lt;= 0xff; i++)

 			m_PlainCharset[i] = i;

 		m_nPlainCharsetLen = 256;

 		m_sPlainCharsetName = sName;

 		m_sPlainCharsetContent = &quot;0x00, 0x01, ... 0xff&quot;;

 		return true;

 	}

 

 	vector&lt;string&gt; vLine;

-	if (!ReadLinesFromFile(&quot;charset.txt&quot;, vLine))

-	{

-		ReadLinesFromFile(&quot;/usr/share/rainbowcrack/charset.txt&quot;, vLine);

-		if  (vLine.size()&gt;0)

-			printf(&quot;Read charset.txt from default /usr/share/rainbowcrack/\n&quot;);

-	}

-	if (vLine.size()&gt;0)

+	if (ReadLinesFromFile(&quot;charset.txt&quot;, vLine))

 	{

 		int i;

 		for (i = 0; i &lt; vLine.size(); i++)

 		{

 			// Filter comment

 			if (vLine[i][0] == &apos;#&apos;)

 				continue;

 

 			vector&lt;string&gt; vPart;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rogerw@gmail.com</who>
            <bug_when>2006-10-30 15:46:55 0000</bug_when>
            <thetext>Created an attachment (id=100834)
Patch to hardcode the default path of charset.txt as an *alternative* into rtgen and rtdump

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>alonbl@gentoo.org</who>
            <bug_when>2006-11-01 11:26:30 0000</bug_when>
            <thetext>Thanks!
Added rainbowcrack-1.2-r1.
Fixed somewhat differently, please check it out.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>100834</attachid>
            <date>2006-10-30 15:46 0000</date>
            <desc>Patch to hardcode the default path of charset.txt as an *alternative* into rtgen and rtdump</desc>
            <filename>rainbowcrack-1.2-src-charsetpatch.patch</filename>
            <type>text/plain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