1 --- vncrec/argsresources.c.orig 2008-04-08 11:06:23.000000000 -0500
2 +++ vncrec/argsresources.c 2008-03-20 10:58:00.000000000 -0500
4 const char * infile = appData.play ? appData.play : appData.movie;
7 - vncLog = fopen (infile, "r");
8 + if (!strcmp("-", infile)) {
11 + vncLog = fopen (infile, "r");
15 fprintf (stderr, "%s: failed to open %s\n",
18 else if (appData.record)
20 - vncLog = fopen (appData.record, "w");
21 + if (!strcmp("-", appData.record)) {
24 + vncLog = fopen (appData.record, "w");
28 fprintf (stderr, "%s -record: failed to open %s\n",
29 --- vncrec/rfbproto.c.orig 2008-04-08 11:06:13.000000000 -0500
30 +++ vncrec/rfbproto.c 2008-03-20 06:40:37.000000000 -0500
33 #include <vncviewer.h>
37 static Bool HandleRRE8(int rx, int ry, int rw, int rh);
38 static Bool HandleRRE16(int rx, int ry, int rw, int rh);
40 } else if (appData.passwordDialog) {
41 passwd = DoPasswordDialog();
43 - passwd = getpass("Password: ");
44 + passwd = ReadPasswdFile(".vncrecpasswd");
47 if ((!passwd) || (strlen(passwd) == 0)) {
55 + * When connecting to a remote vnc server, don't prompt the user for a
56 + * password. Instead, read it from a file
58 +char *ReadPasswdFile(char *fname) {
62 + passwd = malloc(sizeof(char) * (maxpwlen+1));
63 + fd = open(fname, O_RDONLY);
65 + fprintf(stderr, "Failed to open %s\n", fname);
68 + plen = (int) read(fd, passwd, maxpwlen);
70 + fprintf(stderr, "Read in %d bytes from %s\n", plen, fname);
72 + fprintf(stderr, "error: %d\n", errno);
76 + for(x=0; x<plen; x++) {
77 + if(passwd[x] == 10) {
86 --- vncrec/vncviewer.h.orig 2008-04-08 11:05:36.000000000 -0500
87 +++ vncrec/vncviewer.h 2008-03-20 06:05:21.000000000 -0500
89 extern Bool HandleRFBServerMessage();
91 extern void PrintPixelFormat(rfbPixelFormat *format);
92 +extern char *ReadPasswdFile(char *fname);
96 --- README.orig 2008-04-08 13:25:18.000000000 -0500
97 +++ README 2008-04-08 13:25:07.000000000 -0500
99 QUICK for -movie below)
103 +Amigo's patched vncrec
104 +~~~~~~~~~~~~~~~~~~~~~~
105 +Starting with the Twibright patches to vncrec (see below in this readme), I
106 +made a couple minor modifications:
107 + - allow reading from stdin and writing to stdout. Use - as a filename.
108 + - read password from .vncrecpasswd instead of prompting for a password.
110 +The purpose of both of these changes is to facilitate using vncrec in a script.
111 +Writing to stdout allows the output to be piped to gzip.
113 +One use scenario is this:
115 + # export DISPLAY=:1
116 + # vncrec -record - ip.ad.dre.ss:0 -shared -viewonly -encodings raw | gzip -c9 > logfile.vnc.gz
118 +Because vncrec needs an X display to run, use Xvfb to create a virtual one.
119 +When logging a long session, vncrec isn't helpful as a review tool... there's
120 +no pause, rew, ff, etc. Instead, we want to use pyvnc2swf to convert the
121 +session to flash format with a progress bar for seeking through the recording.
123 +However, pyvnc2swf doesn't recognize CopyRect (a standard VNC encoding), we
124 +instead use "raw". But since the raw encoding would generate a huge file,
127 +Using pyvnc2swf to simply record files into a flash format would be nice, but
128 +it uses about 100 times more CPU power than gzip. Bzip2 is another contender,
129 +but even bzip2 -1 uses more CPU time than gzip -9 and produces a larger file.
131 +I have found no other feasible way of recording several multi-hour VNC sessions