]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - lib/shells.c
2 #include <sys/syslog.h>
3 #if defined (HAVE_LIBECONF) && defined (USE_VENDORDIR)
7 #include "closestream.h"
11 * is_known_shell() -- if the given shell appears in /etc/shells
12 * or vendor defined files.
13 * Return 1 if found and return 0 if not found.
15 extern int is_known_shell(const char *shell_name
)
19 #if defined (HAVE_LIBECONF) && defined (USE_VENDORDIR)
25 error
= econf_readDirs(&key_file
,
34 _("Cannot parse shells files: %s"),
35 econf_errString(error
));
39 error
= econf_getKeys(key_file
, NULL
, &size
, &keys
);
42 _("Cannot evaluate entries in shells files: %s"),
43 econf_errString(error
));
44 econf_free (key_file
);
48 for (size_t i
= 0; i
< size
; i
++) {
49 if (strcmp (keys
[i
], shell_name
) == 0) {
54 econf_free (key_file
);
62 while ((s
= getusershell())) {
63 if (*s
!= '#' && strcmp(shell_name
, s
) == 0) {