Partially revert change from 2006-10-22. GetSecurityInfo messes up

user information on NT4.
	* sec_helper.cc (security_descriptor::malloc): Drop LocalAlloc
	considerations.
	(security_descriptor::realloc): Ditto.
	(security_descriptor::free): Ditto.
	* security.cc (get_reg_security): Reinstantiate.
	(get_nt_object_security): Revert to using NtQuerySecurityObject.
	* security.h (class security_descriptor): Drop type member.
	Accommodate throughout.
	(security_descriptor::size): Constify.
	(security_descriptor::copy): Ditto.
This commit is contained in:
Corinna Vinschen
2006-12-20 17:14:23 +00:00
parent 24fa638dbd
commit 97b09fe1c5
4 changed files with 87 additions and 45 deletions

View File

@ -216,21 +216,16 @@ class security_descriptor {
protected:
PSECURITY_DESCRIPTOR psd;
DWORD sd_size;
enum { local_alloced, malloced } type;
public:
security_descriptor () : psd (NULL), sd_size (0), type (local_alloced) {}
security_descriptor () : psd (NULL), sd_size (0) {}
~security_descriptor () { free (); }
PSECURITY_DESCRIPTOR malloc (size_t nsize);
PSECURITY_DESCRIPTOR realloc (size_t nsize);
void free ();
inline DWORD size () {
if (!sd_size && psd && type == local_alloced)
sd_size = LocalSize (psd);
return sd_size;
}
inline DWORD copy (void *buf, DWORD buf_size) {
inline DWORD size () const { return sd_size; }
inline DWORD copy (void *buf, DWORD buf_size) const {
if (buf_size < size ())
return sd_size;
memcpy (buf, psd, sd_size);