patchDotGNU Portable.NET - Patches: patch #3295, Fixed incorrect behaviour of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #3295: Fixed incorrect behaviour of _IL_InfoMethods_GetUserName

Submitter:  Carl-Adam Brengesjo <ptah>
Submitted:  Wed 18 Aug 2004 03:14:31 AM UTC
   
 
Category:  None Priority:  2
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Tue 31 Aug 2004 06:31:08 AM UTC, comment #1: 

Patch committed to CVS on 31st August 2004

Gopal.V <t3rmin4t0r>
Group administrator
Wed 18 Aug 2004 03:14:31 AM UTC, original submission:  

This patch fixes the username returned by _IL_InfoMethods_GetUserName (pnet/engine/lib_info.c). Currently the username returned is the string returned by the getlogin(3) function, but as this function returns "a pointer to a string containing the name of the user logged in on the controlling terminal of the process" and not the name associated with the effective uid.

This causes a sudo or su (or any other seteuid app) command to have our C# apps print the user who logged in to the terminal.

test.cs:
-----------------------
using System;
class Class
{
 public static void Main()
 {
  Console.WriteLine(Environment.UserName);
 }
}

expected output:
-----------------------
[ptah@odin dev]$ ilrun test.exe
ptah
[ptah@odin dev]$ sudo ilrun test.exe
Password:
root

output:
-----------------------
[ptah@odin dev]$ ilrun test.exe
ptah
[ptah@odin dev]$ sudo ilrun test.exe
Password:
ptah

I assume you can imagine all the confusion this behaviour can cause :-)

Anyways, here's a patch to engine/lib_info.c and configure.in to now fetch the euid.

Carl-Adam Brengesjo <ptah>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #7772:  carladam-040818.patch added by ptah (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-08-31 t3rmin4t0r StatusNone Done
    Open/ClosedOpen Closed
2004-08-18 ptah Attached File- Added carladam-040818.patch, #3577

Back to the top

Powered by Savane 3.15-94dd.
Corresponding source code