Microsoft KB Archive/893100

= FIX: The SenderID property of any messages that are sent to a message queue is always the identity of the first logged-on user when you use the System.Messaging namespace to send the messages in an ASP.NET application =

Article ID: 893100

Article Last Modified on 5/23/2007

-

APPLIES TO


 * Microsoft .NET Framework 1.1

-





SYMPTOMS
When you use the System.Messaging namespace to send messages to a message queue in a Microsoft ASP.NET application, the SenderID property of any messages that are sent to the message queue is always the identity of the first logged-on user. This problem occurs even when the ASP.NET application is configured to use impersonation.

For example, if the first user logs on to the ASP.NET application, the SenderID property of the message that is sent is the identity of the first user. If a second user logs on to the ASP.NET application and then sends a message, the SenderID property of the message that is sent is still the identity of the first user. With impersonation, you expect the SenderID property to be the second user.

Note In this case, even if the second user does not have sufficient permissions to send a message to the message queue, the message is still sent by using the credentials of the first user.



CAUSE
You cannot use current thread credentials for applications by using the System.Messaging namespace to send messages to Microsoft Message Queuing. Although Message Queuing exposes a set of APIs that can help you correctly perform impersonation, the System.Messaging namespace does not expose these APIs.

This problem occurs because the System.Messaging namespace caches the credentials of the first user who logs on to the ASP.NET application that uses impersonation. Unlike the current Message Queuing APIs, the APIs that help you use current thread credentials are not exposed through the System.Messaging namespace.



Service pack information
To resolve this problem, obtain the latest service pack for Windows Server 2003. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

889100 How to obtain the latest service pack for Windows Server 2003

Hotfix information
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next .NET Framework 1.1 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites
The .NET Framework 1.1 Service Pack 1 is required.

Restart requirement
You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information
This hotfix does not replace any other hotfixes.

File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.   Date         Time   Version        Size     File name 11-Apr-2005 16:45  1.1.4322.2314  245,760  System.messaging.dll



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Windows Server 2003 Service Pack 2.



MORE INFORMATION
This hotfix introduces a new API in the System.Messaging namespace. This new API lets you use the underlying Message Queuing object to use thread credentials for each message sent. To do this, you must add the following lines of code before you send the message to the message queue: // Obtain the security context of the current thread. SecurityContext context = MessageQueue.GetSecurityContext; // Set the context for the message to send with the current context. main_message.SecurityContext = context; //Send the message by using System.Messaging APIs. For more information about the System.Messaging namespace, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/system.messaging(vs.71).aspx

For more information about the standard terminology that is used to describe Microsoft software updates, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

Additional query words: MSMQ

Keywords: kbwinserv2003sp2fix kbqfe kbhotfixserver kbprogramming kbwebclasses kbnetframe110presp2fix kbbug kbfix kbprb KB893100

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.