[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    RFC: KCmdLineArgs::obfuscateOption()
From:       Jarosław_Staniek <js () iidea ! pl>
Date:       2004-10-04 19:04:20
Message-ID: 200410042104.20347.js () iidea ! pl
[Download RAW message or body]


The proposal:
An enhancement for security in KDE apps: sometimes it's needed to obfuscate  
CL option value (replacing with "x" string), when it contain a password, to 
hide it from stealing using 'ps' command.

static void KCmdLineArgs::obfuscateOption(const char*)

would be usable to do that without playing with int argc, char **argv.

I've done this as follows (for password" option), 
but it could be easier with KCmdLineArgs:

	for (int i=1; i<(argc-1); i++) {
		if (qstrcmp("--password",argv[i])==0
		  || qstrcmp("-password",argv[i])==0)
		{
			QCString pwd(argv[i+1]);
			if (!pwd.isEmpty()) {
				pwd.fill(' ');
				pwd[0]='x';
				qstrcpy(argv[i+1], (const char*)pwd);
			}
			break;
		}
	}

-- 
regards / pozdrawiam,
  Jaroslaw Staniek / OpenOffice Polska
  Kexi Project: http://www.kexi-project.org, http://koffice.kde.org/kexi
  QT-KDE Wrapper Project: http://iidea.pl/~js/qkw
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic