changeset in /hg/pulseaudio: 2008-10-09 Omair Majid <omajid at redh...

Omair Majid omajid at redhat.com
Fri Oct 10 08:10:37 PDT 2008


changeset d4676ea1be88 in /hg/pulseaudio
details: http://icedtea.classpath.org/hg/pulseaudio?cmd=changeset;node=d4676ea1be88
description:
	2008-10-09 Omair Majid <omajid at redhat.com>

	    Added FIXMEs for places where permissions should be checked

diffstat:

9 files changed, 46 insertions(+), 2 deletions(-)
src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java           |    4 +++
src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java       |    4 +++
src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java           |    2 -
src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java          |   12 ++++++++++
src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java           |    8 ++++++
src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java |    4 +++
src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java     |    3 ++
src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java |    4 +++
src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java     |    7 +++++

diffs (219 lines):

diff -r ea894778a6d0 -r d4676ea1be88 src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java
--- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java	Thu Oct 09 15:35:27 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java	Thu Oct 09 17:28:36 2008 -0400
@@ -233,6 +233,8 @@ public class PulseAudioClip extends Puls
 			throw new IllegalStateException("line already closed");
 		}
 
+		// FIXME security
+		
 		clipThread.interrupt();
 
 		try {
@@ -390,6 +392,8 @@ public class PulseAudioClip extends Puls
 	public void open(AudioFormat format, byte[] data, int offset, int bufferSize)
 			throws LineUnavailableException {
 
+		// FIXME security
+		
 		super.open(format);
 		this.data = new byte[bufferSize];
 		System.arraycopy(data, offset, this.data, 0, bufferSize);
diff -r ea894778a6d0 -r d4676ea1be88 src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java
--- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java	Thu Oct 09 15:35:27 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java	Thu Oct 09 17:28:36 2008 -0400
@@ -84,6 +84,8 @@ public abstract class PulseAudioDataLine
 		if (isOpen) {
 			throw new IllegalStateException("Line is already open");
 		}
+		
+		// FIXME security
 
 		createStream(format);
 		addStreamListeners();
@@ -288,6 +290,8 @@ public abstract class PulseAudioDataLine
 					"Line must be open for close() to work");
 		}
 
+		// FIXME security
+		
 		synchronized (eventLoop.threadLock) {
 			stream.disconnect();
 		}
diff -r ea894778a6d0 -r d4676ea1be88 src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java
--- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java	Thu Oct 09 15:35:27 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java	Thu Oct 09 17:28:36 2008 -0400
@@ -111,8 +111,6 @@ abstract class PulseAudioLine implements
 		return isOpen;
 	}
 
-
-
 	public void removeLineListener(LineListener listener) {
 		lineListeners.remove(listener);
 	}
diff -r ea894778a6d0 -r d4676ea1be88 src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java
--- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java	Thu Oct 09 15:35:27 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java	Thu Oct 09 17:28:36 2008 -0400
@@ -266,6 +266,8 @@ public class PulseAudioMixer implements 
 	@Override
 	public Line getLine(Line.Info info) throws LineUnavailableException {
 
+		// FIXME security!
+		
 		if (!isLineSupported(info)) {
 			throw new IllegalArgumentException("Line unsupported: " + info);
 		}
@@ -363,6 +365,9 @@ public class PulseAudioMixer implements 
 
 	@Override
 	public Line[] getSourceLines() {
+		
+		// FIXME security
+		
 		return (Line[]) sourceLines.toArray(new Line[0]);
 
 	}
@@ -387,6 +392,9 @@ public class PulseAudioMixer implements 
 
 	@Override
 	public Line[] getTargetLines() {
+		
+		// FIXME security
+		
 		return (Line[]) targetLines.toArray(new TargetDataLine[0]);
 	}
 
@@ -473,6 +481,8 @@ public class PulseAudioMixer implements 
 			throw new IllegalStateException("Mixer is not open; cant close");
 		}
 
+		// FIXME security
+		
 		eventLoopThread.interrupt();
 
 		try {
@@ -567,6 +577,8 @@ public class PulseAudioMixer implements 
 			throw new IllegalStateException("Mixer is already open");
 		}
 
+		// FIXME security
+		
 		InetAddress addr = InetAddress.getAllByName(host)[0];
 
 		if (port != null) {
diff -r ea894778a6d0 -r d4676ea1be88 src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java
--- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java	Thu Oct 09 15:35:27 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java	Thu Oct 09 17:28:36 2008 -0400
@@ -86,6 +86,8 @@ public abstract class PulseAudioPort ext
 		 * so we set it to be open by default
 		 */
 
+		
+		// TODO what to do if a security exception is thrown?
 		open();
 
 		// System.out.println("Opened Target Port " + name);
@@ -131,6 +133,9 @@ public abstract class PulseAudioPort ext
 
 	@Override
 	public void close() {
+		
+		// FIXME security 
+		
 		native_setVolume((float) 0);
 		isOpen = false;
 		fireLineEvent(new LineEvent(this, LineEvent.Type.CLOSE,
@@ -142,6 +147,9 @@ public abstract class PulseAudioPort ext
 
 	@Override
 	public void open() {
+		
+		// FIXME security
+		
 		native_setVolume(volume);
 		isOpen = true;
 		fireLineEvent(new LineEvent(this, LineEvent.Type.OPEN,
diff -r ea894778a6d0 -r d4676ea1be88 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
--- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java	Thu Oct 09 15:35:27 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java	Thu Oct 09 17:28:36 2008 -0400
@@ -67,6 +67,8 @@ public class PulseAudioSourceDataLine ex
 	synchronized public void open(AudioFormat format, int bufferSize)
 			throws LineUnavailableException {
 
+		// FIXME security
+
 		super.open(format, bufferSize);
 
 		volumeControl = new PulseAudioVolumeControl(this, eventLoop);
@@ -312,6 +314,8 @@ public class PulseAudioSourceDataLine ex
 			throw new IllegalStateException("not open so cant close");
 		}
 
+		// FIXME security
+
 		writeInterrupted = true;
 
 		PulseAudioMixer parent = PulseAudioMixer.getInstance();
diff -r ea894778a6d0 -r d4676ea1be88 src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java
--- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java	Thu Oct 09 15:35:27 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java	Thu Oct 09 17:28:36 2008 -0400
@@ -52,6 +52,9 @@ public class PulseAudioSourcePort extend
 	}
 
 	public void open() {
+		
+		
+		
 		super.open();
 		
 		PulseAudioMixer parent = PulseAudioMixer.getInstance();
diff -r ea894778a6d0 -r d4676ea1be88 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java
--- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java	Thu Oct 09 15:35:27 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java	Thu Oct 09 17:28:36 2008 -0400
@@ -75,6 +75,8 @@ public class PulseAudioTargetDataLine ex
 					"Line cant be closed if it isnt open");
 		}
 
+		// FIXME security
+		
 		PulseAudioMixer parentMixer = PulseAudioMixer.getInstance();
 		parentMixer.removeTargetLine(this);
 
@@ -88,6 +90,8 @@ public class PulseAudioTargetDataLine ex
 			throw new IllegalStateException("already open");
 		}
 
+		// FIXME security
+		
 		super.open(format, bufferSize);
 
 		/* initialize all the member variables */
diff -r ea894778a6d0 -r d4676ea1be88 src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java
--- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java	Thu Oct 09 15:35:27 2008 -0400
+++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java	Thu Oct 09 17:28:36 2008 -0400
@@ -48,10 +48,15 @@ public class PulseAudioTargetPort extend
 	}
 
 	public PulseAudioTargetPort(String name, EventLoop eventLoop) {
+		
 		super(name, eventLoop);
+		
 	}
 
 	public void open() {
+		
+		// FIXME security
+		
 		super.open();
 		
 		PulseAudioMixer parent = PulseAudioMixer.getInstance();
@@ -59,6 +64,8 @@ public class PulseAudioTargetPort extend
 	}
 	
 	public void close() {
+		
+		// FIXME
 		
 		PulseAudioMixer parent = PulseAudioMixer.getInstance();
 		parent.removeTargetLine(this);



More information about the distro-pkg-dev mailing list