[DRE-maint] Bug#699190: libinotify-ruby1.8: When converting Inotify flags, should use NUM2UINT

Romain Gayon romain.gayon at gmail.com
Mon Jan 28 20:01:49 UTC 2013


Package: libinotify-ruby1.8
Version: 0.0.2-5
Severity: normal
Tags: upstream patch

The lib uses NUM2INT to convert the flags from Ruby to C, which doesn't
handle the flag (from libinotify-ruby-0.0.2/ext/inotify.h ) :

#define IN_ONESHOT      0x80000000  /* only send event once */

How to reproduce:

require 'inotify'
i = Inotify.new
i.add_watch("somefile", Inotify::MODIFY|Inotify::ONESHOT)

test.rb:3:in `add_watch': integer 2147483650 too big to convert to `int'
(RangeError)
        from test.rb:3

in `add_watch': integer 2147483650 too big to convert to `int' (RangeError)

A patch proposal is attached.

-- System Information:
Debian Release: 6.0.6
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libinotify-ruby1.8 depends on:
ii  libc6                2.11.3-4            Embedded GNU C Library: Shared lib
ii  libruby1.8           1.8.7.302-2squeeze1 Libraries necessary to run Ruby 1.
ii  ruby1.8              1.8.7.302-2squeeze1 Interpreter of object-oriented scr

libinotify-ruby1.8 recommends no packages.

libinotify-ruby1.8 suggests no packages.

-- no debconf information

*** /tmp/inotify.c.num2uint.patch
--- inotify.c	2007-09-19 01:49:33.000000000 +0200
+++ inotify.c.new	2013-01-28 20:43:50.422843430 +0100
@@ -86,7 +86,7 @@
 #endif
 	int *fd, wd;
 	Data_Get_Struct(self, int, fd);
-	wd = inotify_add_watch(*fd, RSTRING_PTR(filename), NUM2INT(mask));
+	wd = inotify_add_watch(*fd, RSTRING_PTR(filename), NUM2UINT(mask));
 	if(wd < 0) {
 	  rb_sys_fail(RSTRING_PTR(filename));
 	}




More information about the Pkg-ruby-extras-maintainers mailing list