On Sat, Jan 31, 2009 at 12:12:02AM +0200, Timo Juhani Lindfors wrote:
> Wouter Verhelst <[email protected]> writes:
> >> $ nbd-server 2000 /dev/md0 3000614518784
> >> $ nc localhost 2000|hexdump -C
> >> 00000000  4e 42 44 4d 41 47 49 43  00 00 42 02 81 86 12 53  
> >> |NBDMAGIC..B....S|
> >> 00000010  00 00 00 ba a2 90 00 00  00 00 00 01 00 00 00 00  
> >> |................|
> >
> > ... except it doesn't.
> 
> The reason seems to be that nbd-server uses atol() which does not handle
> such large numbers.
> 
> > es = (off_t)atol(optarg);
> > switch (suffix) {
> >         case 'm':
> >         case 'M':  es <<= 10;
> >         case 'k':
> >         case 'K':  es <<= 10;
> >         default :  break;
> > }
> > serve->expected_size = es;
> 
> It should use atoll() instead.

Ah, of course. Good catch!

I've just uploaded a version that includes that fix. Thanks!

-- 
<Lo-lan-do> Home is where you have to wash the dishes.
  -- #debian-devel, Freenode, 2004-09-22



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to