Commit Graph

44 Commits

Author SHA1 Message Date
955187d9fa Improvements on pathname handling of maxkeys and maxpasswd
The default pathname for maxkeys was a hardcoded value and it didn't use
the default directory location functions. If encrypted passwords were used
nothing was written into the log.
2016-03-01 10:57:13 +02:00
4ef89d213b MXS-463: Filepaths are now properly formatted for printing
The various global directory setter functions now process the input they receive
and remove redundant and trailing forward slashes from the directory paths.
2016-01-04 18:40:00 +02:00
17eb80072f Reindent server/core/secrets.c 2015-11-30 18:48:14 +02:00
a355e1beef Printf format checking added to logging function.
Printf format checking added to logging function and all
issues that were revealed by that fixed.
2015-11-16 12:40:49 +02:00
44df53d846 LOGIF and skygw_write_log removed from server/core/*.c
LOGIF and skygw_write_log removed from server/core/*.c and
replaced with calls to MXS_(ERROR|WARNING|NOTICE|INFO|DEBUG).
This is a mechanism change, no updating of the actual message
has been performed.

Currently this causes a very small performance hit, since the
check whether the priority is enabled or not is performed in
the function that is called and not before the function is called.
Once all LOGIFs and skygw_write_logs have been replaced, the
behaviour will be altered back to what it was.
2015-11-16 09:49:12 +02:00
76856e6c90 Fixed compiler warnings. 2015-11-13 11:53:12 +02:00
6b88b6b17f Merge branch 'develop' into MXS-329-develop-20151111 2015-11-13 07:48:59 +02:00
90a8646ac2 Whitespace and indentation changes.
Also changed line-endings from DOS CRLF to only LF.
In addition, made functions const correct.
2015-11-11 13:43:15 +02:00
dee20fe077 Merge remote-tracking branch 'origin/develop' into MXS-329-develop-20151111
# Conflicts:
#	server/core/CMakeLists.txt
#	server/core/buffer.c
#	server/core/service.c
#	server/modules/filter/tee.c
#	server/modules/monitor/mysql_mon.c
#	server/modules/routing/binlog/blr.c
#	server/modules/routing/binlog/blr_slave.c
#	server/modules/routing/debugcmd.c
#	server/modules/routing/readwritesplit/readwritesplit.c
#	utils/skygw_utils.cc

- resolved.
2015-11-11 11:08:02 +00:00
834a88aeda Log variables moved to log_manager.h
The log manager variables lm_enabled_log_files_bitmask, log_ses_count
and tls_log_info that earlier were declared separately in every
c-file are now declared in the log_manager.h header.
2015-11-04 14:26:53 +02:00
cfeaf7d6e9 Merge remote-tracking branch 'origin/develop' into MXS-329
Conflicts:
	server/core/session.c
2015-09-10 13:07:27 +01:00
160bbb70ee MXS-251: strerror
Replaces all calls to strerror with calls to strerror_r. The former
is non-thread safe while the latter is.
2015-09-05 15:52:13 +03:00
820bb4ea00 Avoid name clash - change random to random_jkiss 2015-08-26 16:18:08 +01:00
1f6b544f33 Tidy dcb_free (prefer use of dcb_close) and remove from test code; add good random number generator. 2015-08-26 15:43:21 +01:00
98ab399e6e Changed sprintf calls to snprintf calls and fixed compiler warnings. 2015-08-18 10:50:48 +03:00
e5d9abbdcb Fixes to Coverity defects. 2015-06-25 06:01:33 +03:00
466ee46d82 Fix to MXS-125: https://mariadb.atlassian.net/browse/MXS-125
Unified the usages of maxkeys and maxpasswd.
2015-06-16 17:10:00 +03:00
0d85ae6603 Changed data directory to /var/lib/maxscale. 2015-05-22 11:31:22 +03:00
9e0a2bfc12 Changed relevant files to use get_cachedir() instead of using the now deprecated MAXSCALE_HOME. 2015-04-27 21:55:57 +03:00
da406db292 Changed install path to /usr/local/mariadb-maxscale 2015-03-23 20:12:56 +02:00
7cfc1d3cc9 Chaged MaxScale default installation directory to /usr/local/mariadb/maxscale and MaxAdmin password to 'mariadb'. 2015-03-23 14:53:31 +02:00
c75ba90f6f Fixes to Coverity defect 84478 and to 72759 which has reappeared. 2014-12-11 09:43:59 +02:00
30c928c326 Switched to /dev/random instead of time(NULL) in secrets.c 2014-12-04 10:07:06 +02:00
5fa87776b0 Fixes for Coverity bugs 2014-11-20 16:04:22 +00:00
0e6fa09d7e Fixes for Coverity issues 2014-11-19 16:01:38 +00:00
fd11e6a7f5 Session-specific logging. Added functions
void session_enable_log(SESSION* ses, logfile_id_t id)
and
void session_disable_log(SESSION* ses, logfile_id_t id)

Which switch specific log type on/off if the log type in question is not generally enabled.

Each thread carries a thread-specific struct log_info_t which includes members for current session id and bitfield for enabled log types for the current session. That information is checked before actual log write functions are called.

Each file where session-specific logging is used, must include the following exports:

/** Defined in log_manager.cc */
extern int            lm_enabled_logfiles_bitmask;
extern size_t         log_ses_count[];
extern __thread log_info_t tls_log_info;
2014-11-19 00:08:59 +02:00
fc5c3943e8 Fixes to Coverity defects:
72643
72645
72655
72656
72657
72658
72664
72698
72712
2014-11-12 19:02:37 +02:00
deffd4a69f Fix to Coverity cases 73417, 73420, 72759, 72639 2014-10-31 23:11:19 +02:00
502c78de2b Add swp files 2014-10-21 15:30:32 +01:00
bb11f6236f Related to #145, http://bugs.mariadb.com/show_bug.cgi?id=145
If .secrets file is not used it means that encrypted password is not used. Moved log entry away from error log and placed it to message log. It still prints it multiple times though.
2014-10-02 09:44:30 +03:00
b0683d9b4d Updated the licensing year from 2013 to 2013-2014 2014-10-01 14:37:12 +03:00
f4e591e382 Changed 'SkySQL Gateway' to 'MariaDB Corporation MaxScale' 2014-09-30 13:15:03 +03:00
c344231f80 Renamed all occurences of SkySQL to MariaDB Corporation 2014-09-30 13:02:10 +03:00
344fcfa9ea Jira bug MAX-248 File descriptor leak in secrets key reading 2014-09-10 08:06:48 +01:00
70115d35c9 Fix to bug #438 http://bugs.skysql.com/show_bug.cgi?id=438
Fixed some compiler warnings, added header includes, return values etc.
2014-05-27 17:07:41 +03:00
d403018fd9 Surrounded every log writing command with LOGIF macro, which tests if the given logfile id matches with those enabled. The comparison is done against local variable and expensive function call is avoided. 2013-12-12 16:14:33 +02:00
701830f0ab Logging related (mostly) sanity checks and fixes.
- Checked argument types and counts
- Removed trailing line feeds
- Removed thread ids from error logs (they are used in trace / debug log
- Added some state information to dcbs
- Added prefix 'Error' or 'Fatal' to error logs.
- Switches all error logs to use flushing log write.
2013-09-30 11:14:36 +03:00
94a8ad68d3 Checked for bug #178. Added error logs to suitabl places. 2013-08-29 09:50:16 +03:00
c9ff06e0f5 Increased maximum path length from 180 to 255, and replaced sprintf with snprintf to prevent buffer overflow. 2013-08-23 22:27:40 +03:00
b18d89300d Bug 179 2013-08-22 00:26:24 +03:00
9fe7a83675 Fixes for resource leaks foudn with Coverity.
Bug 173, 174, 175, 176 and 177
2013-08-21 17:26:55 +02:00
b1c398e944 Bug 145 - Silently ignore missing .secrets file 2013-08-19 15:36:26 +02:00
cae4d38a7e Removed unnecessary argument from log manager commands because it is not used and it is always NULL. 2013-08-04 23:30:47 +03:00
a7c82310f9 moving files to /server to make merge possible 2013-07-28 05:31:11 +00:00