Skip to content

Commit

Permalink
lib: Merge libmisc into libshadow
Browse files Browse the repository at this point in the history
The separation was unnecessary, and caused build problems.  Let's go
wild and obliterate the library.  The files are moved to libshadow.

Scripted change:

$ find libmisc/ -type f \
| grep '\.[chy]$' \
| xargs mv -t lib;

Plus updating the Makefile and other references.  While at it, I've
sorted the sources lists.

Link: <#792>
Reported-by: David Seifert <soap@gentoo.org>
Cc: Sam James <sam@gentoo.org>
Cc: Christian Bricart <christian@bricart.de>
Cc: Michael Vetter <jubalh@iodoru.org>
Cc: Robert Förster <Dessa@gmake.de>
[ soap tested the Gentoo package ]
Tested-by: David Seifert <soap@gentoo.org>
Acked-by: David Seifert <soap@gentoo.org>
Cc: <lslebodn@fedoraproject.org>
Acked-by: Serge Hallyn <serge@hallyn.com>
Acked-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
  • Loading branch information
alejandro-colomar committed Aug 30, 2023
1 parent c34c260 commit a286dea
Show file tree
Hide file tree
Showing 91 changed files with 180 additions and 208 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ Makefile.in

/shadow.spec
/shadow-*.tar.*
/libmisc/getdate.c
/lib/getdate.c
/libsubid/subid.h
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

EXTRA_DIST = NEWS README TODO shadow.spec.in

SUBDIRS = libmisc lib
SUBDIRS = lib

if ENABLE_SUBIDS
SUBDIRS += libsubid
Expand Down
4 changes: 2 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

Check when RLOGIN is enabled if ruserok() exists

Move selinux_file_context out of libmisc/copydir.c
Move selinux_file_context out of lib/copydir.c

Review hardcoded root account?

review all call to strto

libmisc/cleanup_user.c
lib/cleanup_user.c
cleanup needed (cleanup_report_add_user* not used)


Expand Down
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,6 @@ AC_CONFIG_FILES([
man/uk/Makefile
man/zh_CN/Makefile
man/zh_TW/Makefile
libmisc/Makefile
lib/Makefile
libsubid/Makefile
libsubid/subid.h
Expand Down
125 changes: 112 additions & 13 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,117 @@ DEFS =

noinst_LTLIBRARIES = libshadow.la

if USE_PAM
LIBCRYPT_PAM = $(LIBCRYPT)
else
LIBCRYPT_PAM =
endif

AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir) $(ECONF_CPPFLAGS)

libshadow_la_CPPFLAGS = $(ECONF_CPPFLAGS)
if HAVE_VENDORDIR
libshadow_la_CPPFLAGS += -DVENDORDIR=\"$(VENDORDIR)\"
endif

libshadow_la_CPPFLAGS += -I$(top_srcdir)
libshadow_la_CFLAGS = $(LIBBSD_CFLAGS)
libshadow_la_CFLAGS = $(LIBBSD_CFLAGS) $(LIBCRYPT_PAM) $(LIBSYSTEMD)

libshadow_la_SOURCES = \
addgrps.c \
age.c \
agetpass.c \
alloc.c \
alloc.h \
audit_help.c \
basename.c \
bit.c \
bit.h \
chkname.c \
chkname.h \
chowndir.c \
chowntty.c \
cleanup.c \
cleanup_group.c \
cleanup_user.c \
commonio.c \
commonio.h \
console.c \
copydir.c \
csrand.c \
date_to_str.c \
defines.h \
encrypt.c \
entry.c \
env.c \
exitcodes.h \
faillog.h \
failure.c \
failure.h \
fields.c \
find_new_gid.c \
find_new_uid.c \
find_new_sub_gids.c \
find_new_sub_uids.c \
fputsx.c \
getdef.c \
getdef.h \
get_gid.c \
getlong.c \
get_pid.c \
get_uid.c \
getdate.h \
getdate.y \
getdef.c \
getdef.h \
getlong.c \
getgr_nam_gid.c \
getrange.c \
gettime.c \
getulong.c \
groupio.c \
groupmem.c \
groupio.h \
gshadow.c \
hushed.c \
idmapping.h \
idmapping.c \
isexpired.c \
limits.c \
list.c \
lockpw.c \
loginprompt.c \
mail.c \
mempcpy.c \
mempcpy.h \
motd.c \
myname.c \
nss.c \
nscd.c \
nscd.h \
shadowlog.c \
shadowlog.h \
shadowlog_internal.h \
sssd.c \
sssd.h \
obscure.c \
pam_defs.h \
pam_pass.c \
pam_pass_non_interactive.c \
port.c \
port.h \
prefix_flag.c \
prototypes.h \
pwauth.c \
pwauth.h \
pwio.c \
pwio.h \
pwd_init.c \
pwd2spwd.c \
pwdcheck.c \
pwmem.c \
remove_tree.c \
rlogin.c \
root_flag.c \
run_part.h \
run_part.c \
subordinateio.h \
subordinateio.c \
salt.c \
selinux.c \
semanage.c \
setugid.c \
setupenv.c \
sgetgrent.c \
sgetpwent.c \
sgetspent.c \
Expand All @@ -71,23 +124,69 @@ libshadow_la_SOURCES = \
shadow.c \
shadowio.c \
shadowio.h \
shadowlog.c \
shadowlog.h \
shadowlog_internal.h \
shadowmem.c \
shell.c \
spawn.c \
sssd.c \
sssd.h \
stpecpy.c \
stpecpy.h \
stpeprintf.c \
stpeprintf.h \
write_full.c
strtoday.c \
sub.c \
subordinateio.h \
subordinateio.c \
sulog.c \
ttytype.c \
tz.c \
ulimit.c \
user_busy.c \
valid.c \
write_full.c \
xgetpwnam.c \
xprefix_getpwnam.c \
xgetpwuid.c \
xgetgrnam.c \
xgetgrgid.c \
xgetspnam.c \
yesno.c

if WITH_TCB
libshadow_la_SOURCES += tcbfuncs.c tcbfuncs.h
endif

if WITH_BTRFS
libshadow_la_SOURCES += btrfs.c
endif

if ENABLE_LASTLOG
libshadow_la_SOURCES += log.c
endif

if ENABLE_LOGIND
libshadow_la_SOURCES += logind.c
else
libshadow_la_SOURCES += utmp.c
endif

if !WITH_LIBBSD
libshadow_la_SOURCES += \
freezero.h \
freezero.c \
readpassphrase.h \
readpassphrase.c
endif

# These files are unneeded for some reason, listed in
# order of appearance:
#
# sources for dbm support (not yet used)

EXTRA_DIST = \
.indent.pro \
gshadow_.h
gshadow_.h \
xgetXXbyYY.c
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/*
* prototypes.h
*
* prototypes of libmisc functions, and private lib functions.
* prototypes of some lib functions, and private lib functions.
*
* $Id$
*
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions libmisc/.indent.pro

This file was deleted.

105 changes: 0 additions & 105 deletions libmisc/Makefile.am

This file was deleted.

2 changes: 0 additions & 2 deletions libsubid/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ MISCLIBS = \

libsubid_la_LIBADD = \
$(top_builddir)/lib/libshadow.la \
$(top_builddir)/libmisc/libmisc.la \
$(MISCLIBS) -ldl

AM_CPPFLAGS = \
-I${top_srcdir}/lib \
-I${top_srcdir}/libmisc \
-DLOCALEDIR=\"$(datadir)/locale\"

0 comments on commit a286dea

Please sign in to comment.