X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fstat.cpp;fp=source%2Ffs%2Fstat.cpp;h=d11867d99b6af41a427dba423673acc622390a65;hp=2419c2990c9bd9353f06e1ddcaf481afae6bb03e;hb=e14321c38b34ec1cc5641b267f031693a8f7bc27;hpb=efdd4ab5f33b444d3549543cbaf5372241c9cf73 diff --git a/source/fs/stat.cpp b/source/fs/stat.cpp index 2419c29..d11867d 100644 --- a/source/fs/stat.cpp +++ b/source/fs/stat.cpp @@ -110,16 +110,18 @@ Stat Stat::stat(const Path &path) result.mtime = Time::TimeStamp(Time::filetime_to_rawtime(info.ftLastWriteTime)); PSECURITY_DESCRIPTOR sec_desc; - PSID owner; - PSID group; + PSID owner = 0; + PSID group = 0; if(!GetSecurityInfo(handle, SE_FILE_OBJECT, OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION, &owner, &group, 0, 0, &sec_desc)) { CloseHandle(handle); throw system_error("GetSecurityInfo"); } - result.owner = get_account_name(owner); - result.group = get_account_name(group); + if(owner) + result.owner = get_account_name(owner); + if(group) + result.group = get_account_name(group); LocalFree(sec_desc);