summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/syslog.c
Commit message (Collapse)AuthorAgeFilesLines
* Handle %%m properly in syslog format string. Previously it would expandalfred2003-02-101-3/+13
| | | | | the %m into the errno and then vfprintf would expand the % and the first character of the strerror(3) return causing possible data corruption.
* Reset LogTag to NULL in closelog(3). This fixes mysterious crashesru2002-11-141-0/+1
| | | | | | | | | | | caused by dynamic PAM modules that call openlog(3) and closelog(3), e.g. ports/security/pam_pwdfile. What happened here is that the module first registered its "ident" with openlog(3), then PAM library unloaded module with dlclose(3), and the next call to syslog(3) resulted in SIGSEGV. MFC after: 3 days
* Assume __STDC__, remove non-__STDC__ code.alfred2002-05-281-15/+0
| | | | Submitted by: keramida
* Do not use __progname directly (except in [gs]etprogname(3)).markm2002-03-291-2/+4
| | | | | | Also, make an internal _getprogname() that is used only inside libc. For libc, getprogname(3) is a weak symbol in case a function of the same name is defined in userland.
* If syslog fails to talk to syslogd, then it tries to write a messagedwmalone2002-03-091-4/+4
| | | | | | | | | | | to the console in a final attempt to log something. Make this final attempt non-blocking so that a blocking console doesn't end up blocking process which attempt to syslog something. In particular, this means you should be able to su and fix the problem if the console becomes blocking. MFC after: 3 weeks
* * Remove __P and convert to ANSI prototypes.obrien2002-02-011-11/+9
| | | | | * Remove 'register'. (some functions had 7+ register functions...) * Fix SCM ID's.
* Use ctime_r to build the timestamp for syslog, so that we don'tdwmalone2002-01-251-2/+2
| | | | | | | | clobber a ctime buffer which is passed in. PR: 34022 Submitted by: Hartmut Brandt <brandt@fokus.gmd.de> MFC after: 2 weeks
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-241-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),jasone2000-01-271-6/+6
| | | | | | | | | | | | | | | | | just use _foo() <-- foo(). In the case of a libpthread that doesn't do call conversion (such as linuxthreads and our upcoming libpthread), this is adequate. In the case of libc_r, we still need three names, which are now _thread_sys_foo() <-- _foo() <-- foo(). Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(), nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo(). Remove all internal libc usage of: creat(), pause(), sleep(), system(), tcdrain(), wait(), and waitpid(). Make thread cancellation fully POSIX-compliant. Suggested by: deischen
* Add three-tier symbol naming in support of POSIX thread cancellationjasone2000-01-121-6/+6
| | | | | | points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read().
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Go back to version 1.16 - it was correct the way it was.brian1998-05-011-6/+6
| | | | Pointed out by: bde
* connect() returns -1 on error - not 0.brian1998-05-011-7/+7
|
* We don't need to NUL terminate our sun_path.brian1998-03-061-4/+3
| | | | Pointed out by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
* Nul terminate sockaddr_un::sun_pathbrian1998-03-061-3/+4
| | | | Suggested by: Theo de Raadt <deraadt@openbsd.org>
* Make SyslogAddr a sockaddr_un rather than a sockaddr.brian1998-03-051-10/+12
| | | | | This wasn't a problem in practice as PATH_LOG and PATH_OLDLOG are both < sizeof sockaddr::sa_data.
* Add backward compatibility so that static executables built onjdp1997-03-201-10/+23
| | | | | | | | modern FreeBSD systems will syslog properly on older systems that still name the logging socket "/dev/log". This includes pre-2.2 versions of FreeBSD as well as BSD/OS systems. If the connect to "/var/run/log" fails, the function now tries to connect to "/dev/log" as a fallback.
* Merge from Lite2:peter1997-03-111-2/+2
| | | | | filesystem include updates, duplicate group suppression, cleanups, filesystem whiteout support (unionfs), bidir popen().
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* General -Wall warning cleanup, part I.jkh1996-07-121-2/+2
| | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu>
* If the send() to the AF_UNIX socket to the syslogd fails, attempt topeter1996-03-021-18/+56
| | | | | | | | reconnect once using the saved openlog() parameters. This helps one of the system startup race conditions. If syslogd takes too long to get going, some daemons can fail the connection and forever log to the console even though the syslogd is running. That is ..unfortunate..
* Minor cleanup, mostly unused vars and missing #includes.phk1995-10-221-2/+2
|
* Add $Id$ since this version of the file has diverged from the BSD base apeter1995-10-211-1/+5
| | | | fair bit. I forgot to add it when I made the fixes some time ago.
* Fix the problem that I aroused with the last commit..peter1995-10-051-4/+10
| | | | | | | | | | | | | | | What was happening, is if syslogd was not running, syslog() would do a strcat("\r\n") on a non-null-terminated buffer, and write it to the console. This meant that sometimes extra characters could be written to the console during boot, depending on the stack contents. This totally avoids the potential problem by using writev() like the rest of the does, and avoid modifying the buffer after the trouble we've gone to to carefully protect it. This is actually a trivial fix, in spite of the long commit message.. :-) It only appeared during boot and shutdown with syslogd stopped.
* Fix security bugs with a "new approach", using stdio's powerful bufferpeter1995-09-151-18/+86
| | | | | | | | control hooks. It is similar to an unrolled multi-part snprintf(), in that a "FILE *" is attached to a string buffer. There is also an optimisation for the case where the syslog format string does not contain %m, which should improve performance of "informational" logging, like from ftpd.
* National date/time representation in syslog logfiles looks ugly,ache1995-08-291-2/+1
| | | | | change strftime to ctime. Logfiles must have default (english) date/time representation for access/view from various places.
* Fix bracket error for LogMaskache1995-05-021-1/+1
| | | | Submitted by: Ruslan Belkin <rus@home2.UA.net>
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+235
OpenPOWER on IntegriCloud