[sane-devel] Frustrated with making saned work

Mac Cody maccody at tx.rr.com
Mon Apr 23 04:39:57 UTC 2007


Okay, I think I've found the source of the problem.  There is a macro
definition DEBUG_CALIBRATION on line 76 of umax1220u-common.c.  This
macro definition allows for the conditional compile of two code blocks.
The first is in the function find_zero_2100U, starting on line 1246:
#ifdef DEBUG_CALIBRATION
  {
    int w = 300, h = 180;
    FILE *f2 = fopen ("find_zero.pgm", "wb");
    fprintf (f2, "P5\n%d %d\n255\n", w, h);
    fwrite (img, 1, w * h, f2);
    fclose (f2);
  }
#endif

The second code block is in the function get_caldata_2100U, starting on
line 1524:
#ifdef DEBUG_CALIBRATION
  {
    FILE *f2 = fopen ("calibration.pgm", "wb");
    fprintf (f2, "P5\n%d %d\n255\n", w, h);
    fwrite (p, 1, w * h, f2);
    fclose (f2);
  }
#endif

Similar code blocks also appear in the functions find_zero and
get_caldata.  These functions are executed for a UMAX 1220U scanner
only.  I have a UMAX 2100U scanner, so the functions I described above
are applicable.

When line 76 is commented out, DEBUG_CALIBRATION is not defined and
the code blocks described above are not compiled.  The umax1220u backend
works properly under direct control and through saned.  If line 76 is
uncommented, DEBUG_CALIBRATION is defined and the code blocks described
above are compiled.  In this situation, the umax1220u backend works
properly under direct control, but exhibits the problem described in my
original post when the backend is accessed though saned.  It appears that
the authentication is caused by the attempted writing of a file to the
local file system by a remote client.  Does anyone have any idea as to why
this is so?  I don't see any obvious mechanism to cause the second
authentication to be invoked, unless it is in some library external to
SANE.

Thanks,

Mac

Julien BLACHE wrote:

>Mac Cody <maccody at tx.rr.com> wrote:
>
>Hi,
>
>
>>I don't know what else to do.  It seems like I'm very close, but I'm
>>missing something.  Thanks in advance for your help!
>>
>
>Please run saned in debug mode and send the log, it'll help telling
>who's at fault.
>
>JB.
>
>




More information about the sane-devel mailing list