Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 216443 Details for
Bug 300929
dbus fixes for Interix
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Support the absurd interix pseudo-root uid 197108
dbus-1.3.0-interix-quirks.patch (text/plain), 6.26 KB, created by
Greg Turner
on 2010-01-14 03:34:29 UTC
(
hide
)
Description:
Support the absurd interix pseudo-root uid 197108
Filename:
MIME Type:
Creator:
Greg Turner
Created:
2010-01-14 03:34:29 UTC
Size:
6.26 KB
patch
obsolete
>diff -urN dbus-1.3.0.orig/bus/activation-helper.c dbus-1.3.0/bus/activation-helper.c >--- dbus-1.3.0.orig/bus/activation-helper.c 2010-01-09 06:31:59 -0800 >+++ dbus-1.3.0/bus/activation-helper.c 2010-01-09 06:30:42 -0800 >@@ -210,7 +210,13 @@ > > /* bail out unless we are setuid to user root */ > euid = geteuid(); >- if (euid != 0) >+ if (euid != >+ #ifdef __INTERIX >+ 197108 >+ #else >+ 0 >+ #endif >+ ) > { > dbus_set_error (error, DBUS_ERROR_SPAWN_PERMISSIONS_INVALID, > "not setuid root"); >diff -urN dbus-1.3.0.orig/dbus/dbus-auth-script.c dbus-1.3.0/dbus/dbus-auth-script.c >--- dbus.orig-1.3.0/dbus/dbus-auth-script.c 2009-07-16 07:01:01 -0700 >+++ dbus-1.3.0/dbus/dbus-auth-script.c 2010-01-09 06:30:44 -0800 >@@ -455,7 +455,13 @@ > else if (_dbus_string_starts_with_c_str (&line, > "ROOT_CREDENTIALS")) > { >- auth_set_unix_credentials (auth, 0, DBUS_PID_UNSET); >+ auth_set_unix_credentials (auth, >+ #ifdef __INTERIX >+ 197108 >+ #else >+ 0 >+ #endif >+ , DBUS_PID_UNSET); > } > else if (_dbus_string_starts_with_c_str (&line, > "SILLY_CREDENTIALS")) >diff -urN dbus-1.3.0/dbus/dbus-sysdeps-unix.c /net/./../home/Administrator/src/dbus-1.3.0/dbus/dbus-sysdeps-unix.c >--- dbus-1.3.0.orig/dbus/dbus-sysdeps-unix.c 2010-01-09 06:31:59 -0800 >+++ dbus-1.3.0/dbus/dbus-sysdeps-unix.c 2010-01-09 06:30:45 -0800 >@@ -1490,6 +1490,27 @@ > DBusCredentials *credentials, > DBusError *error) > { >+#ifdef __INTERIX >+ int bytes_read = 0; >+ DBusString buf; >+ if ( _dbus_string_init( &buf )) { >+ bytes_read = _dbus_read_socket(client_fd, &buf, 1); >+ if (bytes_read == 1) { >+ _dbus_verbose("got one byte from server"); >+ } else { >+ dbus_set_error (error, DBUS_ERROR_FAILED, >+ "Failed to read credentials byte"); >+ return FALSE; >+ } >+ _dbus_string_free(&buf); >+ } else { >+ _DBUS_SET_OOM(error); >+ return FALSE; >+ } >+ _dbus_credentials_add_from_current_process(credentials); /* w/e */ >+ _dbus_verbose("FIXME: Interix: got faked credentials from current process"); >+ return TRUE; >+#else > struct msghdr msg; > struct iovec iov; > char buf; >@@ -1704,6 +1725,7 @@ > } > > return TRUE; >+#endif /* __INTERIX */ > } > > /** >diff -urN dbus-1.3.0.orig/dbus/dbus-sysdeps-util-unix.c dbus-1.3.0/dbus/dbus-sysdeps-util-unix.c >--- dbus-1.3.0.orig/dbus/dbus-sysdeps-util-unix.c 2010-01-09 06:31:59 -0800 >+++ dbus-1.3.0/dbus/dbus-sysdeps-util-unix.c 2010-01-09 06:30:45 -0800 >@@ -361,7 +361,13 @@ > } > > #ifdef HAVE_LIBAUDIT >- we_were_root = _dbus_geteuid () == 0; >+ we_were_root = _dbus_get_euid() == >+ #ifdef __INTERIX >+ 197108 >+ #else >+ 0 >+ #endif >+ ; > new_caps = NULL; > /* have a tmp set of caps that we use to transition to the usr/grp dbus should > * run as ... doesn't really help. But keeps people happy. >@@ -757,6 +763,11 @@ > # error "buffer size for readdir_r cannot be determined" > # endif > # endif >+#ifdef __INTERIX >+ #define BFB 1024 /* big fine buffer */ >+ /* bah... just use a nice big value here, was causing stack corruption */ >+ name_max = name_max > BFB ? name_max : BFB; >+#endif > if (size) > *size = (size_t)offsetof(struct dirent, d_name) + name_max + 1; > else >diff -urN dbus-1.3.0.orig/dbus/dbus-transport.c dbus-1.3.0/dbus/dbus-transport.c >--- dbus-1.3.0.orig/dbus/dbus-transport.c 2009-07-16 07:01:03 -0700 >+++ dbus-1.3.0/dbus/dbus-transport.c 2010-01-09 06:30:45 -0800 >@@ -638,9 +638,13 @@ > } > > if (transport->allow_anonymous || >- _dbus_credentials_get_unix_uid (auth_identity) == 0 || >- _dbus_credentials_same_user (our_identity, >- auth_identity)) >+ _dbus_credentials_get_unix_uid (auth_identity) == >+ #ifdef __INTERIX >+ 197108 >+ #else >+ 0 >+ #endif >+ || _dbus_credentials_same_user (our_identity, auth_identity)) > { > if (_dbus_credentials_include(our_identity,DBUS_CREDENTIAL_WINDOWS_SID)) > _dbus_verbose ("Client authorized as SID '%s'" >diff -urN dbus-1.3.0.orig/test/data/auth/external-root.auth-script dbus-1.3.0/test/data/auth/external-root.auth-script >--- dbus-1.3.0.orig/test/data/auth/external-root.auth-script 2009-07-29 05:14:40 -0700 >+++ dbus-1.3.0/test/data/auth/external-root.auth-script 2010-01-09 06:30:47 -0800 >@@ -3,7 +3,7 @@ > SERVER > ROOT_CREDENTIALS > ## 30 is ASCII '0' in hex >-SEND 'AUTH EXTERNAL 30' >+SEND 'AUTH EXTERNAL 313937313038' > EXPECT_COMMAND OK > EXPECT_STATE WAITING_FOR_INPUT > SEND 'BEGIN' >diff -urN dbus-1.3.0.orig/test/data/valid-config-files/many-rules.conf dbus-1.3.0/test/data/valid-config-files/many-rules.conf >--- dbus-1.3.0.orig/test/data/valid-config-files/many-rules.conf 2009-07-29 05:14:40 -0700 >+++ dbus-1.3.0/test/data/valid-config-files/many-rules.conf 2010-01-09 06:30:47 -0800 >@@ -16,8 +16,8 @@ > <deny own="org.freedesktop.System"/> > <deny send_destination="org.freedesktop.System"/> > <deny receive_sender="org.freedesktop.System"/> >- <deny user="root"/> >- <deny group="root"/> >+ <deny user="Administrator"/> >+ <deny group="+Administrators"/> > <allow send_type="error"/> > <allow send_type="method_call"/> > <allow send_type="method_return"/> >@@ -34,8 +34,8 @@ > <deny own="org.freedesktop.System"/> > <deny send_destination="org.freedesktop.System"/> > <deny receive_sender="org.freedesktop.System"/> >- <deny user="root"/> >- <deny group="root"/> >+ <deny user="Administrator"/> >+ <deny group="+Administrators"/> > <allow send_type="error"/> > <allow send_type="method_call"/> > <allow send_type="method_return"/> >diff -urN dbus-1.3.0.orig/test/data/valid-config-files/system.d/test.conf dbus-1.3.0/test/data/valid-config-files/system.d/test.conf >--- dbus-1.3.0.orig/test/data/valid-config-files/system.d/test.conf 2009-07-29 05:14:40 -0700 >+++ dbus-1.3.0/test/data/valid-config-files/system.d/test.conf 2010-01-09 06:30:47 -0800 >@@ -7,7 +7,7 @@ > > <!-- Only root can own the FooService service, and > this user can only send the one kind of message --> >- <policy user="root"> >+ <policy user="Administrator"> > <allow own="org.foo.FooService"/> > <allow send_interface="org.foo.FooBroadcastInterface"/> > </policy>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 300929
:
216441
|
216442
| 216443 |
216444