
diff -r 9ff9cd2d677a -r c6688467d03c prototyp/prototyp.sql
--- a/prototyp/prototyp.sql	Mon Sep 01 22:47:19 2014 +0200
+++ b/prototyp/prototyp.sql	Tue Sep 02 00:06:04 2014 +0200
@@ -213,8 +213,17 @@
 	use strict;
 	use warnings;
 	
+	# There is a library…
 	# aptitude install libproc-processtable-perl
-	# TODO: use Proc::ProcessTable::Process;
+	# use Proc::ProcessTable::Process;
+	# But there can be found:
+	# /* replace all '\0' with spaces (except for the last one */
+	# for (cur = cmndline_text; cur < cmndline_text + cmndline_off - 1; cur++) {
+	# if (*cur == '\0')
+	# 	*cur = ' ';
+	# }
+	# which wipes boundaries between arguments (that can also contain spaces)
+	# So wait until the patch https://rt.cpan.org/Public/Bug/Display.html?id=52442 will be integrated
 	
 	my $dir = "/proc";
 	
@@ -227,16 +236,13 @@
 			
 			open(CMDLINE, "<$dir/$pid/cmdline");
 			binmode CMDLINE;
-			my $cmdline;
-			read(CMDLINE, $cmdline, 65536);
-			
-			my @cmdline_parts = split(0x00, $cmdline);
+			my @cmdline = split("\x00", <CMDLINE>);
 			
 			return_next({
 				id => $pid,
 				owner => $uid,
-				command => readlink("$dir/$pid/exe"),
-				arguments => ["xxx"],
+				command => shift(@cmdline),
+				arguments => [@cmdline],
 				working_dir => readlink("$dir/$pid/cwd")
 			});
 		}




