Commit graph

1040 commits

Author SHA1 Message Date
Tor Lillqvist
22e434ab67 Look for config files also in the normal Unix-style location (cherry picked from commit 445d1f780fb916f9087c0d95e7594ee5a425d43f) 2009-12-01 09:20:27 +01:00
Tor Lillqvist
db7717869a Use multi-byte string functions on Windows
Don't walk through char arrays that contain strings in the system
codepage char by char looking for '\\'. There are double-byte
characters in East Asian codepages where the second byte is a '\\'.
(cherry picked from commit 61316262da466993abbcba010c6bac90bb0b1d43)
2009-12-01 09:20:27 +01:00
Frank Osterfeld
0617102b4b Fixes to the nonce code
Cherry-picked from commit f9bc0f4bd036f6ede5d9850fb0f8587178c85f44 in
the dbus4win repository, slightly massaged to apply by tml@iki.fi.
2009-12-01 08:43:45 +01:00
Frank Osterfeld
9d27253f36 Fix IPv6 setup (the default on Vista)
Ensure that the right struct is passed.

Cherry-picked from commit 172d60d100d04e301e51ff475ada02007f1709dc in
the dbus4win repository by tml@iki.fi.
2009-12-01 08:43:43 +01:00
Frank Osterfeld
c8f73b36a5 Add api dox for nonce-tcp
Cherry-picked from commit e7a070db22ed4a84dc04a062255356c9f6c4c9c5 in
the dbus4win repository, trailing whitespace issues corrected by
tml@iki.fi.
2009-12-01 08:43:43 +01:00
Frank Osterfeld
fbd21dd097 Fixes to the nonce code
On Unix, we create a 700 subdir in /tmp only readable by the user, on
Windows we use the user-specific tmpdir and create the noncefile
directly.

Add NonceFile to abstract this behaviour and to delete the noncefile
and possibly tmpdir on shutdown.

Cherry-picked from commit 885f16b90c4f769ae29f432d0ed2a63bb2e4dab8 in
the dbus4win repository. Fixed to apply and correct whitespace issues
by tml@iki.fi.
2009-12-01 08:43:41 +01:00
Frank Osterfeld
b0091cf47e Improve error handling in nonce code
Replace errno (from assuan code) by DBusError. Errors are not passed
through dbus_accept_with_nonce atm, as the original _dbus_accept() has
no error arg either.

Cherry-picked from commit 8082e92bb3a6304362e730f8b6e324860e1bb26c in
the dbus4win repository, edited to apply and fix whitespace issues by
tml@iki.fi.
2009-12-01 08:43:38 +01:00
Frank Osterfeld
25ceeeb679 Cleanup of nonce code
Remove the write_file function and use the existing
_dbus_string_save_to_file, improve error handling

Cherry picked from commit 0f7b026d01be7e0fd444cdb56e5f9b7a5137a062 in
the dbus4win repository. Edited to apply and fix whitespace issues by
tml@iki.fi.
2009-12-01 08:43:37 +01:00
Frank Osterfeld
5e2a99c12c The current state of the nonce-tcp implementation
Merged and cleaned up patch from my [Frank Osterfeld's] local work
branch.

Cherry-picked from commit e2801eca57b2d9e09afd662ed5ef6fc83be73afc and
edited by tml@iki.fi to make it apply, and fixing whitespace issues.
2009-12-01 08:43:36 +01:00
Nguyễn Thái Ngọc Duy
a990f2507e Move some functions from dbus-sysdeps-util-win.c to dbus-sysdeps-win.c
These are used by dbus-sysdeps-win.c and it is not linked together
with dbus-sysdeps-util-win.c
(cherry picked from commit 24b612adbf8045b8b00af15f8d44eb38f964641f)
2009-12-01 08:38:04 +01:00
Nguyễn Thái Ngọc Duy
612e1b38f4 use WINDRES instead of RC to compile rc file
This is the way used by GTK+ and other packages. I don't know much about "RC" though.
(cherry picked from commit d5b993ebc1411b15e4563d05fbd92cf8b29cbb4c)
2009-12-01 08:38:03 +01:00
Nguyễn Thái Ngọc Duy
4c02c62621 remove dbus-uuidgen from Windows build (cherry picked from commit 73873e002ac9ba6159388b2c7b4190c30961ec68) 2009-12-01 08:38:02 +01:00
Marc Mutz
83387d2ae0 WIN32: add versioninfo, and export symbols
* dbus/versioninfo.rc.in: (new file) copied and modified from libgpg-error
 * configure.in: enable libtool's W32 support, extract version information
    for use in versioninfo.rc.in, define DBUS_WIN, define DBUS_UNIX only on
    unix (adapted from libgpg-error)
 * dbus/Makefile.am: switch sources depending on platform,
    compile versioninfo.rc, add dbus-1.def (not used since buildsystem creates
    its own .def file apparently)
(cherry picked from commit cfa717ddb7b9258a862d87cd5b3bdbe582ce106c)
2009-12-01 08:36:26 +01:00
Frank Osterfeld
01d2b26bed _dbus_get_install_root assumes that dbus-daemon is in a bin/ subdirectory. That's not a common directory structure on windows, so weaken the assumption: $somepath/bin/dbus-daemon.exe -> $somepath $somepath/dbus-daemon.exe, where somepath doesn't end in /bin/: -> $somepath i.e., use dbus-daemon.exe's directory as root if that directory is not a "bin" directory (cherry picked from commit 2d2055b2fa7f92c144e9a182a9a091ebe5215d7d) 2009-11-30 13:43:20 +01:00
Tor Lillqvist
7d931da812 dbus/dbus-sysdeps-win.c: _dbus_windows_user_is_process_owner belongs to -util-win.c (cherry picked from commit 952caf475334b7c38084d4a992abef3f4e0d4cfb) 2009-11-30 13:43:17 +01:00
Tor Lillqvist
07c63490d2 dbus/dbus-sysdeps-util-win.c: use GetFileAttributes instead of CreateFile in _dbus_file_exists (cherry picked from commit 3ba582b91361785c3eb0121e8b9e85d046eea75f) 2009-11-30 13:43:16 +01:00
Tor Lillqvist
fb11d1f9f3 dbus/dbus-sysdeps-win.c: tighter "scoping" for alternate _dbus_poll implementations (cherry picked from commit 6828a25073c16fb5af55c4aaf16a08eb90e4676d) 2009-11-30 13:43:15 +01:00
Ralf Habacker
e6f2be5f19 removed duplicated implementation 2009-11-30 13:24:42 +01:00
Tor Lillqvist
c366d25cf1 dbus/dbus-sysdeps-util-win.c: remove unused str*_s definitions (cherry picked from commit 373214317c33031547f3788cffed8a832142fc43) 2009-11-30 13:21:37 +01:00
Tor Lillqvist
8836d6c5bf dbus/dbus-sysdeps-*win.c: remove #undef open, which has no effect (cherry picked from commit 737e3782cd16424a6f1b941b64867178bb5634be) 2009-11-30 13:21:36 +01:00
Tor Lillqvist
ab7d00f2ed dbus/dbus-sysdeps-win.h: move declarations into .c (used nowhere else) (cherry picked from commit 0ea30b511e5b099c43bfdf2cbff0f3935917e057) 2009-11-30 13:21:35 +01:00
Tor Lillqvist
6f4bf6cc31 dbus/dbus-sysdeps-win.c: add _dbus_win_error_string, and use after MoveFileEx instead of _dbus_error_from_errno (cherry picked from commit 1d0b2dacf52faffbeba09af2b309683ccc71547a) 2009-11-30 13:21:34 +01:00
Tor Lillqvist
f28b7bb5a5 dbus/dbus-sysdeps-win.c: use MoveFileEx, not unlink+rename, in _dbus_string_save_to_file (cherry picked from commit c31bb3c262db1e6e42ec1bc9a6e8063c625a7cb2) 2009-11-30 13:21:33 +01:00
Tor Lillqvist
9ea9cd1bdd dbus/dbus-sysdeps-win.c: use GetTempPath, not getenv, in _dbus_get_tmpdir (cherry picked from commit c2366c5410149e896cb56c3d17bb995308e18292) 2009-11-30 13:21:32 +01:00
Tor Lillqvist
3b8aa7dc7c dbus/dbus-sysdeps-win.c: _dbus_getpid() returns dbus_pid_t (cherry picked from commit 40a01bf6d2c6d216093d309ca4c48602a585960b) 2009-11-30 13:21:31 +01:00
Tor Lillqvist
2df200caf9 dbus/dbus-sysdeps-win.c: set an error when _close fails in _dbus_pipe_close (cherry picked from commit 6671b4a20da468bad6842815a1161a98251b66fc) 2009-11-30 13:21:30 +01:00
Tor Lillqvist
22d12f61fa dbus/dbus-sysdeps-win.c: Use CryptoApi to get random numbers (cherry picked from commit 5f7ae46398818200b3fdcdfe80b78bee31a3e89b) 2009-11-30 13:21:30 +01:00
Tor Lillqvist
67a9fd2082 dbus/dbus-sysdeps-*win.c: remove DBusFile abstraction (cherry picked from commit 2895660b0e683d71dd51911819c0f31aff8517c3) 2009-11-30 13:21:28 +01:00
Tor Lillqvist
a549878e2d dbus/dbus-sysdeps-win.c: #define socklen_t -> typedef (cherry picked from commit eb104f4573fcbcbf3a87d673a023b5db4a249867) 2009-11-30 13:14:20 +01:00
Tor Lillqvist
8d61e82f91 dbus/dbus-sysdeps-win.h: add _dbus_win_get_dll-module (cherry picked from commit da5e8e14029cb64a65fe482e232be1d786a8ee19) 2009-11-30 13:14:19 +01:00
Tor Lillqvist
b9eae52cc0 dbus/dbus-spawn-win.c: implement missing _dbus_babysitter_get_child_exit_status (cherry picked from commit 7a9863b9847380dbb8400f895934d7f282ebdbf2) 2009-11-30 13:14:18 +01:00
Tor Lillqvist
8a7f49a51e dbus/dbus-internals.c: "#define inline" is only needed on MSVC, not mingw (cherry picked from commit 314e91e3ee2566477918a51dbddd9eb141b33a23) 2009-11-30 13:14:18 +01:00
Ralf Habacker
807fd7e731 _dbus_verbose_real: (optionally) use OutputDebugString() (cherry picked from commit fd6d354c47b4b8dc24ce32e31171568a8704e7d1) 2009-11-30 13:11:26 +01:00
Tor Lillqvist
230caac475 dbus/dbus-internals.h: 2x const char foo[] -> const char foo * (cherry picked from commit 62eaf8c91160abdeab6a46bb7bff737e13a390cf) 2009-11-30 12:21:28 +01:00
Tor Lillqvist
8c5456c337 dbus/dbus-transport.c: _dbus_credentials_get_windows_sid might return NULL (cherry picked from commit 8d8d5fa1babc8f51f1d1bb95b8116850978c60d9) 2009-11-30 12:21:27 +01:00
Tor Lillqvist
ef86bcedc8 dbus/dbus-transport.c: fix {our,auth}_identity mismatch (cherry picked from commit e15f1cde3b5893357f640e360f64c0a1ae37f93b) 2009-11-30 12:21:26 +01:00
Tor Lillqvist
2ca591df21 dbus/dbus-connection.c: use dbus_message_type_to_string instead of printing the naked message type (cherry picked from commit 33d858e83e3cb1f55ed257ffef930b8f49c3ffc7) 2009-11-30 12:04:58 +01:00
Ole André Vadla Ravnås
29e8f9917a Fix broken Windows implementation of _dbus_printf_string_upper_bound().
Pass the correct buffer size when trying again, and keep trying with
larger buffer sizes, doubling the size each time.
(cherry picked from commit 95832a94607eea609de994467b7d64e36af72e6b)
2009-11-30 12:04:58 +01:00
Ole André Vadla Ravnås
91f5972fa1 Use CreateDirectory() instead of complicating things.
This is Windows sysdeps after all, and _dbus_mkdir() wasn't used anywhere else.
(cherry picked from commit 0bbe3787ce1e9e992f2bcbbdfcab1dcdb0b41f24)
2009-11-30 12:00:20 +01:00
Ole André Vadla Ravnås
f2b62600dc Remove a misleading comment.
errno.h is present and needed on Windows. (It's not present on Windows CE though.)
(cherry picked from commit cef676c0c7ea8ad352e1ecf1c3643edb1abd7ad6)
2009-11-30 12:00:19 +01:00
Ole André Vadla Ravnås
93e213f332 Add missing stdio.h include needed for _vsnprintf(). (cherry picked from commit dddd412402657fa5ac6de225e8d5a00fb290589c) 2009-11-30 12:00:18 +01:00
Ole André Vadla Ravnås
b3da5a03a9 Only define _WIN32_WINNT if not already defined. (cherry picked from commit 98bb071819ab9f886317627b6688876f40ed694e) 2009-11-30 12:00:18 +01:00
Ole André Vadla Ravnås
2d0c9d37de Fix DBusMessage compiler warnings by adding some missing casts.
Basically the case where the address of a const pointer is passed as a non-const void pointer.
(cherry picked from commit dab3ec2abe7fbeea4dab873c8575a45b3b18882d)
2009-11-30 12:00:16 +01:00
Tor Lillqvist
5d0f9cc833 dbus/dbus-sysdeps-util-win.c: DBUS_WIN is always defined here (cherry picked from commit 1046f3b0eb57ef746aaff3a8da87020bb1b19a44) 2009-11-30 12:00:15 +01:00
Frank Osterfeld
7fac18bd15 be more verbose when locking the mutex fails (cherry picked from commit 4a14a050c4be026c7b9d67fd1f47c8479edebfc4) 2009-11-30 10:50:22 +01:00
Frank Osterfeld
09078aa134 do not call functions with side-effects inside assert (cherry picked from commit 0d0f443564403fedffd0450bed377230511ba0d7) 2009-11-30 10:50:21 +01:00
Christian Ehrlicher
a83b7cb80c fix deadlock when dbus-daemon could not start up
windbus:r811: apply patch by Thorvald Natvig to fix endless loop when _dbus_get_autolaunch_shm got called and the dbus-daemon failed to start up.
* if launching for some reason fails, set an error message
* _dbus_get_autolaunch_shm will abort getting the shared memory after 20 attempts (2 seconds)
* _dbus_get_autolaunch_address checks if the return state of WaitForInputIdle before calling _dbus_get_autolaunch_shm.

windbus:r812: remove WaitForInputIdle as it doesn't work in non-console mode
(cherry picked from commit 363fd736556219bad77c4b217e051b7983dc34e9)
2009-11-30 10:32:04 +01:00
Christian Ehrlicher
722a90c9cb all changes for dbus-1.2 API (cherry picked from commit 6734a3210a0705e3ab01ee123fac275799877353) 2009-11-30 10:23:54 +01:00
Christian Ehrlicher
e73985bb14 patch from Thorvald Natvig to fix a copy+paste error that could result in a dangling handle at windows.
based on windbus:r773
 (cherry picked from commit 97d0f058527c62ce3a2203b1632e742b10d5b7a9)
2009-11-30 10:17:50 +01:00
Peter Kümmel
7c62f972f3 no fake lock under Windows (cherry picked from commit 62cb039e40811a5881ee8dcc37c97103a848f74d) 2009-11-30 10:17:50 +01:00