Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 153487 - app-crypt/rainbowcrack default charset.txt file path in code
Summary: app-crypt/rainbowcrack default charset.txt file path in code
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Daniel Black (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-30 15:43 UTC by Roger Ward
Modified: 2006-11-01 11:26 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to hardcode the default path of charset.txt as an *alternative* into rtgen and rtdump (rainbowcrack-1.2-src-charsetpatch.patch,989 bytes, patch)
2006-10-30 15:46 UTC, Roger Ward
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Ward 2006-10-30 15:43:34 UTC
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 "Defaults" 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'm sure there is a standard way to patch this, but here's the patch I came up with that makes it work (tm) :).

Please respond with patch format questions, mainly because I'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 <= 0xff; i++)

 			m_PlainCharset[i] = i;

 		m_nPlainCharsetLen = 256;

 		m_sPlainCharsetName = sName;

 		m_sPlainCharsetContent = "0x00, 0x01, ... 0xff";

 		return true;

 	}

 

 	vector<string> vLine;

-	if (!ReadLinesFromFile("charset.txt", vLine))

-	{

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

-		if  (vLine.size()>0)

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

-	}

-	if (vLine.size()>0)

+	if (ReadLinesFromFile("charset.txt", vLine))

 	{

 		int i;

 		for (i = 0; i < vLine.size(); i++)

 		{

 			// Filter comment

 			if (vLine[i][0] == '#')

 				continue;

 

 			vector<string> vPart;
Comment 1 Roger Ward 2006-10-30 15:46:55 UTC
Created attachment 100834 [details, diff]
Patch to hardcode the default path of charset.txt as an *alternative* into rtgen and rtdump
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2006-11-01 11:26:30 UTC
Thanks!
Added rainbowcrack-1.2-r1.
Fixed somewhat differently, please check it out.