]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/user-record-nss.h
license: LGPL-2.1+ -> LGPL-2.1-or-later
[thirdparty/systemd.git] / src / shared / user-record-nss.h
CommitLineData
db9ecf05 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
9b2d9078
LP
2#pragma once
3
e60775cb
ZJS
4#include <grp.h>
5#include <gshadow.h>
9b2d9078
LP
6#include <pwd.h>
7#include <shadow.h>
8
e60775cb 9#include "group-record.h"
9b2d9078
LP
10#include "user-record.h"
11
e60775cb 12/* Synthesize UserRecord and GroupRecord objects from NSS data */
9b2d9078
LP
13
14int nss_passwd_to_user_record(const struct passwd *pwd, const struct spwd *spwd, UserRecord **ret);
15int nss_spwd_for_passwd(const struct passwd *pwd, struct spwd *ret_spwd, char **ret_buffer);
16
ed30170e
LP
17int nss_user_record_by_name(const char *name, bool with_shadow, UserRecord **ret);
18int nss_user_record_by_uid(uid_t uid, bool with_shadow, UserRecord **ret);
e60775cb
ZJS
19
20int nss_group_to_group_record(const struct group *grp, const struct sgrp *sgrp, GroupRecord **ret);
21int nss_sgrp_for_group(const struct group *grp, struct sgrp *ret_sgrp, char **ret_buffer);
22
23int nss_group_record_by_name(const char *name, bool with_shadow, GroupRecord **ret);
24int nss_group_record_by_gid(gid_t gid, bool with_shadow, GroupRecord **ret);