Access to a non local directory from a windows service (C/C++)
Hi,
Executed from a normal program
open("\\111.111.111.111\xyz",....
is working corectly.
But the same code executed in a windows service (system account) fails.
(Errno delieveres EACCES).
Have had anybody the same problem (and the solution) ?
Thanks
Re: Access to a non local directory from a windows service (C/C++)
I'm not security guru - but I believe you'll need to do some sort of "client impersonation".
http://msdn.microsoft.com/en-us/libr...90(VS.85).aspx
gg
Re: Access to a non local directory from a windows service (C/C++)
Quote:
But the same code executed in a windows service (system account) fails.
(Errno delieveres EACCES).
No surprise, since Win2000 the LocalSystem account is deprived of network access. And the solution might be the mentioned client impersonation (or the service running some user account allowed to access that shared folder).
But, you know what, accessing network files from service always seemed to me a sort of bad design. The enterprise-level data belong in database. :)
Re: Access to a non local directory from a windows service (C/C++)
@Igor, Codeplug
Thanks for your help
Re: Access to a non local directory from a windows service (C/C++)
a share marked as "null session share" might even be accessed by a service ...
regards
HoM