[sane-devel] [sane-commit] CVS update of sane-backends (3 files)

2008-12-06 Thread Louis Lagendijk
ok, changed this according to the excellent suggestion by Julien. I simply do not know why I never thought of this before. It is so obvious. Louis L On Sat, 2008-12-06 at 17:31 +0100, Julien BLACHE wrote: > Louis Lagendijk wrote: > > Hi, > > > backend/pixma_bjnp.c pixma_bjnp_private.h > > On U

[sane-devel] [sane-commit] CVS update of sane-backends ( 3 files )

2008-12-06 Thread E. MARC
Le samedi 6 d?cembre 2008, ? 18:39, Nicolas Martin a ?crit?: > Same on Ubuntu: > > $ ./getlgn > method 1 getuid : user=nicolas > method 2 geteuid: user=nicolas > $ sudo ./getlgn > [sudo] password for nicolas: > method 1 getuid : user=root > method 2 geteuid: user=root > > ? so it works fine with bo

[sane-devel] [sane-commit] CVS update of sane-backends (3 files)

2008-12-06 Thread Nicolas Martin
Same on Ubuntu: $ ./getlgn method 1 getuid : user=nicolas method 2 geteuid: user=nicolas $ sudo ./getlgn [sudo] password for nicolas: method 1 getuid : user=root method 2 geteuid: user=root ? Le samedi 06 d?cembre 2008 ? 18:27 +0100, E. MARC a ?crit : > Le samedi 6 d?cembre 2008, ? 18:10, Julie

[sane-devel] [sane-commit] CVS update of sane-backends (3 files)

2008-12-06 Thread E. MARC
Le samedi 6 d?cembre 2008, ? 18:10, Julien BLACHE a ?crit?: > Nicolas Martin wrote: > > Hi, > > > ? struct passwd *uid; > > ? uid = getpwuid(geteuid()); > > ? printf("user=%s\n", uid->pw_name); > > > > Prints my username correctly. Also prints root if runned with sudo ;-) > > Yep, use getuid() ins

[sane-devel] [sane-commit] CVS update of sane-backends (3 files)

2008-12-06 Thread Julien BLACHE
Nicolas Martin wrote: Hi, > struct passwd *uid; > uid = getpwuid(geteuid()); > printf("user=%s\n", uid->pw_name); > Prints my username correctly. Also prints root if runned with sudo ;-) Yep, use getuid() instead of geteuid() if you want to avoid that. Also, you want some error checking

[sane-devel] [sane-commit] CVS update of sane-backends (3 files)

2008-12-06 Thread Nicolas Martin
Ok, I don't know too much about those functions, but this quick & dirty code seems to work well on Ubuntu (Hardy 8.04): #include #include int main() { struct passwd *uid; uid = getpwuid(geteuid()); printf("user=%s\n", uid->pw_name); } Prints my username correctly. Also prints root if run

[sane-devel] [sane-commit] CVS update of sane-backends (3 files)

2008-12-06 Thread Julien BLACHE
Louis Lagendijk wrote: Hi, > backend/pixma_bjnp.c pixma_bjnp_private.h > On Ubuntu getlogin() returns NULL. So we noew first try getlogin() > and if that fails, we try getenv("USER") and if that fails we use > a defaul user string You want geteuid() + getpwuid() instead of getlogin() which reli

[sane-devel] Canon Pixma MP970 scanner: Connection refused

2008-12-06 Thread Brian Rosenberger
Hi Nicolas, I am using a Canon Pixma MP970 scanner with your latest additions to sane-backends. It is working with USB like a charm, but using network it seems that it always defaults to 127.0.0.1 (localhost) instead of using the scanners ip (which is 192.168.1.252). I tried to set ip in pixma.co

[sane-devel] [sane-commit] CVS update of sane-backends (3 files)

2008-12-06 Thread m. allan noah
do you want getruid() ? allan On Sat, Dec 6, 2008 at 12:39 PM, Nicolas Martin wrote: > Same on Ubuntu: > > $ ./getlgn > method 1 getuid : user=nicolas > method 2 geteuid: user=nicolas > $ sudo ./getlgn > [sudo] password for nicolas: > method 1 getuid : user=root > method 2 geteuid: user=root > >

[sane-devel] HP4600 code based off of SniffUSB log

2008-12-06 Thread Triften Chmil
I've added a page to my site for the work I've done so far. http://www.chmil.org/hp4600linux/ The executable will do a full page color scan at 600 DPI and dump the results into a file called "scanned.bmp". Details on the page. -Triften