lukasz_mp
unread,Feb 3, 2009, 3:41:37 AM2/3/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ColdSync Hackers
Hello,
I'm a beginner in developing, so this may be not a valid diff file,
please give me a try :)
There is one extra change in backup.c, in my environment without the
change coldsync hangs during identification.
P.S. How to attach a file in this newsgroup? I've made copy-paste, it
may contain errors.
-------------------------------------
diff -u -r coldsync/src/backup.c coldsync-ex_ignoresn/src/backup.c
--- coldsync/src/backup.c 2009-01-02 11:56:54.000000000 +0100
+++ coldsync-ex_ignoresn/src/backup.c 2009-02-03 09:30:03.000000000
+0100
@@ -606,7 +606,7 @@
fprintf(stderr, "Wrote \"%s\" to \"%s\"\n",
dbinfo->name, bakfname);
- err = DlpCloseDB(pconn, dbh, 0);
+/* lk - for me should be without closing err = DlpCloseDB(pconn, dbh,
0); */
free_pdb(pdb);
close(bakfd);
va_add_to_log(pconn, "%s %s - %s\n",
diff -u -r coldsync/src/coldsync.h coldsync-ex_ignoresn/src/coldsync.h
--- coldsync/src/coldsync.h 2009-01-02 11:56:54.000000000 +0100
+++ coldsync-ex_ignoresn/src/coldsync.h 2009-02-03 09:30:39.000000000
+0100
@@ -333,6 +333,9 @@
* Palm has no internal serial
number
* (m125, Zire71)
*/
+ Bool3 ignore_serial_number; /* lk: If true, coldsync
will ignore first field in /etc/coldsync/palms file
+ and disable Serial Number
verification.
+ */
/* XXX - Perhaps allow "final" here, so that the
sysadmin
* can lock options in place.
*/
diff -u -r coldsync/src/conduit.c coldsync-ex_ignoresn/src/conduit.c
--- coldsync/src/conduit.c 2009-01-02 11:56:54.000000000 +0100
+++ coldsync-ex_ignoresn/src/conduit.c 2009-02-03 09:31:37.000000000
+0100
@@ -1123,6 +1123,13 @@
/* See if there is anything pending on 'fromchild' */
while (1)
{
+ /* lk: without these code it hangs on identification */
+ if (fromchild == NULL) {
+ CONDUIT_TRACE(5)
+ fprintf(stderr, "LK in abort, fromchild is NULL
\n");
+ break;
+ }
+ /* lk end */
err = poll_fd(fileno(fromchild), False);
if (err < 0)
@@ -1182,7 +1189,7 @@
* databases.
*/
- DlpCloseDB(palm_pconn(palm), DLPCMD_CLOSEALLDBS, 0);
+/* lk - tak jest w dzialajacym DlpCloseDB(palm_pconn(palm),
DLPCMD_CLOSEALLDBS, 0); */
close(spcpipe[0]);
close(spcpipe[1]);
diff -u -r coldsync/src/config.c coldsync-ex_ignoresn/src/config.c
--- coldsync/src/config.c 2009-01-02 11:56:54.000000000 +0100
+++ coldsync-ex_ignoresn/src/config.c 2009-02-03 09:47:52.000000000
+0100
@@ -383,6 +383,8 @@
*
for the last options, so they default to
*
False here.
*/
+ sync_config->options.ignore_serial_number = False; /* lk mod
*/
+
/* Add a default conduit to the head of the queue, equivalent
* to:
diff -u -r coldsync/src/lexer.l coldsync-ex_ignoresn/src/lexer.l
--- coldsync/src/lexer.l 2009-01-02 11:56:54.000000000 +0100
+++ coldsync-ex_ignoresn/src/lexer.l 2009-01-02 12:00:17.000000000
+0100
@@ -197,6 +197,7 @@
"Chosen" { KEYWORD(SAVED); }
"Heathen" { KEYWORD(UNSAVED); }
"use_card_serial" { KEYWORD(USE_CARD_SERIAL); }
+"ignore_sn" { KEYWORD(IGNORE_SN); }
/* Boolean values */
[Tt]"rue" { KEYWORD(TRUE); }
diff -u -r coldsync/src/parser.y coldsync-ex_ignoresn/src/parser.y
--- coldsync/src/parser.y 2009-01-02 11:56:54.000000000 +0100
+++ coldsync-ex_ignoresn/src/parser.y 2009-02-03 09:32:32.000000000
+0100
@@ -101,6 +101,7 @@
%token TYPE
%token UNSAVED
%token USE_CARD_SERIAL
+%token IGNORE_SN
%token SERIAL
%token USB
@@ -975,6 +976,14 @@
fprintf(stderr, "Option: use_card_serial.\n");
file_config->options.use_card_serial = True3;
}
+ /* lk */
+ | IGNORE_SN ';'
+ {
+ PARSE_TRACE(3)
+ fprintf(stderr, "Ignore Serial Number in palms
file when authenticating device on net protocol.\n");
+ file_config->options.ignore_serial_number = True3;
+ }
+ /* lk end */
| HOSTID colon NUMBER semicolon
{
PARSE_TRACE(3)
diff -u -r coldsync/src/runmode.c coldsync-ex_ignoresn/src/runmode.c
--- coldsync/src/runmode.c 2009-01-02 11:56:54.000000000 +0100
+++ coldsync-ex_ignoresn/src/runmode.c 2009-01-02 15:05:12.000000000
+0100
@@ -838,7 +838,19 @@
/* XXX - Figure out exactly what the search criteria should be
*/
/* XXX - If userid is 0, abort? */
- palment = lookup_palment(palm, PMATCH_EXACT);
+ SYNC_TRACE(3)
+ fprintf(stderr, "\nlk: sync_config-
>options.ignore_serial_number %i \n", sync_config-
>options.ignore_serial_number );
+ if (sync_config->options.ignore_serial_number) {
+ /* lk modification: ignore SN field in palms file */
+ palment = lookup_palment(palm, PMATCH_USERNAME |
PMATCH_USERID);
+ }
+ else {
+ /* old way */
+ palment = lookup_palment(palm, PMATCH_EXACT);
+ }
+
+
+
if (palment == NULL)
{