[prev in list] [next in list] [prev in thread] [next in thread] 

List:       samba-technical
Subject:    Patch to fix a segfault while duping some security descriptors
From:       brendan powers <brendan0powers () gmail ! com>
Date:       2010-05-25 20:22:54
Message-ID: AANLkTinMj4DWPDppHveSnsoVeFujy_oCGYCyaMLTKjgN () mail ! gmail ! com
[Download RAW message or body]

I found a segfault when duplicating a security descriptor that was
missing sacls or dacls. I ran into this when a piece of my code wrote
a security descriptor for an LDAP user that had no sacls. After doing
that, checking or unchecking the "User cannot change password" option
in the AD admin tool would cause samba to crash.

I fixed this by checking if the acl was null in security_acl_dup
function, and returning NULL if that was the case.

["0001-libcli-Fixed-a-segfault-in-security_acl_dup-when-th.patch" (text/x-patch)]

From 54307fc9cdb4633c0cb5a397f1db39b06de14cd5 Mon Sep 17 00:00:00 2001
From: Brendan Powers <brendan0powers@gmail.com>
Date: Tue, 25 May 2010 16:14:37 -0400
Subject: [PATCH] libcli: Fixed a segfault in security_acl_dup when the acl is NULL. \
This can happen when duplicating a security descriptor that is missing either sacls \
or dacls.

---
 libcli/security/security_descriptor.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libcli/security/security_descriptor.c \
b/libcli/security/security_descriptor.c index b77a281..031f02e 100644
--- a/libcli/security/security_descriptor.c
+++ b/libcli/security/security_descriptor.c
@@ -55,6 +55,8 @@ struct security_acl *security_acl_dup(TALLOC_CTX *mem_ctx,
 {
 	struct security_acl *nacl;
 
+	if(oacl == NULL) return(NULL);
+
 	nacl = talloc (mem_ctx, struct security_acl);
 	if (nacl == NULL) {
 		return NULL;
-- 
1.5.4.3



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic