summaryrefslogtreecommitdiff
path: root/src/system
Commit message (Collapse)AuthorAgeFilesLines
* Fix a potential memory leak in file transfer (#126)Andreas2019-11-191-7/+11
| | | | | | | | | | * Fix a potential memory leak in file transfer This potential memory leak in dlt-system-filetransfer.c can happen if only a filename is passed to dirname(). In the current implementation of dlt-daemon, this issue cannot happen. But in case of refactoring or different usage there is a chance that it can be triggered. See: https://linux.die.net/man/3/dirname Signed-off-by: Andreas Seidl <andreas.seidl@daimler.com>
* Improvement: Make ZLib dependency optional (#182)Sebastian Kloska2019-11-082-9/+21
| | | | | | | | * New CMake option WITH_DLT_FILETRANSFER * Only request ZLIB package if WITH_DLT_COREDUMPHANDLER==ON or WITH_DLT_FILETRANSFER==ON Signed-off-by: Sebastian Kloska <sebastian.kloska@snafu.de>
* dlt-system: Call tzset before localtime_r (#165)Saya Sugiura2019-09-231-0/+1
| | | | | | Since localtime() was calling tzset() internally, it should be used before localtime_r(). Refer to man page of localtime_r() for detail. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Bugfix: dlt-system-journalSebastian Kloska2019-09-131-5/+5
| | | | | | | * Don't pass a NULL pointer to localtime_r(...) and strftime(...) * Make sure that localtime_r(...) gets a pointer to time_t Signed-off-by: Sebastian Kloska <sebastian.kloska@daimler.com>
* Proper setup and error checking of pthread_createSebastian Kloska2019-09-138-77/+49
| | | | | | | | | | * Replace all start_XXX functions with one start_thread * Don't make pthread_t static * Don't use pthread_attr_t. Simply pass NULL * Bail out when pthread_create() fails * Check if MAX_THREADS gets exceeded Signed-off-by: Sebastian Kloska <sebastian.kloska@daimler.com>
* Add user custom timestamp interfaceSebastian Unger2019-09-134-7/+30
| | | | | | | | | | | | | Two new macros are introduced so that users can use their customized timestamps for DLT messages: - DLT_LOG_TS(CONTEXT, LOGLEVEL, TS, ARGS ...) - DLT_LOG_ID_TS(CONTEXT, LOGLEVEL, MSGID, TS, ARGS ...) Detailed explanations can be found in dlt_for_developers.md. Also a new option is added to dlt-system to use events' timestamps from journald adapter. Signed-off-by: Sebastian Unger <sunger@de.adit-jv.com>
* dlt-system-journal: fixed localtime compile errorjiripopek2019-07-251-1/+1
| | | | | | | fixes compiler error "error: too many arguments to function ‘localtime’" Signed-off-by: jiripopek <Jiri.Popek@bmw.de>
* doxygen: Remove licenceSaya Sugiura2019-07-1912-24/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Fix alerts from lgtmSaya Sugiura2019-06-191-1/+1
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Fix compiler warningsSimon Herkenhoff2019-05-062-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix compiler warnings about socket usage Correct the data types used for the socket declaration. We use AF_UNIX sockets so we use struct sockaddr_un, but we need to cast to struct sockaddr for the socket API. Fix compiler warnings about sign-compare Fix two occurences of signed - unsigned comparison by casting the values accordingly. Note that the cast is legal as the first parts of both conditional statements make sure the value is not negative before casting to unsigned. While at it, add strtol error checking. Fix compiler warnings about string functions Add string.h to src/daemon/dlt_daemon_unix_socket.c, because it was unaware of memcpy and strerror. While at it, change unsafe use of sprintf to proper dlt_vlog and remove the char buffer. Fix compiler warnings about unused-* Fix two unused-variable and one unused-parameter warning. While at it, change the #ifdef to not run into an empty block. Simply reverse the condition and enclose the complete else with the #ifdef. POSIX: Use memset instead of bzero "The bzero() function is deprecated (marked as LEGACY in POSIX.1-2001); use memset(3) in new programs." Use memset instead of bzero and remove any occurrence from DLT. Include of header "strings.h" that has bzero is also removed. Signed-off-by: Simon Herkenhoff <sherkenhoff@jp.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Code beautification using uncrustifyChristoph Lipka2018-12-2111-1465/+1440
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* dlt-system-process-handling: fix warning (#12)Gordan Markuš2017-05-181-1/+1
| | | | | | | | | | | In function ‘daemonize’: dlt-daemon/src/system/dlt-system-process-handling.c:84:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] for(i = getdtablesize(); i >= 0; i--) ^~~ dlt-daemon/src/system/dlt-system-process-handling.c:87:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’ int fd = open("/dev/null",O_RDWR); ^~~ Singed-off-by: Gordan Markuš <gordan.markus@pelagicore.com>
* Added Description in dlt-system.confAmber Bhardwaj2017-02-161-0/+5
| | | | | | | | | | Added additional information about how to enable syslog feature properly. If still facing issue while capturing syslogs through client (e.g. dlt_viewer) after following given steps then install listed packages: build-essential build-essential checkinstall pkg-config libsystemd-journal-dev Note: It's is a known issue when you try to capture syslog via dlt_viewer then syslogs wouldn't come in dlt_viewer because of improper configuration (won't route the log to port 47111) of dlt-system.
* dlt-system-filetransfer: fix bug caused by malloc assertManikandan C2016-10-241-6/+11
| | | | | | | Remove malloc assert in inappropriate location and add error logs in case of failures. Signed-off-by: Manikandan C <Manikandan.Chockalingam@in.bosch.com>
* dlt-system-filetransfer: Fix compiler warningsChristoph Lipka2016-10-241-1/+2
| | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Add: Debug log for file transfer feature of dlt-system.Yusuke Sato2016-09-231-1/+1
| | | | | | | Output debug log: File name contained in inotify event message. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp> Change-Id: I276b1373ae3b60347b4af44681f5c601f62dde4c
* Fix: File Transfer accelerationYusuke Sato2016-09-231-0/+1
| | | | | | | | Currently, dlt-system just wait for free space of user buffer > 50%. To speed up the file transfer, dlt-system should try to resend user buffer contents actively. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp> Change-Id: I09d76acacf65b2c68559a05d45e00f35f402316a
* Fix: File name is broken when file is transferred on 64 bit OS.Yusuke Sato2016-09-231-2/+2
| | | | | | | | When file transfer feature of dlt-system is used on the 64 bit OS, file name is overwritten at the unique name creation phase. File serial number should be maximum 10-digit decimal number. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp> Change-Id: I18fac363a103b6806ed9eb003ebbb305af7e7f58
* Bugfix: dlt-system filetransfer crashSven Hassler2016-02-191-1/+8
| | | | | | | | | | | If a file get written to after it appeared in a folder that is watched by the dlt-system filetransfer thread, the application tries to send this file multiple times, causing it to crash. This patch fixes this by canceling the sending process more gracefully if the file cannot be found. Change-Id: Id19b72061bed41642d12cd33afeaa41fb444b2c8 Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* dlt-system filetransfer waits for a clientSven Hassler2016-02-172-2/+5
| | | | | | | | | | | | | | For each file that is supposed to be sent, dlt-system will check if a client is connected to the daemon. If not, it waits and keeps checking once per second, until a client is connected. Files will still be compressed and moved to the .tosend subdirectory, regardless of the client connection. Changed the default startup timeout in the configuration file to 0. Change-Id: I5850adb51c381bc6279ac59f5bd985491ba5caf3 Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Set default log-levels in dlt.confStefan Vacek2015-12-091-1/+1
| | | | | | | | - feature: allow to define a default-log-level in dlt.conf (see dlt.conf for documentation) - bugfix: make dlt_unlock_mutex not inline to fix linkage - bugfix: initial log-level was not set correctly when no dlt-daemon was running Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Fix register context before application is registeredStefan Vacek2015-12-081-2/+2
| | | | | | | | Additional: - include sd-daemon.h if watchdog is enabled - fix formatting for printf 64bit values Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Fixed compiler warnings about format issues in dlt-system-journal.c by ↵Lutz Helwing2015-12-071-2/+2
| | | | replacing llu with PRIu64
* dlt-daemon: Make IP version compile time configurableS. Hameed2015-12-071-0/+8
| | | | | | Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* Linking library systemd instead of systemd-journal systemd-id128 if systemd ↵Lutz Helwing2015-11-181-1/+6
| | | | | | version >= 209 Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Purged all warnings for -Wall -WextraLutz Helwing2015-10-283-3/+3
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Use the best possible timestamp for all system journal entries: Realtime: ↵Lutz Helwing2015-10-071-26/+88
| | | | | | use _SOURCE_REALTIME_TIMESTAMP if available, else fall back to __REALTIME_TIMESTAMP which is always present Monotonic time: use _SOURCE_MONOTONIC_TIMESTAMP if available, else fall back to __MONOTONIC_TIMESTAMP which is always present Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Removed all trailing whitespacesLutz Helwing2015-07-214-32/+32
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed license headers and copyright doxygen commentsLutz Helwing2015-06-1712-23/+23
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Updated license headers to latest GENIVI license policy. Fixed further LRT ↵Lutz Helwing2015-06-1712-133/+181
| | | | | | Scan findings. Renamed and cleanup further files. Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Remove absolute installation paths so that DLT can be installed at any ↵Jacques GUILLOU2015-04-022-2/+4
| | | | | | location (not only "/usr"). Signed-off-by: Jacques GUILLOU <jacques.guillou@pelagicore.com>
* Add the IPv6 supportJiri Popek2015-03-231-2/+2
| | | | | | | Enables communication between DLT server and clients over IPv6. Signed-off-by: Jiri Popek <jiri.popek@bmw.de> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fix PREFIX. Works now with the default PREFIX (/usr/local/) and with the ↵Alexander Wenzel2015-03-121-5/+1
| | | | | | user PREFIX (e.g. /temp/test_with_pref). PREFIX Fix for filetransfer directory (PREFIX/share/). Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* resolves BUG-206: Install prefix should be configurableTomasz Kondziola2015-03-121-3/+5
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed: all possible malloc, sprintf and strcpy problemsAlexander Wenzel2014-04-016-23/+25
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Updated authors information.Alexander Wenzel2014-04-012-26/+12
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Cygwin port: cygwin patch, signal handling patch and cppcheck and install ↵Alexander Wenzel2014-04-012-5/+15
| | | | | | lib dll to correct location on Windows. Originally from Mikko Rapeli <mikko.rapeli@bmw.de>. Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed: Bug 172 - DLT system crashes because of wrong journald adaptor ↵Alexander Wenzel2014-04-011-52/+58
| | | | | | implementation Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Bug 3 - Cmake does not check for zlib for dlt-daemon compilation.Alexander Wenzel2014-01-101-2/+2
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Reduce Timeout between filetransfer packets.Alexander Wenzel2014-01-101-1/+1
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fix: Systemd Journal Adapter provides corrupted output.Alexander Wenzel2013-10-241-0/+1
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Yocto fix in build builds.Alexander Wenzel2013-07-311-3/+3
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed security issue in dlt-system-shell regarding strncpy.Alexander Wenzel2013-07-261-3/+16
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed: Security Issue by Command Injection in DLT System.Alexander Wenzel2013-07-265-6/+39
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Changes after review of journal implementation.Alexander Wenzel2013-07-252-14/+44
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Beautify output of journal logging.Alexander Wenzel2013-07-253-28/+94
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Added options for journal logging.Alexander Wenzel2013-07-255-25/+135
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* First version of journal support.Alexander Wenzel2013-07-256-5/+222
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* removed closure of daemonized file descriptor pointing to /dev/nullSimon Brandner2013-07-191-1/+1
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* added length check for paths of files to be transferredSimon Brandner2013-07-191-0/+6
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>