Showing posts with label log. Show all posts
Showing posts with label log. Show all posts

Saturday, March 24, 2012

permission denied error message

Hi,

We have a webservice that can log information to a text file on the local
machine. The ability to log information is configurable. The .net web service
is called from a vb dll. From the vb side of the fence, we're getting an
error message that indicates access is denied to the log file. The folder and
log file both have the asnet user set up with full control. Additionally the
parent folders have list access and read access for the user. The security
event log contains a record with the permissions being requested.

Additional info: the web service works on two other boxes with simular
configurations. The major difference is the box that doesn't work is in the
DMZ and does not have a domain controller.

Any ideas?

KenHi Ken,

In your webservice, do you allow or deny anonymous access?
if you don't deny anonymous access, you might need to
grant permossion to another account IUSR (Ineternet Guest
Account).

HTH

Elton Wang
elton_wang@.hotmail.com

>--Original Message--
>Hi,
>We have a webservice that can log information to a text
file on the local
>machine. The ability to log information is configurable.
The .net web service
>is called from a vb dll. From the vb side of the fence,
we're getting an
>error message that indicates access is denied to the log
file. The folder and
>log file both have the asnet user set up with full
control. Additionally the
>parent folders have list access and read access for the
user. The security
>event log contains a record with the permissions being
requested.
>Additional info: the web service works on two other boxes
with simular
>configurations. The major difference is the box that
doesn't work is in the
>DMZ and does not have a domain controller.
>Any ideas?
>Ken
>.

Wednesday, March 21, 2012

Permissions to call LogonUser

I have been troubleshooting writing a log file to a fileshare on
another machine... and I can't seem to find my way past the "Double
Hop" issue. I seem have narrowed it down to a failure of the
LogonUser call. On Windows 2000 with IIS 5 and ASP.NET 2.0 the
LogonUser call returns 0. From a Windows Forms client I can get the
LogonUser call to work fine (returns 1).
So what allows me to call LogonUser? Is there something I need to do
in the web.config or machine.config? I already tried the change where
you give ASPNET account the right to "Act as part of the OS".
Any other ideas? Articles? I'd like to get this working under IIS 5 if
possible.
Kelly Greer
kellygreer1@dotnet.itags.org.nospam.com
change nospam to yahooyou may need to revert to the process token, to allow impersonation.
RevertToSelf();
before calling logon
-- bruce (sqlwork.com)
"kellygreer1" wrote:

> I have been troubleshooting writing a log file to a fileshare on
> another machine... and I can't seem to find my way past the "Double
> Hop" issue. I seem have narrowed it down to a failure of the
> LogonUser call. On Windows 2000 with IIS 5 and ASP.NET 2.0 the
> LogonUser call returns 0. From a Windows Forms client I can get the
> LogonUser call to work fine (returns 1).
> So what allows me to call LogonUser? Is there something I need to do
> in the web.config or machine.config? I already tried the change where
> you give ASPNET account the right to "Act as part of the OS".
> Any other ideas? Articles? I'd like to get this working under IIS 5 if
> possible.
> Kelly Greer
> kellygreer1@.nospam.com
> change nospam to yahoo
>

Permissions to call LogonUser

I have been troubleshooting writing a log file to a fileshare on
another machine... and I can't seem to find my way past the "Double
Hop" issue. I seem have narrowed it down to a failure of the
LogonUser call. On Windows 2000 with IIS 5 and ASP.NET 2.0 the
LogonUser call returns 0. From a Windows Forms client I can get the
LogonUser call to work fine (returns 1).

So what allows me to call LogonUser? Is there something I need to do
in the web.config or machine.config? I already tried the change where
you give ASPNET account the right to "Act as part of the OS".

Any other ideas? Articles? I'd like to get this working under IIS 5 if
possible.

Kelly Greer
kellygreer1@dotnet.itags.org.nospam.com
change nospam to yahooyou may need to revert to the process token, to allow impersonation.

RevertToSelf();

before calling logon

-- bruce (sqlwork.com)

"kellygreer1" wrote:

Quote:

Originally Posted by

I have been troubleshooting writing a log file to a fileshare on
another machine... and I can't seem to find my way past the "Double
Hop" issue. I seem have narrowed it down to a failure of the
LogonUser call. On Windows 2000 with IIS 5 and ASP.NET 2.0 the
LogonUser call returns 0. From a Windows Forms client I can get the
LogonUser call to work fine (returns 1).
>
So what allows me to call LogonUser? Is there something I need to do
in the web.config or machine.config? I already tried the change where
you give ASPNET account the right to "Act as part of the OS".
>
Any other ideas? Articles? I'd like to get this working under IIS 5 if
possible.
>
Kelly Greer
kellygreer1@.nospam.com
change nospam to yahoo
>

Friday, March 16, 2012

Persistent Forms Authentication - and Session Variables

Hi All!
I'm doing an ASP.NET project which uses Persistent Forms Authentication
(i.e. once user logged in, they don't have to log in again). However Session
variables are erased after Session has timed out. So I need to re-populate
user specific session variables (such as user email, DOB, Full Name...etc)
when Session has ended.
But strangely, when I tried to do something like...
Dim strArrayUserInfo(10) as String
strArrayUserInfo(0) = drDataReader("FName").ToString
strArrayUserInfo(1) = drDataReader("LName").ToString
strArrayUserInfo(2) = drDataReader("Email").ToString
Session("UserInfoArray") = strArrayUserInfo
I get System.StackOverflowException. If I comment out that line, application
runs correctly but fail at the point where Session("UserInfoArray") is
accessed (i.e. Null Exception). So I de-comment the above code and I was
thrown System.StackOverflowException again.
What could be the problem? I was merely assigning a variable to Session
variable collection. Why ASP.NET throws System.StackOverflowException'
Thank you all in advance!!!!
Max"Max" <zero@.maxdot.com.com> wrote in message
news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Hi All!
> I'm doing an ASP.NET project which uses Persistent Forms Authentication
> (i.e. once user logged in, they don't have to log in again). However
> Session variables are erased after Session has timed out. So I need to
> re-populate user specific session variables (such as user email, DOB, Full
> Name...etc) when Session has ended.
> But strangely, when I tried to do something like...
> Dim strArrayUserInfo(10) as String
> strArrayUserInfo(0) = drDataReader("FName").ToString
> strArrayUserInfo(1) = drDataReader("LName").ToString
> strArrayUserInfo(2) = drDataReader("Email").ToString
> Session("UserInfoArray") = strArrayUserInfo
> I get System.StackOverflowException. If I comment out that line,
> application runs correctly but fail at the point where
> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
> de-comment the above code and I was thrown System.StackOverflowException
> again.
> What could be the problem? I was merely assigning a variable to Session
> variable collection. Why ASP.NET throws System.StackOverflowException'
I bet you have something else called "Session". Change the line to refer to
HttpContext.Current.Session and see if that's any better.
John Saunders
Hi John,
Thanks for the quick response! Unfortunately, I get the same error :(
Any ideas?
Max
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
> I bet you have something else called "Session". Change the line to refer
> to HttpContext.Current.Session and see if that's any better.
> John Saunders
>
"Max" <zero@.maxdot.com.com> wrote in message
news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Hi John,
> Thanks for the quick response! Unfortunately, I get the same error :(
Several ideas, none brilliant.
1) Simplify, simplify, simplify
1a) Instead of filling from the datareader, try setting the array elements
to constants. It's simpler.
1b) Try using Session("a"). It's simpler.
2) Are you setting all 10 elements of the array?
3) Turn Options Strict On.
John Saunders

> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>
Hi John,
I tried reducing the Array length to 3 and still it didn't work. This is a
mystery and a nightmare.
Max
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Several ideas, none brilliant.
> 1) Simplify, simplify, simplify
> 1a) Instead of filling from the datareader, try setting the array elements
> to constants. It's simpler.
> 1b) Try using Session("a"). It's simpler.
> 2) Are you setting all 10 elements of the array?
> 3) Turn Options Strict On.
> John Saunders
>
>
>
"Max" <zero@.maxdot.com.com> wrote in message
news:erNBq2U8EHA.2124@.TK2MSFTNGP14.phx.gbl...
> Hi John,
> I tried reducing the Array length to 3 and still it didn't work. This is a
> mystery and a nightmare.
Did you try using an array filled with constants? Did you try using
Session("a")? Have you turned Options Strict On?
John Saunders

> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
>

Persistent Forms Authentication - and Session Variables

Hi All!

I'm doing an ASP.NET project which uses Persistent Forms Authentication
(i.e. once user logged in, they don't have to log in again). However Session
variables are erased after Session has timed out. So I need to re-populate
user specific session variables (such as user email, DOB, Full Name...etc)
when Session has ended.

But strangely, when I tried to do something like...

Dim strArrayUserInfo(10) as String

strArrayUserInfo(0) = drDataReader("FName").ToString
strArrayUserInfo(1) = drDataReader("LName").ToString
strArrayUserInfo(2) = drDataReader("Email").ToString

Session("UserInfoArray") = strArrayUserInfo

I get System.StackOverflowException. If I comment out that line, application
runs correctly but fail at the point where Session("UserInfoArray") is
accessed (i.e. Null Exception). So I de-comment the above code and I was
thrown System.StackOverflowException again.

What could be the problem? I was merely assigning a variable to Session
variable collection. Why ASP.NET throws System.StackOverflowException??

Thank you all in advance!!!!

Max"Max" <zero@.maxdot.com.com> wrote in message
news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Hi All!
> I'm doing an ASP.NET project which uses Persistent Forms Authentication
> (i.e. once user logged in, they don't have to log in again). However
> Session variables are erased after Session has timed out. So I need to
> re-populate user specific session variables (such as user email, DOB, Full
> Name...etc) when Session has ended.
> But strangely, when I tried to do something like...
> Dim strArrayUserInfo(10) as String
> strArrayUserInfo(0) = drDataReader("FName").ToString
> strArrayUserInfo(1) = drDataReader("LName").ToString
> strArrayUserInfo(2) = drDataReader("Email").ToString
> Session("UserInfoArray") = strArrayUserInfo
> I get System.StackOverflowException. If I comment out that line,
> application runs correctly but fail at the point where
> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
> de-comment the above code and I was thrown System.StackOverflowException
> again.
> What could be the problem? I was merely assigning a variable to Session
> variable collection. Why ASP.NET throws System.StackOverflowException??

I bet you have something else called "Session". Change the line to refer to
HttpContext.Current.Session and see if that's any better.

John Saunders
Hi John,

Thanks for the quick response! Unfortunately, I get the same error :(

Any ideas?

Max

"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>> Hi All!
>>
>> I'm doing an ASP.NET project which uses Persistent Forms Authentication
>> (i.e. once user logged in, they don't have to log in again). However
>> Session variables are erased after Session has timed out. So I need to
>> re-populate user specific session variables (such as user email, DOB,
>> Full Name...etc) when Session has ended.
>>
>> But strangely, when I tried to do something like...
>>
>> Dim strArrayUserInfo(10) as String
>>
>> strArrayUserInfo(0) = drDataReader("FName").ToString
>> strArrayUserInfo(1) = drDataReader("LName").ToString
>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>
>> Session("UserInfoArray") = strArrayUserInfo
>>
>> I get System.StackOverflowException. If I comment out that line,
>> application runs correctly but fail at the point where
>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>> de-comment the above code and I was thrown System.StackOverflowException
>> again.
>>
>> What could be the problem? I was merely assigning a variable to Session
>> variable collection. Why ASP.NET throws System.StackOverflowException??
> I bet you have something else called "Session". Change the line to refer
> to HttpContext.Current.Session and see if that's any better.
> John Saunders
"Max" <zero@.maxdot.com.com> wrote in message
news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Hi John,
> Thanks for the quick response! Unfortunately, I get the same error :(

Several ideas, none brilliant.

1) Simplify, simplify, simplify
1a) Instead of filling from the datareader, try setting the array elements
to constants. It's simpler.
1b) Try using Session("a"). It's simpler.
2) Are you setting all 10 elements of the array?
3) Turn Options Strict On.

John Saunders

> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>> "Max" <zero@.maxdot.com.com> wrote in message
>> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>> Hi All!
>>>
>>> I'm doing an ASP.NET project which uses Persistent Forms Authentication
>>> (i.e. once user logged in, they don't have to log in again). However
>>> Session variables are erased after Session has timed out. So I need to
>>> re-populate user specific session variables (such as user email, DOB,
>>> Full Name...etc) when Session has ended.
>>>
>>> But strangely, when I tried to do something like...
>>>
>>> Dim strArrayUserInfo(10) as String
>>>
>>> strArrayUserInfo(0) = drDataReader("FName").ToString
>>> strArrayUserInfo(1) = drDataReader("LName").ToString
>>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>>
>>> Session("UserInfoArray") = strArrayUserInfo
>>>
>>> I get System.StackOverflowException. If I comment out that line,
>>> application runs correctly but fail at the point where
>>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>>> de-comment the above code and I was thrown System.StackOverflowException
>>> again.
>>>
>>> What could be the problem? I was merely assigning a variable to
>>> Session variable collection. Why ASP.NET throws
>>> System.StackOverflowException??
>>
>> I bet you have something else called "Session". Change the line to refer
>> to HttpContext.Current.Session and see if that's any better.
>>
>> John Saunders
>>
>>
Hi John,

I tried reducing the Array length to 3 and still it didn't work. This is a
mystery and a nightmare.

Max

"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
>> Hi John,
>>
>> Thanks for the quick response! Unfortunately, I get the same error :(
> Several ideas, none brilliant.
> 1) Simplify, simplify, simplify
> 1a) Instead of filling from the datareader, try setting the array elements
> to constants. It's simpler.
> 1b) Try using Session("a"). It's simpler.
> 2) Are you setting all 10 elements of the array?
> 3) Turn Options Strict On.
> John Saunders
>
>> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
>> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>> "Max" <zero@.maxdot.com.com> wrote in message
>>> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>>> Hi All!
>>>>
>>>> I'm doing an ASP.NET project which uses Persistent Forms Authentication
>>>> (i.e. once user logged in, they don't have to log in again). However
>>>> Session variables are erased after Session has timed out. So I need to
>>>> re-populate user specific session variables (such as user email, DOB,
>>>> Full Name...etc) when Session has ended.
>>>>
>>>> But strangely, when I tried to do something like...
>>>>
>>>> Dim strArrayUserInfo(10) as String
>>>>
>>>> strArrayUserInfo(0) = drDataReader("FName").ToString
>>>> strArrayUserInfo(1) = drDataReader("LName").ToString
>>>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>>>
>>>> Session("UserInfoArray") = strArrayUserInfo
>>>>
>>>> I get System.StackOverflowException. If I comment out that line,
>>>> application runs correctly but fail at the point where
>>>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>>>> de-comment the above code and I was thrown
>>>> System.StackOverflowException again.
>>>>
>>>> What could be the problem? I was merely assigning a variable to
>>>> Session variable collection. Why ASP.NET throws
>>>> System.StackOverflowException??
>>>
>>> I bet you have something else called "Session". Change the line to refer
>>> to HttpContext.Current.Session and see if that's any better.
>>>
>>> John Saunders
>>>
>>>
>>
>>
"Max" <zero@.maxdot.com.com> wrote in message
news:erNBq2U8EHA.2124@.TK2MSFTNGP14.phx.gbl...
> Hi John,
> I tried reducing the Array length to 3 and still it didn't work. This is a
> mystery and a nightmare.

Did you try using an array filled with constants? Did you try using
Session("a")? Have you turned Options Strict On?

John Saunders

> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
>> "Max" <zero@.maxdot.com.com> wrote in message
>> news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
>>> Hi John,
>>>
>>> Thanks for the quick response! Unfortunately, I get the same error :(
>>
>> Several ideas, none brilliant.
>>
>> 1) Simplify, simplify, simplify
>> 1a) Instead of filling from the datareader, try setting the array
>> elements to constants. It's simpler.
>> 1b) Try using Session("a"). It's simpler.
>> 2) Are you setting all 10 elements of the array?
>> 3) Turn Options Strict On.
>>
>> John Saunders
>>
>>
>>
>>> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
>>> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>>> "Max" <zero@.maxdot.com.com> wrote in message
>>>> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>>>> Hi All!
>>>>>
>>>>> I'm doing an ASP.NET project which uses Persistent Forms
>>>>> Authentication (i.e. once user logged in, they don't have to log in
>>>>> again). However Session variables are erased after Session has timed
>>>>> out. So I need to re-populate user specific session variables (such as
>>>>> user email, DOB, Full Name...etc) when Session has ended.
>>>>>
>>>>> But strangely, when I tried to do something like...
>>>>>
>>>>> Dim strArrayUserInfo(10) as String
>>>>>
>>>>> strArrayUserInfo(0) = drDataReader("FName").ToString
>>>>> strArrayUserInfo(1) = drDataReader("LName").ToString
>>>>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>>>>
>>>>> Session("UserInfoArray") = strArrayUserInfo
>>>>>
>>>>> I get System.StackOverflowException. If I comment out that line,
>>>>> application runs correctly but fail at the point where
>>>>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>>>>> de-comment the above code and I was thrown
>>>>> System.StackOverflowException again.
>>>>>
>>>>> What could be the problem? I was merely assigning a variable to
>>>>> Session variable collection. Why ASP.NET throws
>>>>> System.StackOverflowException??
>>>>
>>>> I bet you have something else called "Session". Change the line to
>>>> refer to HttpContext.Current.Session and see if that's any better.
>>>>
>>>> John Saunders
>>>>
>>>>
>>>
>>>
>>
>>