* flock.cc (allow_others_to_sync): Reorder conditional expression to
check for DACL presence first, since otherwise dacl pointer value is undefined. Add comment.
This commit is contained in:
parent
b4ad7197fb
commit
56bed67046
|
@ -1,3 +1,9 @@
|
||||||
|
2012-03-02 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* flock.cc (allow_others_to_sync): Reorder conditional expression to
|
||||||
|
check for DACL presence first, since otherwise dacl pointer value is
|
||||||
|
undefined. Add comment.
|
||||||
|
|
||||||
2012-03-02 Corinna Vinschen <corinna@vinschen.de>
|
2012-03-02 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* flock.cc (allow_others_to_sync): Use RtlGetDaclSecurityDescriptor
|
* flock.cc (allow_others_to_sync): Use RtlGetDaclSecurityDescriptor
|
||||||
|
|
|
@ -178,16 +178,16 @@ allow_others_to_sync ()
|
||||||
is in self-relative format. */
|
is in self-relative format. */
|
||||||
BOOLEAN present, defaulted;
|
BOOLEAN present, defaulted;
|
||||||
RtlGetDaclSecurityDescriptor (sd, &present, &dacl, &defaulted);
|
RtlGetDaclSecurityDescriptor (sd, &present, &dacl, &defaulted);
|
||||||
if (dacl == NULL) /* Everyone has all access anyway */
|
if (!present) /* If so, dacl has undefined value. */
|
||||||
{
|
|
||||||
done = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (!present)
|
|
||||||
{
|
{
|
||||||
dacl = (PACL) (sd + 1);
|
dacl = (PACL) (sd + 1);
|
||||||
RtlCreateAcl (dacl, MAX_PROCESS_SD_SIZE - sizeof *sd, ACL_REVISION);
|
RtlCreateAcl (dacl, MAX_PROCESS_SD_SIZE - sizeof *sd, ACL_REVISION);
|
||||||
}
|
}
|
||||||
|
else if (dacl == NULL) /* Everyone has all access anyway */
|
||||||
|
{
|
||||||
|
done = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dacl->AclSize = MAX_PROCESS_SD_SIZE - ((PBYTE) dacl - (PBYTE) sd);
|
dacl->AclSize = MAX_PROCESS_SD_SIZE - ((PBYTE) dacl - (PBYTE) sd);
|
||||||
|
|
Loading…
Reference in New Issue