Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

License issue should be noticed when you copy code from lilien1010/lua-resty-maxminddb #25

Closed
lilien1010 opened this issue Aug 6, 2020 · 5 comments

Comments

@lilien1010
Copy link

when I checked your source code, I see a better code style with more fretures, I really liked it.
but also I am very familiar with your project while some source code is I think copied from my project https://github.com/lilien1010/lua-resty-maxminddb which is already licensed with Apache LISENCE.

Eg:
there is a comment like https://www.maxmind.com/en/geoip2-databases you should download the mmdb file from maxmind is exactly from my project lua-resty-maxminddb

According to the former opensource LISENCE is already Apache lisenced, BSD lisence is not acceptable.

@lilien1010
Copy link
Author

If the license protocol is not followed, and this project is used in your company product or service , which will lead a legal issue.

@anjia0532
Copy link
Owner

Sorry, English is not my native language, this is translated via google.

I once searched the library about openresty+maxminddb from the Internet, including https://github.com/lilien1010/lua-resty-maxminddb that you open sourced, but it can’t meet my requirements (return only area information), and memory leak.
So I refer to your project (https://github.com/lilien1010/lua-resty-maxminddb) and libmaxminddb (https://github.com/maxmind/libmaxminddb), and express my gratitude in the reference area ( https://github.com/anjia0532/lua-resty-maxminddb#references)

The following is the part of the code I have copied from you (if any omissions, please point out), I am very sorry for the trouble caused by my infringement.

https://github.com/lilien1010/lua-resty-maxminddb/blob/f96633e2428f8f7bcc1e2a7a28b747b33233a8db/resty/maxminddb.lua#L5-L12 vs

local json = require('cjson')
local json_encode = json.encode
local json_decode = json.decode
local ngx_log = ngx.log
local ngx_ERR = ngx.ERR
local ngx_CRIT = ngx.CRIT
local ngx_INFO = ngx.INFO

https://github.com/lilien1010/lua-resty-maxminddb/blob/f96633e2428f8f7bcc1e2a7a28b747b33233a8db/resty/maxminddb.lua#L36-L126 vs

ffi.cdef[[
typedef unsigned int mmdb_uint128_t __attribute__ ((__mode__(TI)));
typedef struct MMDB_entry_s {
struct MMDB_s *mmdb;
uint32_t offset;
} MMDB_entry_s;
typedef struct MMDB_lookup_result_s {
bool found_entry;
MMDB_entry_s entry;
uint16_t netmask;
} MMDB_lookup_result_s;
typedef struct MMDB_entry_data_s {
bool has_data;
union {
uint32_t pointer;
const char *utf8_string;
double double_value;
const uint8_t *bytes;
uint16_t uint16;
uint32_t uint32;
int32_t int32;
uint64_t uint64;
mmdb_uint128_t uint128;
bool boolean;
float float_value;
};
uint32_t offset;
uint32_t offset_to_next;
uint32_t data_size;
uint32_t type;
} MMDB_entry_data_s;
typedef struct MMDB_entry_data_list_s {
MMDB_entry_data_s entry_data;
struct MMDB_entry_data_list_s *next;
} MMDB_entry_data_list_s;
typedef struct MMDB_description_s {
const char *language;
const char *description;
} MMDB_description_s;
typedef struct MMDB_metadata_s {
uint32_t node_count;
uint16_t record_size;
uint16_t ip_version;
const char *database_type;
struct {
size_t count;
const char **names;
} languages;
uint16_t binary_format_major_version;
uint16_t binary_format_minor_version;
uint64_t build_epoch;
struct {
size_t count;
MMDB_description_s **descriptions;
} description;
} MMDB_metadata_s;
typedef struct MMDB_ipv4_start_node_s {
uint16_t netmask;
uint32_t node_value;
} MMDB_ipv4_start_node_s;
typedef struct MMDB_s {
uint32_t flags;
const char *filename;
ssize_t file_size;
const uint8_t *file_content;
const uint8_t *data_section;
uint32_t data_section_size;
const uint8_t *metadata_section;
uint32_t metadata_section_size;
uint16_t full_record_byte_size;
uint16_t depth;
MMDB_ipv4_start_node_s ipv4_start_node;
MMDB_metadata_s metadata;
} MMDB_s;
typedef char * pchar;
MMDB_lookup_result_s MMDB_lookup_string(MMDB_s *const mmdb, const char *const ipstr, int *const gai_error,int *const mmdb_error);
int MMDB_open(const char *const filename, uint32_t flags, MMDB_s *const mmdb);
int MMDB_aget_value(MMDB_entry_s *const start, MMDB_entry_data_s *const entry_data, const char *const *const path);
char *MMDB_strerror(int error_code);

https://github.com/lilien1010/lua-resty-maxminddb/blob/f96633e2428f8f7bcc1e2a7a28b747b33233a8db/resty/maxminddb.lua#L136-L138 vs

-- you should install the libmaxminddb to your system
local maxm = ffi.load('libmaxminddb')
--https://github.com/maxmind/libmaxminddb

https://github.com/lilien1010/lua-resty-maxminddb/blob/f96633e2428f8f7bcc1e2a7a28b747b33233a8db/resty/maxminddb.lua#L159-L176 vs

local gai_error = ffi_new('int[1]')
local mmdb_error = ffi_new('int[1]')
local result = maxm.MMDB_lookup_string(mmdb,ip,gai_error,mmdb_error)
if mmdb_error[0] ~= MMDB_SUCCESS then
return nil,'lookup failed: ' .. mmdb_strerror(mmdb_error[0])
end
if gai_error[0] ~= MMDB_SUCCESS then
return nil,'lookup failed: ' .. gai_strerror(gai_error[0])
end
if true ~= result.found_entry then
return nil,'not found'
end

https://github.com/lilien1010/lua-resty-maxminddb/blob/master/resty/maxminddb.lua#L208 vs https://github.com/anjia0532/lua-resty-maxminddb/blob/master/lib/resty/maxminddb.lua#L349

https://github.com/lilien1010/lua-resty-maxminddb/blob/master/README.md#bug-reports vs https://github.com/anjia0532/lua-resty-maxminddb/blob/master/README.md#bug-reports

Measures taken in this regard:

  1. Mark -- copy from xxx in the form of comments in the source code section (completed)
  2. Describe this issue in README.md (completed)
  3. Modify the license (I don't know much about Apache and BSD, if you are willing to help me, please help me) (unfinished)

The following is the original Chinese

以下是中文原文
对不起,英语不是我的母语,这是通过google翻译的.

我曾经从网络上搜索关于openresty+maxminddb的库,其中包括你所开源的 https://github.com/lilien1010/lua-resty-maxminddb ,但是它不能满足我的要求(只返回区域信息),以及内存泄露.
所以我参考了你的项目(https://github.com/lilien1010/lua-resty-maxminddb)和 libmaxminddb的(https://github.com/maxmind/libmaxminddb) , 并在引用区域对此表达谢意(https://github.com/anjia0532/lua-resty-maxminddb#references)

以下是我列出的复制自您的代码部分(如有遗漏,请指出),针对我的侵权不当行为对您造成的困扰我感到十分抱歉.

https://github.com/lilien1010/lua-resty-maxminddb/blob/f96633e2428f8f7bcc1e2a7a28b747b33233a8db/resty/maxminddb.lua#L5-L12 vs https://github.com/anjia0532/lua-resty-maxminddb/blob/cb0218352f553fce612cf914f0a5159930927b67/lib/resty/maxminddb.lua#L3-L10

https://github.com/lilien1010/lua-resty-maxminddb/blob/f96633e2428f8f7bcc1e2a7a28b747b33233a8db/resty/maxminddb.lua#L36-L126 vs https://github.com/anjia0532/lua-resty-maxminddb/blob/d98b71a714862ffd59344c6e43f655a54298d17d/lib/resty/maxminddb.lua#L23-L113

https://github.com/lilien1010/lua-resty-maxminddb/blob/f96633e2428f8f7bcc1e2a7a28b747b33233a8db/resty/maxminddb.lua#L136-L138 vs https://github.com/anjia0532/lua-resty-maxminddb/blob/d98b71a714862ffd59344c6e43f655a54298d17d/lib/resty/maxminddb.lua#L155-L157

https://github.com/lilien1010/lua-resty-maxminddb/blob/f96633e2428f8f7bcc1e2a7a28b747b33233a8db/resty/maxminddb.lua#L159-L176 vs https://github.com/anjia0532/lua-resty-maxminddb/blob/d98b71a714862ffd59344c6e43f655a54298d17d/lib/resty/maxminddb.lua#L312-L327

https://github.com/lilien1010/lua-resty-maxminddb/blob/master/resty/maxminddb.lua#L208 vs https://github.com/anjia0532/lua-resty-maxminddb/blob/master/lib/resty/maxminddb.lua#L349

https://github.com/lilien1010/lua-resty-maxminddb/blob/master/README.md#bug-reports vs https://github.com/anjia0532/lua-resty-maxminddb/blob/master/README.md#bug-reports

对此采取的措施:

1. 在源码部分以注释的形式标明 `-- copy from xxx` (已完成)
2. 在 README.md 说明此问题(已完成)
3. 修改License(我对Apache和BSD的了解不多,如果您愿意帮助我的话,请帮帮我)(未完成)

@lilien1010
Copy link
Author

I am not being criticism your better library for openresty community, just want you know that obey of open source licence will help the community go far and safe.

image

please reference https://github.com/apache/apisix/blob/master/LICENSE
and change your LICENSE description in README.md,
and also I am PMC of Apache APISIX, feel free to join us and make a better API gateway.

@anjia0532
Copy link
Owner

@lilien1010
Copy link
Author

@anjia0532 great !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants