diff options
author | Pavel Březina <pbrezina@redhat.com> | 2015-10-07 13:47:18 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-10-08 20:57:49 +0200 |
commit | 3119225929463aecfbb1a7fc953263736955271e (patch) | |
tree | cecc33a16777959d02b6ecdde07a1b13ab225a14 /src/tools | |
parent | 220a4cbb7fcf30d954b2b4fecd62887373aa8764 (diff) | |
download | sssd-3119225929463aecfbb1a7fc953263736955271e.tar.gz sssd-3119225929463aecfbb1a7fc953263736955271e.tar.xz sssd-3119225929463aecfbb1a7fc953263736955271e.zip |
sss_override: steal msgs string to objs
Since msgs is attached to tmp_ctx then all the strings are freed
with tmp_ctx. Now steal the strings to objs.
Resolves:
https://fedorahosted.org/sssd/ticket/2826
Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/sss_override.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/sss_override.c b/src/tools/sss_override.c index 16b25b216..cf19e8287 100644 --- a/src/tools/sss_override.c +++ b/src/tools/sss_override.c @@ -1006,6 +1006,12 @@ list_user_overrides(TALLOC_CTX *mem_ctx, objs[i].home = ldb_msg_find_attr_as_string(msgs[i], SYSDB_HOMEDIR, NULL); objs[i].shell = ldb_msg_find_attr_as_string(msgs[i], SYSDB_SHELL, NULL); objs[i].gecos = ldb_msg_find_attr_as_string(msgs[i], SYSDB_GECOS, NULL); + + talloc_steal(objs, objs[i].orig_name); + talloc_steal(objs, objs[i].name); + talloc_steal(objs, objs[i].home); + talloc_steal(objs, objs[i].shell); + talloc_steal(objs, objs[i].gecos); } talloc_steal(mem_ctx, objs); @@ -1061,6 +1067,9 @@ list_group_overrides(TALLOC_CTX *mem_ctx, objs[i].name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); objs[i].gid = ldb_msg_find_attr_as_uint(msgs[i], SYSDB_GIDNUM, 0); + + talloc_steal(objs, objs[i].orig_name); + talloc_steal(objs, objs[i].name); } talloc_steal(mem_ctx, objs); |