/
niceSOFT
/
util-linux
Обзор
Документация
Войти
/
niceSOFT
/
util-linux
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/default_shell.c
28 строк
490 B
Karel Zak
lib: split ul_default_shell() from shells.c into default_shell.c
11 май 2026, 12:05
11 май 2026, 12:05
97cd9a7
Код
Авторство
О чём код?
/* * SPDX-License-Identifier: GPL-2.0-or-later */ #include <paths.h> #include "c.h" #include "default_shell.h" const char *ul_default_shell(int flags, const struct passwd *pw) { const char *shell = NULL; if (!(flags & UL_SHELL_NOENV)) { shell = getenv("SHELL"); if (shell && *shell) return shell; } if (!(flags & UL_SHELL_NOPWD)) { if (!pw) pw = getpwuid(getuid()); if (pw) shell = pw->pw_shell; if (shell && *shell) return shell; } return _PATH_BSHELL; }