changeset 178:d4676ea1be88

2008-10-09 Omair Majid <omajid@redhat.com> Added FIXMEs for places where permissions should be checked
author Omair Majid <omajid@redhat.com>
date Thu, 09 Oct 2008 17:28:36 -0400
parents ea894778a6d0
children 63fe20298326
files src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java src/java/org/classpath/icedtea/pulseaudio/PulseAudioLine.java src/java/org/classpath/icedtea/pulseaudio/PulseAudioMixer.java src/java/org/classpath/icedtea/pulseaudio/PulseAudioPort.java src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourcePort.java src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetDataLine.java src/java/org/classpath/icedtea/pulseaudio/PulseAudioTargetPort.java
diffstat 9 files changed, 46 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 			throw new IllegalStateException("line already closed");
 		}
 
+		// FIXME security
+		
 		clipThread.interrupt();
 
 		try {
@@ -390,6 +392,8 @@
 	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);
--- 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 @@
 		if (isOpen) {
 			throw new IllegalStateException("Line is already open");
 		}
+		
+		// FIXME security
 
 		createStream(format);
 		addStreamListeners();
@@ -288,6 +290,8 @@
 					"Line must be open for close() to work");
 		}
 
+		// FIXME security
+		
 		synchronized (eventLoop.threadLock) {
 			stream.disconnect();
 		}
--- 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 @@
 		return isOpen;
 	}
 
-
-
 	public void removeLineListener(LineListener listener) {
 		lineListeners.remove(listener);
 	}
--- 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 @@
 	@Override
 	public Line getLine(Line.Info info) throws LineUnavailableException {
 
+		// FIXME security!
+		
 		if (!isLineSupported(info)) {
 			throw new IllegalArgumentException("Line unsupported: " + info);
 		}
@@ -363,6 +365,9 @@
 
 	@Override
 	public Line[] getSourceLines() {
+		
+		// FIXME security
+		
 		return (Line[]) sourceLines.toArray(new Line[0]);
 
 	}
@@ -387,6 +392,9 @@
 
 	@Override
 	public Line[] getTargetLines() {
+		
+		// FIXME security
+		
 		return (Line[]) targetLines.toArray(new TargetDataLine[0]);
 	}
 
@@ -473,6 +481,8 @@
 			throw new IllegalStateException("Mixer is not open; cant close");
 		}
 
+		// FIXME security
+		
 		eventLoopThread.interrupt();
 
 		try {
@@ -567,6 +577,8 @@
 			throw new IllegalStateException("Mixer is already open");
 		}
 
+		// FIXME security
+		
 		InetAddress addr = InetAddress.getAllByName(host)[0];
 
 		if (port != null) {
--- 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 @@
 		 * 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 @@
 
 	@Override
 	public void close() {
+		
+		// FIXME security 
+		
 		native_setVolume((float) 0);
 		isOpen = false;
 		fireLineEvent(new LineEvent(this, LineEvent.Type.CLOSE,
@@ -142,6 +147,9 @@
 
 	@Override
 	public void open() {
+		
+		// FIXME security
+		
 		native_setVolume(volume);
 		isOpen = true;
 		fireLineEvent(new LineEvent(this, LineEvent.Type.OPEN,
--- 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 @@
 	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 @@
 			throw new IllegalStateException("not open so cant close");
 		}
 
+		// FIXME security
+
 		writeInterrupted = true;
 
 		PulseAudioMixer parent = PulseAudioMixer.getInstance();
--- 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 void open() {
+		
+		
+		
 		super.open();
 		
 		PulseAudioMixer parent = PulseAudioMixer.getInstance();
--- 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 @@
 					"Line cant be closed if it isnt open");
 		}
 
+		// FIXME security
+		
 		PulseAudioMixer parentMixer = PulseAudioMixer.getInstance();
 		parentMixer.removeTargetLine(this);
 
@@ -88,6 +90,8 @@
 			throw new IllegalStateException("already open");
 		}
 
+		// FIXME security
+		
 		super.open(format, bufferSize);
 
 		/* initialize all the member variables */
--- 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 PulseAudioTargetPort(String name, EventLoop eventLoop) {
+		
 		super(name, eventLoop);
+		
 	}
 
 	public void open() {
+		
+		// FIXME security
+		
 		super.open();
 		
 		PulseAudioMixer parent = PulseAudioMixer.getInstance();
@@ -60,6 +65,8 @@
 	
 	public void close() {
 		
+		// FIXME
+		
 		PulseAudioMixer parent = PulseAudioMixer.getInstance();
 		parent.removeTargetLine(this);