summaryrefslogtreecommitdiff
path: root/org
diff options
context:
space:
mode:
authorMatthew Johnson <mjj29@hecate.matthew.ath.cx>2008-01-11 02:33:47 +0000
committerMatthew Johnson <mjj29@hecate.matthew.ath.cx>2008-01-11 02:33:47 +0000
commit6f2e718d2955f8f371f19b5b03973b1656be7e7b (patch)
tree9207062943b9ec09d5a51e5a312e799e4a05fef1 /org
parent5095e190173cd068849c60c0ee54325ed1aa6c38 (diff)
work on bsd
Diffstat (limited to 'org')
-rw-r--r--org/freedesktop/dbus/Transport.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/org/freedesktop/dbus/Transport.java b/org/freedesktop/dbus/Transport.java
index 393717b..eceebd8 100644
--- a/org/freedesktop/dbus/Transport.java
+++ b/org/freedesktop/dbus/Transport.java
@@ -481,7 +481,10 @@ public class Transport
case MODE_CLIENT:
switch (state) {
case INITIAL_STATE:
- out.write(new byte[] { 0 });
+ if (null == us)
+ out.write(new byte[] { 0 });
+ else
+ us.sendCredentialByte((byte) 0);
send(out, COMMAND_AUTH);
state = WAIT_DATA;
break;
@@ -594,9 +597,14 @@ public class Transport
switch (state) {
case INITIAL_STATE:
byte[] buf = new byte[1];
- in.read(buf);
- if (null != us)
- kernelUid = stupidlyEncode(""+us.getPeerUID());
+ if (null == us) {
+ in.read(buf);
+ } else {
+ buf[0] = us.recvCredentialByte();
+ int kuid = us.getPeerUID();
+ if (kuid >= 0)
+ kernelUid = stupidlyEncode(""+kuid);
+ }
if (0 != buf[0]) state = FAILED;
else state = WAIT_AUTH;
break;