Commit graph

112 commits

Author SHA1 Message Date
Scott Reeves
a509f10f95 Core: Fix incorrect check of return value 2011-01-23 14:10:49 +00:00
Kees Cook
87fdbb544b core-util: ensure that we chmod only the dir we ourselves created 2010-05-08 14:19:08 +01:00
Lennart Poettering
f1af7a02d1 core-util: introduce generic function pa_strip() 2010-02-21 21:59:53 +01:00
Daniel Mack
937c587e77 fix a number of warnings
most of them were due to missing #ifdefs or wrong printf format type for
[s]size_t.
2010-01-05 22:46:13 +01:00
Lennart Poettering
2294642762 core: make cpuid code compile cleanly with 32bit PIC 2009-11-11 04:50:32 +01:00
Lennart Poettering
642c69bed8 core-util: add call to detect if we are called from within a VM 2009-11-05 03:22:15 +01:00
Lennart Poettering
8e94f65348 daemon: make sure pa has its own session and process group, but is not its leader so that we cannot acquire a tty ever 2009-10-31 02:43:47 +01:00
Lennart Poettering
168be3830a use pa_fopen_cloexec() where applicable 2009-10-30 04:54:19 +01:00
Lennart Poettering
752727a13d core-util: introduce pa_fopen_cloexec() 2009-10-30 04:20:24 +01:00
Lennart Poettering
a698ee3f52 core-util: make sure to enable FD_CLOEXEC unconditionally to cope with kernels that silently accept but ignore O_CLOEXEC 2009-10-30 04:16:59 +01:00
Lennart Poettering
65e7bc18a9 use cloexec wrappers wherever applicable 2009-10-30 03:32:38 +01:00
Lennart Poettering
9c1a98953f core-util: introduce FD_CLOEXEC wrappers for open/socket/pipe/accept 2009-10-30 03:30:42 +01:00
Tanu Kaskinen
019331d25b Merge branch 'master' into dbus-work
Conflicts:
	src/daemon/daemon-conf.c
2009-10-02 17:24:44 +03:00
Lennart Poettering
7b76ea3784 core-util: unify how we determine the temporary directory 2009-09-17 21:06:54 +02:00
Lennart Poettering
2d9168ceb3 Improve TMPDIR handling
Patch from 'jnelson',

http://pulseaudio.org/ticket/653
2009-09-17 20:58:36 +02:00
Lennart Poettering
31ae7deefa core-util: properly fill in exception array for pa_reset_sigs() (llvm-clang-analyzer) 2009-09-08 23:52:58 +02:00
Lennart Poettering
f5046759cd llvm-clang-analyzer: drop a few unnecessary assignments and other trivial fixes 2009-09-08 23:46:23 +02:00
Lennart Poettering
51fc1763a1 Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio 2009-09-02 04:06:04 +02:00
Lennart Poettering
297afadbef core-util: don't leak memory in pa_unset_env_recorded() 2009-09-02 04:05:34 +02:00
Lennart Poettering
767c7c7cf4 core-util: call dbus_connection_set_exit_on_disconnect() on shared busses to make sure dbus_shutdown() isn't fatal 2009-09-02 04:03:18 +02:00
Lennart Poettering
5f929963d1 core-util: add api for setting env vars and record them so that we can undo them n fork 2009-09-02 00:34:27 +02:00
Tanu Kaskinen
0ad2d55cbe Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts:
	src/modules/module-stream-restore.c
2009-08-30 20:07:31 +03:00
Andy Shevchenko
ae383539d7 core-util: Fix logic of pa_make_path_absolute()
Make it works as described in commentary (when fn is NULL, pa_assert(fn) could
break logic).
2009-08-28 17:12:26 +02:00
Tanu Kaskinen
2f3fc2f1d6 Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts:
	src/Makefile.am
2009-08-24 14:43:11 +03:00
Lennart Poettering
a0f01ddc95 port a few things over to use xmalloc and friends instead of low-level libc malloc/free directly 2009-08-23 21:49:37 +02:00
Ted Percival
15eb03a5b3 core: Add thread-safe group info functions with dynamic buffers
Provides getgrgid, getgrnam, getpwuid & getpwnam replacements that are
thread safe (a la getgrgid_r() and friends) that internally
handle allocating big-enough buffers to avoid ERANGE errors
on large users or groups.
2009-08-22 00:53:39 +02:00
Lennart Poettering
8a2a6b2004 adjust various data/library paths automatically if we are run from a build tree 2009-08-21 03:43:53 +02:00
Lennart Poettering
c5bd72509e core: check return value of getgrnam_r() instead of errno
According to POSIX getgrnam_r() returns the error code as return value,
and not in errno. Honour that.

Pointed out and inspired by a patch from Ted Percival.
2009-08-20 00:20:03 +02:00
Tanu Kaskinen
bcaba0b1b4 Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts:
	src/Makefile.am
	src/daemon/daemon-conf.c
	src/daemon/daemon.conf.in
	src/modules/module-stream-restore.c
	src/pulse/client-conf.c
	src/pulsecore/namereg.c
2009-08-16 21:25:48 +03:00
Lennart Poettering
ef176ecb62 core-util: move personality resetting into core-util 2009-08-12 21:36:52 +02:00
Lennart Poettering
49fd8ee72e core-util: replace remaining fixed size destination string functions by _malloc() versions
This helps portability to GNU/Hurd.

Patch originally from Samuel Thibault but modified.

Closes ticket #546
2009-08-01 02:03:22 +02:00
Lennart Poettering
c6ea9fecc9 core-util: rework pa_strlcpy() to not rely on strncpy()
strncpy() is very slow since it resets the entire destination buffer.
Replace usage of strncpy by memcpy().
2009-08-01 02:01:58 +02:00
Lennart Poettering
e5c2256e36 pipe: replace PIPE_BUF macro pa pa_pipe_buf call
This should help portability to platforms that lack PIPE_BUF. Based on a
patch from Samuel Thibault.

See ticket #546
2009-08-01 01:59:58 +02:00
Lennart Poettering
5a0ef5fd13 daemon: replace colons by dash in per-machine directory names for compat with weird filesystems 2009-07-23 19:12:53 +02:00
Tanu Kaskinen
9347e90fed Finish the Core dbus interface. 2009-07-21 00:02:27 +03:00
Diego Elio 'Flameeyes' Pettenò
1ca7603109 Add missing headers includes for FreeBSD.
This removes the implicit declarations of send() and pthread_sigmask().
2009-06-29 17:42:07 +02:00
Diego Elio 'Flameeyes' Pettenò
bce211e416 Rename the flock variable to f_lock.
flock() is a function on FreeBSD, and the variable shadowed its definition.
2009-06-29 17:41:57 +02:00
Diego Elio 'Flameeyes' Pettenò
6f44792806 Only declare saved_errno when it's going to be used (on Linux). 2009-06-29 17:41:45 +02:00
Lennart Poettering
bacc5ca6f4 core: use rtkit to acquire high-priority scheduling 2009-06-19 04:45:19 +02:00
Lennart Poettering
8474fd7c62 core: ask RealtimeKit for RT scheduling 2009-06-19 04:19:08 +02:00
Lennart Poettering
0fa1ddf838 core-util: implement pa_maybe_prefix_path() 2009-06-17 03:13:59 +02:00
Lennart Poettering
7fa05bea7e core-util: implement pa_split_spaces_strv() 2009-06-17 03:13:32 +02:00
Lennart Poettering
c5dbf754b5 core-util: implement pa_xstrfreev() 2009-06-17 03:13:01 +02:00
Lennart Poettering
759a9d0cc5 core-util: introduce pa_disable_sigpipe() 2009-05-26 00:02:29 +02:00
Lennart Poettering
e2aba1521a core-util: fall back to sysconf(_SC_OPEN_MAX) to find maximum file descriptor 2009-05-22 01:31:56 +02:00
Lennart Poettering
a8f0d7ec1e core-util: introduce pa_get_host_name_malloc() and pa_get_user_name_malloc() 2009-04-29 01:54:44 +02:00
Lennart Poettering
ad447d1468 core-util: handle EINTR already inside of pa_read/pa_write 2009-04-18 23:21:11 +02:00
Lennart Poettering
1d8da03886 core-util: filter utf8 in pa_machine_id() 2009-04-13 22:21:08 +02:00
Lennart Poettering
1b4e5f197a core-util: add pa_session_id() 2009-04-13 22:20:48 +02:00
Maarten Bosmans
8bcb9c6910 various spelling fixes 2009-04-04 02:27:13 +02:00