File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ bool OSXPlatform::run_privileged()
3636 OSStatus err;
3737 AuthorizationFlags flags;
3838
39+ // FIXME: Throw exception if process is setuid but owner is not root! Right now this fails badly!
40+
3941 const char *path = this ->path ().c_str ();
4042
4143 flags = kAuthorizationFlagExtendRights | kAuthorizationFlagInteractionAllowed ;
@@ -103,4 +105,4 @@ vector<InterfaceInfo> OSXPlatform::interfaces()
103105 CFRelease (prefs);
104106
105107 return result;
106- }
108+ }
Original file line number Diff line number Diff line change @@ -58,8 +58,7 @@ class UnixPlatform : public AbstractPlatform
5858 m_path = string (path);
5959 }
6060
61- bool is_root ()
62- {
61+ bool is_root () {
6362 return geteuid () == 0 ;
6463 }
6564
@@ -71,7 +70,7 @@ class UnixPlatform : public AbstractPlatform
7170 if (err == -1 )
7271 throw runtime_error (" stat() failed" );
7372
74- return (file_stat.st_mode == MODE);
73+ return (file_stat.st_uid == 0 && file_stat. st_mode == MODE);
7574 }
7675
7776 void fix_permissions () {
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ FiresheepSession.prototype = {
4646 // FIXME: This should really use chmod(2) directly.
4747 Utils . runCommand ( 'chmod' , [ 'a+x' , this . _core . backendPath ] ) ;
4848
49- // Tell backend to repair owner/setuid. Wil return succesfully if everything is already OK.
49+ // Tell backend to repair owner/setuid. Will return succesfully if everything is already OK.
5050 this . _process = Cc [ "@codebutler.com/mozpopen/process;1" ] . createInstance ( Ci . IMozPopenProcess ) ;
5151 this . _process . Init ( this . _core . backendPath , [ '--fix-permissions' ] , 1 ) ;
5252 this . _process . Start ( ) ;
You can’t perform that action at this time.
0 commit comments