combine 2 if-statements. While here; spacing, spacing, spacing
This commit is contained in:
8
fiche.c
8
fiche.c
@@ -77,8 +77,7 @@ void *thread_connection(void *args)
|
||||
bzero(buffer, BUFSIZE);
|
||||
int status = recv(connection_socket, buffer, BUFSIZE, MSG_DONTWAIT);
|
||||
|
||||
if (WHITELIST != NULL)
|
||||
if (check_whitelist(data.ip_address) == NULL)
|
||||
if (WHITELIST != NULL && check_whitelist(data.ip_address) == NULL)
|
||||
{
|
||||
display_info(data, NULL, "Rejected connection from unknown user.");
|
||||
save_log(NULL, data.ip_address, data.hostname);
|
||||
@@ -87,8 +86,7 @@ void *thread_connection(void *args)
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
if (BANLIST != NULL)
|
||||
if (check_banlist(data.ip_address) != NULL)
|
||||
if (BANLIST != NULL && check_banlist(data.ip_address) != NULL)
|
||||
{
|
||||
display_info(data, NULL, "Rejected connection from banned user.");
|
||||
save_log(NULL, data.ip_address, data.hostname);
|
||||
@@ -345,7 +343,7 @@ void save_to_file(char *slug, char *buffer, struct client_data data)
|
||||
|
||||
void change_owner(char *directory)
|
||||
{
|
||||
if ((UID != -1)&&(GID != -1))
|
||||
if (UID != -1 && GID != -1)
|
||||
chown(directory, UID, GID);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user