Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead beef #1230

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ dnl Checks for libraries.
dnl shadow now uses the libc's shadow implementation
AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])

AC_CHECK_FUNCS(arc4random_buf futimes \
getentropy getrandom getspnam getusershell \
AC_CHECK_FUNCS(arc4random_buf \
getentropy getrandom \
lckpwdf lutimes \
updwtmpx innetgr \
getspnam_r \
Expand Down
5 changes: 2 additions & 3 deletions contrib/adduser.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
#define EXPIRE_VALS_SET /* If defined, 'normal' users can't change
* password expiry values (if running suid root) */

#define HAVE_GETUSERSHELL /* FIXME: Isn't this defined in config.h too? */
#define LOGGING /* If we want to log various things to syslog */
#define MAX_USRNAME 8 /* Longer usernames seem to work on my system....
* But they're probably a poor idea */
Expand Down Expand Up @@ -314,13 +313,13 @@ main (void)
{
char *sh;
int ok = 0;
#ifdef HAVE_GETUSERSHELL

setusershell ();
while ((sh = getusershell ()) != NULL)
if (streq(shell, sh))
ok = 1;
endusershell ();
#endif

if (!ok)
{
if (getuid () == 0)
Expand Down
1 change: 0 additions & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ libshadow_la_SOURCES = \
sgetspent.c \
sgroupio.c \
sgroupio.h\
shadow.c \
shadow/grp/agetgroups.c \
shadow/grp/agetgroups.h \
shadowio.c \
Expand Down
113 changes: 0 additions & 113 deletions lib/shadow.c

This file was deleted.

1 change: 0 additions & 1 deletion po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ lib/sgetgrent.c
lib/sgetpwent.c
lib/sgetspent.c
lib/sgroupio.c
lib/shadow.c
lib/shadowio.c
lib/shadowmem.c
lib/shell.c
Expand Down
26 changes: 1 addition & 25 deletions src/chsh.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ static bool shell_is_listed (const char *sh)
static bool shell_is_listed (const char *sh)
{
bool found = false;

#ifdef HAVE_GETUSERSHELL
char *cp;

setusershell ();
while ((cp = getusershell ())) {
if (streq(cp, sh)) {
Expand All @@ -207,30 +206,7 @@ static bool shell_is_listed (const char *sh)
}
}
endusershell ();
#else
char *buf = NULL;
FILE *fp;
size_t n = 0;

fp = fopen (SHELLS_FILE, "r");
if (NULL == fp) {
return false;
}

while (getline (&buf, &n, fp) != -1) {
if (buf[0] != '/') {
continue;
}

if (streq(buf, sh)) {
found = true;
break;
}
}

free(buf);
fclose (fp);
#endif
return found;
}
#endif /* with HAVE_VENDORDIR */
Expand Down
Loading