r511: fix some const handling
authorAndrew Tridgell <tridge@samba.org>
Thu, 6 May 2004 07:33:28 +0000 (07:33 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:51:46 +0000 (12:51 -0500)
source/librpc/ndr/ndr_sec.c

index 3ea0f4e30373bf4c9e75d6a579d67d9bb08d4909..8c1c0c559787658f4b035abba4646c35d9db363a 100644 (file)
@@ -53,19 +53,19 @@ NTSTATUS ndr_push_dom_sid2(struct ndr_push *ndr, int ndr_flags, struct dom_sid *
 /*
   convert a dom_sid to a string
 */
-const char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
+char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
 {
        int i, ofs, maxlen;
        uint32 ia;
        char *ret;
        
        if (!sid) {
-               return "(NULL SID)";
+               return talloc_strdup(mem_ctx, "(NULL SID)");
        }
 
        maxlen = sid->num_auths * 11 + 25;
        ret = talloc(mem_ctx, maxlen);
-       if (!ret) return "(SID ERR)";
+       if (!ret) return talloc_strdup(mem_ctx, "(SID ERR)");
 
        ia = (sid->id_auth[5]) +
                (sid->id_auth[4] << 8 ) +