xref: /freebsd/sys/contrib/openzfs/lib/libspl/sid.c (revision 22649d4dba730d46244fd2dff4fd174903c8379f)
1 // SPDX-License-Identifier: CDDL-1.0
2 /*
3  * This file and its contents are supplied under the terms of the
4  * Common Development and Distribution License ("CDDL"), version 1.0.
5  * You may only use this file in accordance with the terms of version
6  * 1.0 of the CDDL.
7  *
8  * A full copy of the text of the CDDL should have accompanied this
9  * source.  A copy of the CDDL is also available via the Internet at
10  * https://opensource.org/license/CDDL-1.0.
11  */
12 /*
13  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
14  * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
15  * Copyright (c) 2016 Actifio, Inc. All rights reserved.
16  * Copyright (c) 2025, Klara, Inc.
17  */
18 
19 #include <sys/sid.h>
20 #include <umem.h>
21 
22 ksiddomain_t *
ksid_lookupdomain(const char * dom)23 ksid_lookupdomain(const char *dom)
24 {
25 	ksiddomain_t *kd;
26 
27 	kd = umem_zalloc(sizeof (ksiddomain_t), UMEM_NOFAIL);
28 	kd->kd_name = strdup(dom);
29 	return (kd);
30 }
31 
32 void
ksiddomain_rele(ksiddomain_t * ksid)33 ksiddomain_rele(ksiddomain_t *ksid)
34 {
35 	free(ksid->kd_name);
36 	umem_free(ksid, sizeof (ksiddomain_t));
37 }
38