Native allow connections for unknown uids

This commit is contained in:
M66B 2016-01-24 23:05:53 +01:00
parent d816611618
commit ce1915992d
1 changed files with 5 additions and 7 deletions

View File

@ -253,7 +253,7 @@ void check_allowed(const struct arguments *args) {
while (u != NULL) {
int found = 0;
for (int i = 0; i < args->ucount; i++)
if (u->uid == args->uids[i]) {
if (u->uid < 0 || u->uid == args->uids[i]) {
found = 1;
break;
}
@ -268,7 +268,7 @@ void check_allowed(const struct arguments *args) {
while (t != NULL) {
int found = 0;
for (int i = 0; i < args->ucount; i++)
if (t->uid == args->uids[i]) {
if (t->uid < 0 || t->uid == args->uids[i]) {
found = 1;
break;
}
@ -988,12 +988,10 @@ void handle_ip(const struct arguments *args, const uint8_t *buffer, const size_t
#endif
// Check if allowed
jboolean
allowed = (jboolean)
!syn;
if (syn && args->filter && uid >= 0) {
jboolean allowed = (jboolean) !syn;
if (syn && args->filter) {
for (int i = 0; i < args->ucount; i++)
if (args->uids[i] == uid) {
if (uid < 0 || uid == args->uids[i]) {
allowed = 1;
break;
}