From 4e4725f0f28f60af004efb6e481008715ef5a673 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 8 Jun 2019 13:17:36 +0200 Subject: [PATCH 1/1] nss: move NSS function definitions to separate header Documents which functions we provide and will be used for tests in the future. --- nss/cash_nss.h | 33 +++++++++++++++++++++++++++++++++ nss/pw.c | 3 +-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 nss/cash_nss.h diff --git a/nss/cash_nss.h b/nss/cash_nss.h new file mode 100644 index 0000000..c21142c --- /dev/null +++ b/nss/cash_nss.h @@ -0,0 +1,33 @@ +/* + * NSS function definitions provided by this NSS module + * + * Copyright (C) 2019 Simon Ruderich + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef CASH_NSS_H +#define CASH_NSS_H + +#include +#include + + +enum nss_status _nss_cash_setpwent(int); +enum nss_status _nss_cash_endpwent(void); +enum nss_status _nss_cash_getpwent_r(struct passwd *result, char *buffer, size_t buflen, int *errnop); +enum nss_status _nss_cash_getpwuid_r(uid_t uid, struct passwd *result, char *buffer, size_t buflen, int *errnop); +enum nss_status _nss_cash_getpwnam_r(const char *name, struct passwd *result, char *buffer, size_t buflen, int *errnop); + +#endif diff --git a/nss/pw.c b/nss/pw.c index 813b4f5..d2c1bfa 100644 --- a/nss/pw.c +++ b/nss/pw.c @@ -18,8 +18,6 @@ */ #include -#include -#include #include #include #include @@ -28,6 +26,7 @@ #include #include "cash.h" +#include "cash_nss.h" #include "file.h" #include "search.h" -- 2.45.2