sgroupio.h \
shadow/grp/agetgroups.c \
shadow/grp/agetgroups.h \
+ shadow/gshadow/endsgent.c \
+ shadow/gshadow/endsgent.h \
shadow/gshadow/gshadow.c \
shadow/gshadow/gshadow.h \
shadow/gshadow/putsgent.c \
#include "defines.h"
#include "exitcodes.h"
#include "prototypes.h"
+#include "shadow/gshadow/endsgent.h"
#ident "$Id$"
}
}
-void endsgent (void)
-{
- if (NULL != gshadow) {
- fclose(gshadow);
- }
-
- gshadow = NULL;
-}
-
/*@observer@*//*@null@*/struct sgrp *
sgetsgent(const char *s)
{
/*@observer@*//*@null@*/struct sgrp *sgetsgent (const char *);
/*@observer@*//*@null@*/struct sgrp *fgetsgent (/*@null@*/FILE *);
void setsgent (void);
-void endsgent (void);
#define GSHADOW "/etc/gshadow"
--- /dev/null
+// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
+// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
+// SPDX-FileCopyrightText: 2005, Tomasz Kłoczko
+// SPDX-FileCopyrightText: 2008-2009, Nicolas François
+// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#include "config.h"
+
+#include "shadow/gshadow/endsgent.h"
+
+#include <stddef.h>
+#include <stdio.h>
+
+#include "shadow/gshadow/gshadow.h"
+
+
+#if defined(SHADOWGRP) && !__has_include(<gshadow.h>)
+// end-working-with shadow group entries
+void
+endsgent(void)
+{
+ if (NULL != gshadow) {
+ fclose(gshadow);
+ }
+
+ gshadow = NULL;
+}
+#endif
--- /dev/null
+// SPDX-FileCopyrightText: 1988-1994, Julianne Frances Haugh
+// SPDX-FileCopyrightText: 1996-1997, Marek Michałkiewicz
+// SPDX-FileCopyrightText: 2003-2005, Tomasz Kłoczko
+// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#ifndef SHADOW_INCLUDE_LIB_SHADOW_GSHADOW_ENDSGENT_H_
+#define SHADOW_INCLUDE_LIB_SHADOW_GSHADOW_ENDSGENT_H_
+
+
+#include "config.h"
+
+
+#if __has_include(<gshadow.h>)
+# include <gshadow.h>
+#else
+void endsgent(void);
+#endif
+
+
+#endif // include guard
#include "getdef.h"
#include "prototypes.h"
#include "pwauth.h"
+#include "shadow/gshadow/endsgent.h"
#include "shadowlog.h"
#include "string/memset/memzero.h"
#include "string/sprintf/snprintf.h"
#include "search/l/lfind.h"
#include "search/l/lsearch.h"
#include "shadow/grp/agetgroups.h"
+#include "shadow/gshadow/endsgent.h"
#include "shadowlog.h"
#include "string/sprintf/snprintf.h"
#include "string/strcmp/streq.h"
#ifdef WITH_TCB
#include "tcbfuncs.h"
#endif
+#include "shadow/gshadow/endsgent.h"
#include "shadowlog.h"
#include "sssd.h"
#include "string/memset/memzero.h"