[Bug 244618] [PATCH] net-im/prosody: fix http files download
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Mar 5 22:47:07 UTC 2020
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244618
Bug ID: 244618
Summary: [PATCH] net-im/prosody: fix http files download
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: Individual Port(s)
Assignee: lx at FreeBSD.org
Reporter: rozhuk.im at gmail.com
Assignee: lx at FreeBSD.org
Flags: maintainer-feedback?(lx at FreeBSD.org)
Created attachment 212169
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=212169&action=edit
patch
http.server error Traceback[httpserver]:
/usr/local/lib/prosody/modules/mod_http_files.lua:115: bad argument #1 to
'format' (not a non-negative number in proper range)
stack traceback:
[C]: in function 'format'
/usr/local/lib/prosody/modules/mod_http_files.lua:115: in function
</usr/local/lib/prosody/modules/mod_http_files.lua:96>
(...tail calls...)
/usr/local/lib/prosody/util/events.lua:79: in function
</usr/local/lib/prosody/util/events.lua:75>
(...tail calls...)
/usr/local/lib/prosody/net/http/server.lua:248: in function
</usr/local/lib/prosody/net/http/server.lua:176>
[C]: in function 'xpcall'
/usr/local/lib/prosody/net/http/server.lua:108: in function
'process_next'
/usr/local/lib/prosody/net/http/server.lua:124: in function
'success_cb'
/usr/local/lib/prosody/net/http/parser.lua:177: in function 'feed'
/usr/local/lib/prosody/net/http/server.lua:155: in function
</usr/local/lib/prosody/net/http/server.lua:154>
(...tail calls...)
/usr/local/lib/prosody/net/server_select.lua:915: in function
</usr/local/lib/prosody/net/server_select.lua:899>
[C]: in function 'xpcall'
/usr/local/lib/prosody/../../bin/prosody:80: in function 'loop'
/usr/local/lib/prosody/../../bin/prosody:90: in main chunk
[C]: in ?
(a bit older release)
Actual code base: https://hg.prosody.im/trunk/file/tip/net/http/files.lua#l83
local etag = ('"%02x-%x-%x-%x"'):format(attr.dev or 0, attr.ino or 0, attr.size
or 0, attr.modification or 0);
On FreeBSD stat.dev is uint64_t and looks like it is converted to int32_t
somewhere in lua or prosody and result is negative.
Quick fix:
local etag = ('"%02x-%x-%x-%x"'):format(math.abs(attr.dev or 0), attr.ino or 0,
attr.size or 0, attr.modification or 0);
produces ETag: "78ff00ff-12f9c-2b4548-5e6103f3"
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list