public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: swagiaal: root can debug all processes fix for bz 6392.
@ 2008-04-10 15:48 swagiaal
  0 siblings, 0 replies; only message in thread
From: swagiaal @ 2008-04-10 15:48 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  935aa9bdc30ce8d177ee9439931bf941e30b6d1a (commit)
      from  c0e8255a2478510d01a4031eb8be43a21becfcee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 935aa9bdc30ce8d177ee9439931bf941e30b6d1a
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Thu Apr 10 11:46:02 2008 -0400

    swagiaal: root can debug all processes fix for bz 6392.
    
    frysk-gui/frysk/gui/monitor/ChangeLog
    +2008-04-10  Sami Wagiaalla  <swagiaal@redhat.com>
    +
    +	* GuiProc.java: updated isOwned() to allow all processes
    +	for root.
    +

-----------------------------------------------------------------------

Summary of changes:
 frysk-gui/frysk/gui/monitor/ChangeLog    |    5 ++
 frysk-gui/frysk/gui/monitor/GuiProc.java |   76 ++++++++++++++----------------
 2 files changed, 40 insertions(+), 41 deletions(-)

First 500 lines of diff:
diff --git a/frysk-gui/frysk/gui/monitor/ChangeLog b/frysk-gui/frysk/gui/monitor/ChangeLog
index 3670276..a857f69 100644
--- a/frysk-gui/frysk/gui/monitor/ChangeLog
+++ b/frysk-gui/frysk/gui/monitor/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-10  Sami Wagiaalla  <swagiaal@redhat.com>
+
+	* GuiProc.java: updated isOwned() to allow all processes
+	for root.
+
 2008-04-01  Andrew Cagney  <cagney@redhat.com>
 
 	* eventviewer/Event.java: Update to match PrintStackOptions.
diff --git a/frysk-gui/frysk/gui/monitor/GuiProc.java b/frysk-gui/frysk/gui/monitor/GuiProc.java
index 213e1c7..6c54c2a 100644
--- a/frysk-gui/frysk/gui/monitor/GuiProc.java
+++ b/frysk-gui/frysk/gui/monitor/GuiProc.java
@@ -50,10 +50,7 @@ package frysk.gui.monitor;
 
 import java.io.File;
 import java.util.HashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
-import frysk.gui.Gui;
 import frysk.proc.Manager;
 import frysk.proc.Proc;
 
@@ -66,7 +63,6 @@ public class GuiProc extends GuiCoreObjectWrapper{
 	public static final String PATH_NOT_FOUND = "*Could not retrieve path*";
 
 	private Proc proc;
-	private Logger errorLog = Logger.getLogger (Gui.ERROR_LOG_ID);
 	
 	private String executableName;
 	private String executablePath;
@@ -153,44 +149,42 @@ public class GuiProc extends GuiCoreObjectWrapper{
       }
     }
 	
-	/**
-	 * Returns wether this user owns this process
-	 * or not.
-     * Checks uid and gid.
-     * Checks if the given process is this frysk process if so
-     * returns false.
-     * Also checks that the user has acces to /pro/exe if not
-     * false is returned.
-     * Checks if this process is the init process, return false
-     * if so.
-	 * @return boolean; true of the user owns this
-	 * process, and can debug it false otherwise;
-	 */
-	public boolean isOwned(){
-	    boolean owned = false;
-	    if(this.getProc().getPid() == 1){
-		return false;
-	    }
-		try {
-			owned = (this.proc.getUID() == Manager.host.getSelf().getUID() ||
-					this.proc.getGID() == Manager.host.getSelf().getGID());
-                    
-            if (owned)
-              if (this.proc.getPid() == Manager.host.getSelf().getPid())
-                      owned = false;
-            
-            try{
-              proc.getExeFile().getSysRootedPath();
-            }catch(Exception e){
-              owned = false;
-              return owned;
-            }
-		} catch (Exception e) {
-			errorLog.log(Level.WARNING, "GuiProc.isOwned: Error checking host/proc ownership",e);
-		}
-		
-		return owned;
+    /**
+     * Returns wether this user owns this process or not.
+     * 
+     * - Checks uid and * gid.
+     * - Checks if the given process is this frysk process if so returns false.
+     * - Also checks that the user has acces to /pro/exe if not false is returned.
+     * - Checks if this process is the init process, return false if so.
+     * 
+     * @return boolean; true of the user owns this process, and can debug it
+     *         false otherwise;
+     */
+    public boolean isOwned() {
+	if (this.getProc().getPid() == 1) {
+	    return false;
+	}
+
+	if (this.proc.getPid() == Manager.host.getSelf().getPid()) {
+	    return false;
 	}
+
+	if (Manager.host.getSelf().getUID() == 0) {
+	    return true;
+	}
+
+	try {
+	    proc.getExeFile().getSysRootedPath();
+	} catch (Exception e) {
+	    return false;
+	}
+
+	if ((this.proc.getUID() == Manager.host.getSelf().getUID() || this.proc.getGID() == Manager.host.getSelf().getGID())) {
+	    return true;
+	}
+
+	return false;
+    }
 	
 	public String getFullExecutablePath(){
 	  this.setExecutablePath();


hooks/post-receive
--
frysk system monitor/debugger


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-10 15:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-10 15:48 [SCM] master: swagiaal: root can debug all processes fix for bz 6392 swagiaal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).