From 4cf7dcf8728548356f748d3fd016220a3f42c53d Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Tue, 12 Feb 2019 14:22:33 +0100 Subject: [PATCH] checkpoint subu-mk-0 compiles --- autom4te.cache/requests | 158 ++++++------ config.log | 66 +++++ src/.deps/dispatch.Po | 1 + src/.deps/dispatch.lib.Po | 231 +++++++++++++++++ src/.deps/dispatch_useradd.Po | 1 + ...{subu-mk-0.Tpo => dispatch_useradd.lib.Po} | 157 ++++++++---- src/.deps/subu-mk-0.Po | 135 +--------- src/.deps/subu-mk-0.cli.Po | 59 +++++ src/.deps/subu-mk-0.fi.Po | 1 + src/.deps/subu-mk-0.fi.Tpo | 178 +++++++++++++ src/.deps/subu-mk-0.lib.Po | 179 +++++++++++++ src/README.txt | 23 ++ src/dispatch.c | 52 ---- src/dispatch.lib.c | 59 +++++ src/{dispatch.h => dispatch.lib.h} | 4 +- src/dispatch_useradd.c | 42 --- src/dispatch_useradd.h | 23 -- src/dispatch_useradd.lib.c | 57 +++++ src/dispatch_useradd.lib.h | 24 ++ src/local_common.h | 1 + src/makefile | 32 ++- src/makefile.am | 8 +- src/makefile.in | 32 ++- src/old_makefile | 11 - src/{subu-mk-0.c => subu-mk-0.cli.c} | 5 +- src/subu-mk-0.fi.c | 183 ------------- src/subu-mk-0.lib.c | 242 ++++++++++++++++++ src/{subu-mk-0.fi.h => subu-mk-0.lib.h} | 12 +- {src => src_py}/subu-mk.py | 0 29 files changed, 1374 insertions(+), 602 deletions(-) create mode 100644 src/.deps/dispatch.Po create mode 100644 src/.deps/dispatch.lib.Po create mode 100644 src/.deps/dispatch_useradd.Po rename src/.deps/{subu-mk-0.Tpo => dispatch_useradd.lib.Po} (56%) create mode 100644 src/.deps/subu-mk-0.cli.Po create mode 100644 src/.deps/subu-mk-0.fi.Po create mode 100644 src/.deps/subu-mk-0.fi.Tpo create mode 100644 src/.deps/subu-mk-0.lib.Po create mode 100644 src/README.txt delete mode 100644 src/dispatch.c create mode 100644 src/dispatch.lib.c rename src/{dispatch.h => dispatch.lib.h} (62%) delete mode 100644 src/dispatch_useradd.c delete mode 100644 src/dispatch_useradd.h create mode 100644 src/dispatch_useradd.lib.c create mode 100644 src/dispatch_useradd.lib.h delete mode 100644 src/old_makefile rename src/{subu-mk-0.c => subu-mk-0.cli.c} (73%) delete mode 100644 src/subu-mk-0.fi.c create mode 100644 src/subu-mk-0.lib.c rename src/{subu-mk-0.fi.h => subu-mk-0.lib.h} (54%) rename {src => src_py}/subu-mk.py (100%) diff --git a/autom4te.cache/requests b/autom4te.cache/requests index b344d1e..024431f 100644 --- a/autom4te.cache/requests +++ b/autom4te.cache/requests @@ -34,47 +34,47 @@ 'configure.ac' ], { - 'AC_CONFIG_MACRO_DIR' => 1, - 'AM_AUX_DIR_EXPAND' => 1, - 'AC_DEFUN' => 1, + 'm4_include' => 1, + 'AM_MAKE_INCLUDE' => 1, '_AM_CONFIG_MACRO_DIRS' => 1, - 'AM_AUTOMAKE_VERSION' => 1, + 'm4_pattern_allow' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AM_SET_DEPDIR' => 1, + '_AM_SET_OPTIONS' => 1, + 'AM_SILENT_RULES' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_PROG_INSTALL_SH' => 1, + '_AM_SET_OPTION' => 1, + 'AM_CONDITIONAL' => 1, + 'AU_DEFUN' => 1, + '_m4_warn' => 1, 'AM_SANITY_CHECK' => 1, - 'AM_MAKE_INCLUDE' => 1, 'AM_SET_LEADING_DOT' => 1, - '_AM_PROG_TAR' => 1, + 'AM_AUX_DIR_EXPAND' => 1, 'AM_PROG_INSTALL_STRIP' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, '_AM_DEPENDENCIES' => 1, + 'include' => 1, 'AM_RUN_LOG' => 1, - 'AM_PROG_INSTALL_SH' => 1, - 'AM_PROG_CC_C_O' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + '_AM_SUBST_NOTMAKE' => 1, + '_AM_PROG_CC_C_O' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AC_CONFIG_MACRO_DIR' => 1, + 'AM_MISSING_PROG' => 1, 'AC_DEFUN_ONCE' => 1, - 'AM_CONDITIONAL' => 1, - '_AM_SET_OPTION' => 1, - 'm4_pattern_forbid' => 1, - 'AU_DEFUN' => 1, - 'include' => 1, - '_AM_IF_OPTION' => 1, - '_AM_MANGLE_OPTION' => 1, - '_m4_warn' => 1, + '_AM_PROG_TAR' => 1, + 'AM_PROG_CC_C_O' => 1, + '_AM_AUTOCONF_VERSION' => 1, 'AM_DEP_TRACK' => 1, - 'AM_SILENT_RULES' => 1, - '_AM_PROG_CC_C_O' => 1, - 'm4_include' => 1, + '_AM_IF_OPTION' => 1, 'AM_MISSING_HAS_RUN' => 1, - '_AM_SUBST_NOTMAKE' => 1, - '_AM_AUTOCONF_VERSION' => 1, - '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - '_AC_AM_CONFIG_HEADER_HOOK' => 1, - 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - 'AM_SET_DEPDIR' => 1, - 'AC_CONFIG_MACRO_DIR_TRACE' => 1, - 'm4_pattern_allow' => 1, - '_AM_SET_OPTIONS' => 1, 'AM_SUBST_NOTMAKE' => 1, - 'AM_MISSING_PROG' => 1 + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, + 'AC_DEFUN' => 1, + 'm4_pattern_forbid' => 1, + '_AM_MANGLE_OPTION' => 1 } ], 'Autom4te::Request' ), bless( [ @@ -89,65 +89,65 @@ 'configure.ac' ], { - 'AM_PROG_CXX_C_O' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + 'AC_CONFIG_LINKS' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_PROG_MOC' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'LT_SUPPORTED_TAG' => 1, 'AM_MAINTAINER_MODE' => 1, - 'm4_pattern_allow' => 1, - 'AC_CONFIG_HEADERS' => 1, - 'AC_FC_PP_SRCEXT' => 1, - 'LT_INIT' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AM_NLS' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'm4_pattern_forbid' => 1, + '_AM_COND_ELSE' => 1, 'm4_include' => 1, - 'AC_INIT' => 1, + 'AC_SUBST_TRACE' => 1, + 'AC_SUBST' => 1, '_AM_MAKEFILE_INCLUDE' => 1, - '_m4_warn' => 1, - 'AM_SILENT_RULES' => 1, - 'include' => 1, - 'AM_MAKEFILE_INCLUDE' => 1, - 'sinclude' => 1, - 'AC_CANONICAL_TARGET' => 1, - 'AM_PATH_GUILE' => 1, - 'm4_pattern_forbid' => 1, 'AC_REQUIRE_AUX_FILE' => 1, - '_AM_COND_ENDIF' => 1, - 'AM_CONDITIONAL' => 1, - '_LT_AC_TAGCONFIG' => 1, - 'AC_CONFIG_FILES' => 1, - 'AC_CANONICAL_HOST' => 1, - 'AC_FC_FREEFORM' => 1, - 'AC_CANONICAL_BUILD' => 1, - 'AM_PROG_MKDIR_P' => 1, - 'm4_sinclude' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'm4_pattern_allow' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, - 'AM_XGETTEXT_OPTION' => 1, - 'AM_EXTRA_RECURSIVE_TARGETS' => 1, - 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AM_NLS' => 1, + 'AC_CANONICAL_HOST' => 1, '_AM_COND_IF' => 1, - 'LT_SUPPORTED_TAG' => 1, - 'AC_SUBST_TRACE' => 1, - '_AM_COND_ELSE' => 1, - 'AM_ENABLE_MULTILIB' => 1, - '_AM_SUBST_NOTMAKE' => 1, - 'AH_OUTPUT' => 1, - 'AC_PROG_LIBTOOL' => 1, - 'AM_GNU_GETTEXT' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'AC_CONFIG_FILES' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AM_INIT_AUTOMAKE' => 1, 'AM_POT_TOOLS' => 1, - 'AC_SUBST' => 1, - 'AC_CONFIG_LIBOBJ_DIR' => 1, - 'AC_LIBSOURCE' => 1, - 'AC_FC_SRCEXT' => 1, + 'AM_CONDITIONAL' => 1, + '_m4_warn' => 1, + 'AM_PROG_MKDIR_P' => 1, 'AM_PROG_FC_C_O' => 1, - 'LT_CONFIG_LTDL_DIR' => 1, - 'AM_PROG_CC_C_O' => 1, + 'AC_FC_FREEFORM' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AC_FC_SRCEXT' => 1, + 'include' => 1, + '_AM_SUBST_NOTMAKE' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'sinclude' => 1, 'AC_FC_PP_DEFINE' => 1, - 'AM_INIT_AUTOMAKE' => 1, + 'AC_LIBSOURCE' => 1, + '_AM_COND_ENDIF' => 1, + 'AM_PATH_GUILE' => 1, + 'AH_OUTPUT' => 1, 'AM_PROG_F77_C_O' => 1, - 'AC_CONFIG_AUX_DIR' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AC_CONFIG_LINKS' => 1, - 'AC_CONFIG_SUBDIRS' => 1, - 'AC_CANONICAL_SYSTEM' => 1, + 'AC_INIT' => 1, + 'm4_sinclude' => 1, + 'AM_EXTRA_RECURSIVE_TARGETS' => 1, + 'LT_INIT' => 1, + 'AM_SILENT_RULES' => 1, + 'AC_CANONICAL_BUILD' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AM_GNU_GETTEXT' => 1, 'AM_PROG_AR' => 1, - 'AM_PROG_MOC' => 1 + 'AC_DEFINE_TRACE_LITERAL' => 1 } ], 'Autom4te::Request' ) ); diff --git a/config.log b/config.log index e889fa2..6429eb4 100644 --- a/config.log +++ b/config.log @@ -323,3 +323,69 @@ make[1]: Entering directory '/home/morpheus/subu_land/subu/src' make[1]: Nothing to be done for 'am--depfiles'. make[1]: Leaving directory '/home/morpheus/subu_land/subu/src' config.status:1151: $? = 0 + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by mk-subu-0 config.status 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status src/makefile depfiles + +on manorhouse + +config.status:840: creating src/makefile +config.status:1069: executing depfiles commands +config.status:1146: cd src && sed -e '/# am--include-marker/d' makefile | make -f - am--depfiles +make[1]: Entering directory '/home/morpheus/subu_land/subu/src' +make[1]: Leaving directory '/home/morpheus/subu_land/subu/src' +config.status:1151: $? = 0 + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by mk-subu-0 config.status 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status src/makefile depfiles + +on manorhouse + +config.status:840: creating src/makefile +config.status:1069: executing depfiles commands +config.status:1146: cd src && sed -e '/# am--include-marker/d' makefile | make -f - am--depfiles +make[1]: Entering directory '/home/morpheus/subu_land/subu/src' +make[1]: Leaving directory '/home/morpheus/subu_land/subu/src' +config.status:1151: $? = 0 + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by mk-subu-0 config.status 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status src/makefile depfiles + +on manorhouse + +config.status:840: creating src/makefile +config.status:1069: executing depfiles commands +config.status:1146: cd src && sed -e '/# am--include-marker/d' makefile | make -f - am--depfiles +make[1]: Entering directory '/home/morpheus/subu_land/subu/src' +make[1]: Leaving directory '/home/morpheus/subu_land/subu/src' +config.status:1151: $? = 0 diff --git a/src/.deps/dispatch.Po b/src/.deps/dispatch.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/src/.deps/dispatch.Po @@ -0,0 +1 @@ +# dummy diff --git a/src/.deps/dispatch.lib.Po b/src/.deps/dispatch.lib.Po new file mode 100644 index 0000000..d44351a --- /dev/null +++ b/src/.deps/dispatch.lib.Po @@ -0,0 +1,231 @@ +dispatch.lib.o: dispatch.lib.c /usr/include/stdc-predef.h \ + /usr/include/sys/types.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/bits/long-double.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/types/clock_t.h \ + /usr/include/bits/types/clockid_t.h /usr/include/bits/types/time_t.h \ + /usr/include/bits/types/timer_t.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h \ + /usr/include/bits/stdint-intn.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/uintn-identity.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/types/sigset_t.h \ + /usr/include/bits/types/__sigset_t.h \ + /usr/include/bits/types/struct_timeval.h \ + /usr/include/bits/types/struct_timespec.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/thread-shared-types.h \ + /usr/include/bits/pthreadtypes-arch.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/bits/getopt_posix.h \ + /usr/include/bits/getopt_core.h /usr/include/wait.h \ + /usr/include/sys/wait.h /usr/include/signal.h /usr/include/bits/signum.h \ + /usr/include/bits/signum-generic.h \ + /usr/include/bits/types/sig_atomic_t.h \ + /usr/include/bits/types/siginfo_t.h /usr/include/bits/types/__sigval_t.h \ + /usr/include/bits/siginfo-arch.h /usr/include/bits/siginfo-consts.h \ + /usr/include/bits/siginfo-consts-arch.h \ + /usr/include/bits/types/sigval_t.h /usr/include/bits/types/sigevent_t.h \ + /usr/include/bits/sigevent-consts.h /usr/include/bits/sigaction.h \ + /usr/include/bits/sigcontext.h /usr/include/bits/types/stack_t.h \ + /usr/include/sys/ucontext.h /usr/include/bits/sigstack.h \ + /usr/include/bits/ss_flags.h /usr/include/bits/types/struct_sigstack.h \ + /usr/include/bits/sigthread.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/stdlib.h \ + /usr/include/bits/libc-header-start.h /usr/include/bits/floatn.h \ + /usr/include/bits/floatn-common.h /usr/include/bits/types/locale_t.h \ + /usr/include/bits/types/__locale_t.h /usr/include/alloca.h \ + /usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \ + /usr/include/stdio.h /usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \ + /usr/include/bits/types/__fpos_t.h /usr/include/bits/types/__mbstate_t.h \ + /usr/include/bits/types/__fpos64_t.h /usr/include/bits/types/__FILE.h \ + /usr/include/bits/types/FILE.h /usr/include/bits/types/struct_FILE.h \ + /usr/include/bits/types/cookie_io_functions_t.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + /usr/include/bits/types/error_t.h local_common.h ../config.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h dispatch.lib.h + +/usr/include/stdc-predef.h: + +/usr/include/sys/types.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/bits/long-double.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/bits/types/clock_t.h: + +/usr/include/bits/types/clockid_t.h: + +/usr/include/bits/types/time_t.h: + +/usr/include/bits/types/timer_t.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h: + +/usr/include/bits/stdint-intn.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/bits/byteswap.h: + +/usr/include/bits/uintn-identity.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/types/sigset_t.h: + +/usr/include/bits/types/__sigset_t.h: + +/usr/include/bits/types/struct_timeval.h: + +/usr/include/bits/types/struct_timespec.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/bits/thread-shared-types.h: + +/usr/include/bits/pthreadtypes-arch.h: + +/usr/include/unistd.h: + +/usr/include/bits/posix_opt.h: + +/usr/include/bits/environments.h: + +/usr/include/bits/confname.h: + +/usr/include/bits/getopt_posix.h: + +/usr/include/bits/getopt_core.h: + +/usr/include/wait.h: + +/usr/include/sys/wait.h: + +/usr/include/signal.h: + +/usr/include/bits/signum.h: + +/usr/include/bits/signum-generic.h: + +/usr/include/bits/types/sig_atomic_t.h: + +/usr/include/bits/types/siginfo_t.h: + +/usr/include/bits/types/__sigval_t.h: + +/usr/include/bits/siginfo-arch.h: + +/usr/include/bits/siginfo-consts.h: + +/usr/include/bits/siginfo-consts-arch.h: + +/usr/include/bits/types/sigval_t.h: + +/usr/include/bits/types/sigevent_t.h: + +/usr/include/bits/sigevent-consts.h: + +/usr/include/bits/sigaction.h: + +/usr/include/bits/sigcontext.h: + +/usr/include/bits/types/stack_t.h: + +/usr/include/sys/ucontext.h: + +/usr/include/bits/sigstack.h: + +/usr/include/bits/ss_flags.h: + +/usr/include/bits/types/struct_sigstack.h: + +/usr/include/bits/sigthread.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/stdlib.h: + +/usr/include/bits/libc-header-start.h: + +/usr/include/bits/floatn.h: + +/usr/include/bits/floatn-common.h: + +/usr/include/bits/types/locale_t.h: + +/usr/include/bits/types/__locale_t.h: + +/usr/include/alloca.h: + +/usr/include/bits/stdlib-bsearch.h: + +/usr/include/bits/stdlib-float.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h: + +/usr/include/bits/types/__fpos_t.h: + +/usr/include/bits/types/__mbstate_t.h: + +/usr/include/bits/types/__fpos64_t.h: + +/usr/include/bits/types/__FILE.h: + +/usr/include/bits/types/FILE.h: + +/usr/include/bits/types/struct_FILE.h: + +/usr/include/bits/types/cookie_io_functions_t.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: + +/usr/include/errno.h: + +/usr/include/bits/errno.h: + +/usr/include/linux/errno.h: + +/usr/include/asm/errno.h: + +/usr/include/asm-generic/errno.h: + +/usr/include/asm-generic/errno-base.h: + +/usr/include/bits/types/error_t.h: + +local_common.h: + +../config.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h: + +dispatch.lib.h: diff --git a/src/.deps/dispatch_useradd.Po b/src/.deps/dispatch_useradd.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/src/.deps/dispatch_useradd.Po @@ -0,0 +1 @@ +# dummy diff --git a/src/.deps/subu-mk-0.Tpo b/src/.deps/dispatch_useradd.lib.Po similarity index 56% rename from src/.deps/subu-mk-0.Tpo rename to src/.deps/dispatch_useradd.lib.Po index cb4e27f..d8a0f45 100644 --- a/src/.deps/subu-mk-0.Tpo +++ b/src/.deps/dispatch_useradd.lib.Po @@ -1,36 +1,43 @@ -subu-mk-0.o: subu-mk-0.c /usr/include/stdc-predef.h /usr/include/stdio.h \ - /usr/include/bits/libc-header-start.h /usr/include/features.h \ +dispatch_useradd.lib.o: dispatch_useradd.lib.c /usr/include/stdc-predef.h \ + /usr/include/sys/types.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ /usr/include/bits/long-double.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/types/clock_t.h \ + /usr/include/bits/types/clockid_t.h /usr/include/bits/types/time_t.h \ + /usr/include/bits/types/timer_t.h \ /usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h \ - /usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/stdint-intn.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/uintn-identity.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/types/sigset_t.h \ + /usr/include/bits/types/__sigset_t.h \ + /usr/include/bits/types/struct_timeval.h \ + /usr/include/bits/types/struct_timespec.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/thread-shared-types.h \ + /usr/include/bits/pthreadtypes-arch.h /usr/include/stdlib.h \ + /usr/include/bits/libc-header-start.h /usr/include/bits/waitflags.h \ + /usr/include/bits/waitstatus.h /usr/include/bits/floatn.h \ + /usr/include/bits/floatn-common.h /usr/include/alloca.h \ + /usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/environments.h /usr/include/bits/confname.h \ + /usr/include/bits/getopt_posix.h /usr/include/bits/getopt_core.h \ + /usr/include/stdio.h /usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \ /usr/include/bits/types/__fpos_t.h /usr/include/bits/types/__mbstate_t.h \ /usr/include/bits/types/__fpos64_t.h /usr/include/bits/types/__FILE.h \ /usr/include/bits/types/FILE.h /usr/include/bits/types/struct_FILE.h \ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/bits/stdio.h subu-mk-0.fi.h useradd.fi.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/environments.h /usr/include/bits/confname.h \ - /usr/include/bits/getopt_posix.h /usr/include/bits/getopt_core.h \ - /usr/include/sys/types.h /usr/include/bits/types/clock_t.h \ - /usr/include/bits/types/clockid_t.h /usr/include/bits/types/time_t.h \ - /usr/include/bits/types/timer_t.h /usr/include/bits/stdint-intn.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/bits/uintn-identity.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/types/sigset_t.h /usr/include/bits/types/__sigset_t.h \ - /usr/include/bits/types/struct_timeval.h \ - /usr/include/bits/types/struct_timespec.h \ - /usr/include/bits/pthreadtypes.h /usr/include/bits/thread-shared-types.h \ - /usr/include/bits/pthreadtypes-arch.h + /usr/include/bits/stdio.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ + local_common.h ../config.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h dispatch.lib.h \ + dispatch_useradd.lib.h /usr/include/pwd.h /usr/include/stdc-predef.h: -/usr/include/stdio.h: - -/usr/include/bits/libc-header-start.h: +/usr/include/sys/types.h: /usr/include/features.h: @@ -44,35 +51,65 @@ subu-mk-0.o: subu-mk-0.c /usr/include/stdc-predef.h /usr/include/stdio.h \ /usr/include/gnu/stubs-64.h: +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/bits/types/clock_t.h: + +/usr/include/bits/types/clockid_t.h: + +/usr/include/bits/types/time_t.h: + +/usr/include/bits/types/timer_t.h: + /usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h: -/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h: +/usr/include/bits/stdint-intn.h: -/usr/include/bits/types.h: +/usr/include/endian.h: -/usr/include/bits/typesizes.h: +/usr/include/bits/endian.h: -/usr/include/bits/types/__fpos_t.h: +/usr/include/bits/byteswap.h: -/usr/include/bits/types/__mbstate_t.h: +/usr/include/bits/uintn-identity.h: -/usr/include/bits/types/__fpos64_t.h: +/usr/include/sys/select.h: -/usr/include/bits/types/__FILE.h: +/usr/include/bits/select.h: -/usr/include/bits/types/FILE.h: +/usr/include/bits/types/sigset_t.h: -/usr/include/bits/types/struct_FILE.h: +/usr/include/bits/types/__sigset_t.h: -/usr/include/bits/stdio_lim.h: +/usr/include/bits/types/struct_timeval.h: -/usr/include/bits/sys_errlist.h: +/usr/include/bits/types/struct_timespec.h: -/usr/include/bits/stdio.h: +/usr/include/bits/pthreadtypes.h: + +/usr/include/bits/thread-shared-types.h: + +/usr/include/bits/pthreadtypes-arch.h: + +/usr/include/stdlib.h: + +/usr/include/bits/libc-header-start.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: -subu-mk-0.fi.h: +/usr/include/bits/floatn.h: -useradd.fi.h: +/usr/include/bits/floatn-common.h: + +/usr/include/alloca.h: + +/usr/include/bits/stdlib-bsearch.h: + +/usr/include/bits/stdlib-float.h: /usr/include/unistd.h: @@ -86,40 +123,48 @@ useradd.fi.h: /usr/include/bits/getopt_core.h: -/usr/include/sys/types.h: +/usr/include/stdio.h: -/usr/include/bits/types/clock_t.h: +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h: -/usr/include/bits/types/clockid_t.h: +/usr/include/bits/types/__fpos_t.h: -/usr/include/bits/types/time_t.h: +/usr/include/bits/types/__mbstate_t.h: -/usr/include/bits/types/timer_t.h: +/usr/include/bits/types/__fpos64_t.h: -/usr/include/bits/stdint-intn.h: +/usr/include/bits/types/__FILE.h: -/usr/include/endian.h: +/usr/include/bits/types/FILE.h: -/usr/include/bits/endian.h: +/usr/include/bits/types/struct_FILE.h: -/usr/include/bits/byteswap.h: +/usr/include/bits/stdio_lim.h: -/usr/include/bits/uintn-identity.h: +/usr/include/bits/sys_errlist.h: -/usr/include/sys/select.h: +/usr/include/bits/stdio.h: -/usr/include/bits/select.h: +/usr/include/errno.h: -/usr/include/bits/types/sigset_t.h: +/usr/include/bits/errno.h: -/usr/include/bits/types/__sigset_t.h: +/usr/include/linux/errno.h: -/usr/include/bits/types/struct_timeval.h: +/usr/include/asm/errno.h: -/usr/include/bits/types/struct_timespec.h: +/usr/include/asm-generic/errno.h: -/usr/include/bits/pthreadtypes.h: +/usr/include/asm-generic/errno-base.h: -/usr/include/bits/thread-shared-types.h: +local_common.h: -/usr/include/bits/pthreadtypes-arch.h: +../config.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h: + +dispatch.lib.h: + +dispatch_useradd.lib.h: + +/usr/include/pwd.h: diff --git a/src/.deps/subu-mk-0.Po b/src/.deps/subu-mk-0.Po index a4c6461..951e02a 100644 --- a/src/.deps/subu-mk-0.Po +++ b/src/.deps/subu-mk-0.Po @@ -1,43 +1,22 @@ -subu-mk-0.o: subu-mk-0.c /usr/include/stdc-predef.h /usr/include/unistd.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/bits/long-double.h \ - /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ - /usr/include/bits/types.h /usr/include/bits/typesizes.h \ +subu-mk-0.o: subu-mk-0.c /usr/include/stdc-predef.h /usr/include/stdio.h \ + /usr/include/bits/libc-header-start.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/bits/long-double.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h \ /usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h \ - /usr/include/bits/confname.h /usr/include/bits/getopt_posix.h \ - /usr/include/bits/getopt_core.h /usr/include/sys/types.h \ - /usr/include/bits/types/clock_t.h /usr/include/bits/types/clockid_t.h \ - /usr/include/bits/types/time_t.h /usr/include/bits/types/timer_t.h \ - /usr/include/bits/stdint-intn.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ - /usr/include/bits/uintn-identity.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/types/sigset_t.h \ - /usr/include/bits/types/__sigset_t.h \ - /usr/include/bits/types/struct_timeval.h \ - /usr/include/bits/types/struct_timespec.h \ - /usr/include/bits/pthreadtypes.h /usr/include/bits/thread-shared-types.h \ - /usr/include/bits/pthreadtypes-arch.h /usr/include/stdio.h \ - /usr/include/bits/libc-header-start.h \ /usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ /usr/include/bits/types/__fpos_t.h /usr/include/bits/types/__mbstate_t.h \ /usr/include/bits/types/__fpos64_t.h /usr/include/bits/types/__FILE.h \ /usr/include/bits/types/FILE.h /usr/include/bits/types/struct_FILE.h \ - /usr/include/bits/types/cookie_io_functions_t.h \ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/bits/stdio.h /usr/include/stdlib.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/bits/floatn.h /usr/include/bits/floatn-common.h \ - /usr/include/bits/types/locale_t.h /usr/include/bits/types/__locale_t.h \ - /usr/include/alloca.h /usr/include/bits/stdlib-bsearch.h \ - /usr/include/bits/stdlib-float.h \ - /usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h /usr/include/pwd.h \ - /usr/include/string.h /usr/include/strings.h /usr/include/sys/stat.h \ - /usr/include/bits/stat.h /usr/include/bits/statx.h ../config.h + /usr/include/bits/stdio.h subu-mk-0.lib.h /usr/include/stdc-predef.h: -/usr/include/unistd.h: +/usr/include/stdio.h: + +/usr/include/bits/libc-header-start.h: /usr/include/features.h: @@ -51,66 +30,14 @@ subu-mk-0.o: subu-mk-0.c /usr/include/stdc-predef.h /usr/include/unistd.h \ /usr/include/gnu/stubs-64.h: -/usr/include/bits/posix_opt.h: +/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h: -/usr/include/bits/environments.h: +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h: /usr/include/bits/types.h: /usr/include/bits/typesizes.h: -/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h: - -/usr/include/bits/confname.h: - -/usr/include/bits/getopt_posix.h: - -/usr/include/bits/getopt_core.h: - -/usr/include/sys/types.h: - -/usr/include/bits/types/clock_t.h: - -/usr/include/bits/types/clockid_t.h: - -/usr/include/bits/types/time_t.h: - -/usr/include/bits/types/timer_t.h: - -/usr/include/bits/stdint-intn.h: - -/usr/include/endian.h: - -/usr/include/bits/endian.h: - -/usr/include/bits/byteswap.h: - -/usr/include/bits/uintn-identity.h: - -/usr/include/sys/select.h: - -/usr/include/bits/select.h: - -/usr/include/bits/types/sigset_t.h: - -/usr/include/bits/types/__sigset_t.h: - -/usr/include/bits/types/struct_timeval.h: - -/usr/include/bits/types/struct_timespec.h: - -/usr/include/bits/pthreadtypes.h: - -/usr/include/bits/thread-shared-types.h: - -/usr/include/bits/pthreadtypes-arch.h: - -/usr/include/stdio.h: - -/usr/include/bits/libc-header-start.h: - -/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h: - /usr/include/bits/types/__fpos_t.h: /usr/include/bits/types/__mbstate_t.h: @@ -123,46 +50,10 @@ subu-mk-0.o: subu-mk-0.c /usr/include/stdc-predef.h /usr/include/unistd.h \ /usr/include/bits/types/struct_FILE.h: -/usr/include/bits/types/cookie_io_functions_t.h: - /usr/include/bits/stdio_lim.h: /usr/include/bits/sys_errlist.h: /usr/include/bits/stdio.h: -/usr/include/stdlib.h: - -/usr/include/bits/waitflags.h: - -/usr/include/bits/waitstatus.h: - -/usr/include/bits/floatn.h: - -/usr/include/bits/floatn-common.h: - -/usr/include/bits/types/locale_t.h: - -/usr/include/bits/types/__locale_t.h: - -/usr/include/alloca.h: - -/usr/include/bits/stdlib-bsearch.h: - -/usr/include/bits/stdlib-float.h: - -/usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h: - -/usr/include/pwd.h: - -/usr/include/string.h: - -/usr/include/strings.h: - -/usr/include/sys/stat.h: - -/usr/include/bits/stat.h: - -/usr/include/bits/statx.h: - -../config.h: +subu-mk-0.lib.h: diff --git a/src/.deps/subu-mk-0.cli.Po b/src/.deps/subu-mk-0.cli.Po new file mode 100644 index 0000000..1381131 --- /dev/null +++ b/src/.deps/subu-mk-0.cli.Po @@ -0,0 +1,59 @@ +subu-mk-0.cli.o: subu-mk-0.cli.c /usr/include/stdc-predef.h \ + /usr/include/stdio.h /usr/include/bits/libc-header-start.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/bits/long-double.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/bits/types/__fpos_t.h /usr/include/bits/types/__mbstate_t.h \ + /usr/include/bits/types/__fpos64_t.h /usr/include/bits/types/__FILE.h \ + /usr/include/bits/types/FILE.h /usr/include/bits/types/struct_FILE.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h subu-mk-0.lib.h + +/usr/include/stdc-predef.h: + +/usr/include/stdio.h: + +/usr/include/bits/libc-header-start.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/bits/long-double.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/bits/types/__fpos_t.h: + +/usr/include/bits/types/__mbstate_t.h: + +/usr/include/bits/types/__fpos64_t.h: + +/usr/include/bits/types/__FILE.h: + +/usr/include/bits/types/FILE.h: + +/usr/include/bits/types/struct_FILE.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: + +subu-mk-0.lib.h: diff --git a/src/.deps/subu-mk-0.fi.Po b/src/.deps/subu-mk-0.fi.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/src/.deps/subu-mk-0.fi.Po @@ -0,0 +1 @@ +# dummy diff --git a/src/.deps/subu-mk-0.fi.Tpo b/src/.deps/subu-mk-0.fi.Tpo new file mode 100644 index 0000000..e3d9807 --- /dev/null +++ b/src/.deps/subu-mk-0.fi.Tpo @@ -0,0 +1,178 @@ +subu-mk-0.fi.o: subu-mk-0.fi.c /usr/include/stdc-predef.h \ + /usr/include/unistd.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/bits/wordsize.h /usr/include/bits/long-double.h \ + /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h \ + /usr/include/bits/confname.h /usr/include/bits/getopt_posix.h \ + /usr/include/bits/getopt_core.h /usr/include/sys/types.h \ + /usr/include/bits/types/clock_t.h /usr/include/bits/types/clockid_t.h \ + /usr/include/bits/types/time_t.h /usr/include/bits/types/timer_t.h \ + /usr/include/bits/stdint-intn.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/uintn-identity.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/types/sigset_t.h \ + /usr/include/bits/types/__sigset_t.h \ + /usr/include/bits/types/struct_timeval.h \ + /usr/include/bits/types/struct_timespec.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/thread-shared-types.h \ + /usr/include/bits/pthreadtypes-arch.h /usr/include/stdio.h \ + /usr/include/bits/libc-header-start.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \ + /usr/include/bits/types/__fpos_t.h /usr/include/bits/types/__mbstate_t.h \ + /usr/include/bits/types/__fpos64_t.h /usr/include/bits/types/__FILE.h \ + /usr/include/bits/types/FILE.h /usr/include/bits/types/struct_FILE.h \ + /usr/include/bits/types/cookie_io_functions_t.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/bits/floatn.h /usr/include/bits/floatn-common.h \ + /usr/include/bits/types/locale_t.h /usr/include/bits/types/__locale_t.h \ + /usr/include/alloca.h /usr/include/bits/stdlib-bsearch.h \ + /usr/include/bits/stdlib-float.h /usr/include/pwd.h \ + /usr/include/string.h /usr/include/strings.h /usr/include/sys/stat.h \ + /usr/include/bits/stat.h /usr/include/bits/statx.h ../config.h \ + dispatch.h local_common.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h dispatch_useradd.h \ + subu-mk-0.fi.h + +/usr/include/stdc-predef.h: + +/usr/include/unistd.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/bits/long-double.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/posix_opt.h: + +/usr/include/bits/environments.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h: + +/usr/include/bits/confname.h: + +/usr/include/bits/getopt_posix.h: + +/usr/include/bits/getopt_core.h: + +/usr/include/sys/types.h: + +/usr/include/bits/types/clock_t.h: + +/usr/include/bits/types/clockid_t.h: + +/usr/include/bits/types/time_t.h: + +/usr/include/bits/types/timer_t.h: + +/usr/include/bits/stdint-intn.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/bits/byteswap.h: + +/usr/include/bits/uintn-identity.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/types/sigset_t.h: + +/usr/include/bits/types/__sigset_t.h: + +/usr/include/bits/types/struct_timeval.h: + +/usr/include/bits/types/struct_timespec.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/bits/thread-shared-types.h: + +/usr/include/bits/pthreadtypes-arch.h: + +/usr/include/stdio.h: + +/usr/include/bits/libc-header-start.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h: + +/usr/include/bits/types/__fpos_t.h: + +/usr/include/bits/types/__mbstate_t.h: + +/usr/include/bits/types/__fpos64_t.h: + +/usr/include/bits/types/__FILE.h: + +/usr/include/bits/types/FILE.h: + +/usr/include/bits/types/struct_FILE.h: + +/usr/include/bits/types/cookie_io_functions_t.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/bits/floatn.h: + +/usr/include/bits/floatn-common.h: + +/usr/include/bits/types/locale_t.h: + +/usr/include/bits/types/__locale_t.h: + +/usr/include/alloca.h: + +/usr/include/bits/stdlib-bsearch.h: + +/usr/include/bits/stdlib-float.h: + +/usr/include/pwd.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/sys/stat.h: + +/usr/include/bits/stat.h: + +/usr/include/bits/statx.h: + +../config.h: + +dispatch.h: + +local_common.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h: + +dispatch_useradd.h: + +subu-mk-0.fi.h: diff --git a/src/.deps/subu-mk-0.lib.Po b/src/.deps/subu-mk-0.lib.Po new file mode 100644 index 0000000..133ce51 --- /dev/null +++ b/src/.deps/subu-mk-0.lib.Po @@ -0,0 +1,179 @@ +subu-mk-0.lib.o: subu-mk-0.lib.c /usr/include/stdc-predef.h \ + /usr/include/sys/types.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ + /usr/include/bits/long-double.h /usr/include/gnu/stubs.h \ + /usr/include/gnu/stubs-64.h /usr/include/bits/types.h \ + /usr/include/bits/typesizes.h /usr/include/bits/types/clock_t.h \ + /usr/include/bits/types/clockid_t.h /usr/include/bits/types/time_t.h \ + /usr/include/bits/types/timer_t.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h \ + /usr/include/bits/stdint-intn.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/bits/byteswap.h \ + /usr/include/bits/uintn-identity.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/types/sigset_t.h \ + /usr/include/bits/types/__sigset_t.h \ + /usr/include/bits/types/struct_timeval.h \ + /usr/include/bits/types/struct_timespec.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/thread-shared-types.h \ + /usr/include/bits/pthreadtypes-arch.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ + /usr/include/bits/confname.h /usr/include/bits/getopt_posix.h \ + /usr/include/bits/getopt_core.h /usr/include/stdio.h \ + /usr/include/bits/libc-header-start.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h \ + /usr/include/bits/types/__fpos_t.h /usr/include/bits/types/__mbstate_t.h \ + /usr/include/bits/types/__fpos64_t.h /usr/include/bits/types/__FILE.h \ + /usr/include/bits/types/FILE.h /usr/include/bits/types/struct_FILE.h \ + /usr/include/bits/types/cookie_io_functions_t.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/bits/stdio.h /usr/include/stdlib.h \ + /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ + /usr/include/bits/floatn.h /usr/include/bits/floatn-common.h \ + /usr/include/bits/types/locale_t.h /usr/include/bits/types/__locale_t.h \ + /usr/include/alloca.h /usr/include/bits/stdlib-bsearch.h \ + /usr/include/bits/stdlib-float.h /usr/include/pwd.h \ + /usr/include/string.h /usr/include/strings.h /usr/include/sys/stat.h \ + /usr/include/bits/stat.h /usr/include/bits/statx.h dispatch.lib.h \ + local_common.h ../config.h \ + /usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h \ + dispatch_useradd.lib.h subu-mk-0.lib.h + +/usr/include/stdc-predef.h: + +/usr/include/sys/types.h: + +/usr/include/features.h: + +/usr/include/sys/cdefs.h: + +/usr/include/bits/wordsize.h: + +/usr/include/bits/long-double.h: + +/usr/include/gnu/stubs.h: + +/usr/include/gnu/stubs-64.h: + +/usr/include/bits/types.h: + +/usr/include/bits/typesizes.h: + +/usr/include/bits/types/clock_t.h: + +/usr/include/bits/types/clockid_t.h: + +/usr/include/bits/types/time_t.h: + +/usr/include/bits/types/timer_t.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h: + +/usr/include/bits/stdint-intn.h: + +/usr/include/endian.h: + +/usr/include/bits/endian.h: + +/usr/include/bits/byteswap.h: + +/usr/include/bits/uintn-identity.h: + +/usr/include/sys/select.h: + +/usr/include/bits/select.h: + +/usr/include/bits/types/sigset_t.h: + +/usr/include/bits/types/__sigset_t.h: + +/usr/include/bits/types/struct_timeval.h: + +/usr/include/bits/types/struct_timespec.h: + +/usr/include/bits/pthreadtypes.h: + +/usr/include/bits/thread-shared-types.h: + +/usr/include/bits/pthreadtypes-arch.h: + +/usr/include/unistd.h: + +/usr/include/bits/posix_opt.h: + +/usr/include/bits/environments.h: + +/usr/include/bits/confname.h: + +/usr/include/bits/getopt_posix.h: + +/usr/include/bits/getopt_core.h: + +/usr/include/stdio.h: + +/usr/include/bits/libc-header-start.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h: + +/usr/include/bits/types/__fpos_t.h: + +/usr/include/bits/types/__mbstate_t.h: + +/usr/include/bits/types/__fpos64_t.h: + +/usr/include/bits/types/__FILE.h: + +/usr/include/bits/types/FILE.h: + +/usr/include/bits/types/struct_FILE.h: + +/usr/include/bits/types/cookie_io_functions_t.h: + +/usr/include/bits/stdio_lim.h: + +/usr/include/bits/sys_errlist.h: + +/usr/include/bits/stdio.h: + +/usr/include/stdlib.h: + +/usr/include/bits/waitflags.h: + +/usr/include/bits/waitstatus.h: + +/usr/include/bits/floatn.h: + +/usr/include/bits/floatn-common.h: + +/usr/include/bits/types/locale_t.h: + +/usr/include/bits/types/__locale_t.h: + +/usr/include/alloca.h: + +/usr/include/bits/stdlib-bsearch.h: + +/usr/include/bits/stdlib-float.h: + +/usr/include/pwd.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/sys/stat.h: + +/usr/include/bits/stat.h: + +/usr/include/bits/statx.h: + +dispatch.lib.h: + +local_common.h: + +../config.h: + +/usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h: + +dispatch_useradd.lib.h: + +subu-mk-0.lib.h: diff --git a/src/README.txt b/src/README.txt new file mode 100644 index 0000000..a9a2b21 --- /dev/null +++ b/src/README.txt @@ -0,0 +1,23 @@ + + +filename.tag.extension + +extension: + .c for C source + .cc for C++ source + .h for C header file + .hh for C++ header file + .o an object file + +tag: + .lib. The resulting .o file to be placed in release library and is part of the + programming interface. + .aux. The resulting.o file not directly part of the programming interface, but + it might be called by functions that are. + .cli. The source file has a main call and is to be relased as part of the command line interface + .loc. file has a main call to be made into a local uitlity function + +We carry the source file tag and extension to the .o file. We do not put tags +nor extensions on command line executables. + +local_common.h should be included in all source files diff --git a/src/dispatch.c b/src/dispatch.c deleted file mode 100644 index b6e122c..0000000 --- a/src/dispatch.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -fork/exec/wait a command - -if the error values returned by the exec'd program -are less than 1 << 16, then - -*/ - -#include -#include -#include -#include -#include -#include "local_common.h" -#include "dispatch.h" - -/* - returns -1 upon failure - - The wstatus returned from wait() might be either the error we returned when exec failed, - or the return value from the exec'ed process. We don't know what the possible return - values are from exec'ed process might be, so we have no way of multiplexing a unique - exec error code with it. - - specific dispatch versions can be made for specific functions. -*/ - - -int dispatch(char **argv, char **envp){ - if( !argv || !argv[0] ){ - fprintf(stderr, "argv[0] null on call to dispatch().\n"); - return -1; - } - pid_t pid = fork(void); - if( pid == -1 ){ - fprintf(stderr, "fork() failed in dispatch().\n"); - return -1; - } - if( pid == 0 ){ // we are the child - execvpe(argv[0], argv, envp); - // exec will only return if it has an error .. - perror(command); - return -1; - }else{ // we are the parent - int wstatus; - wait(1, &wstatus, 0); - if(wstatus) - return -1; - else - return 0; - } -} diff --git a/src/dispatch.lib.c b/src/dispatch.lib.c new file mode 100644 index 0000000..dd1fa0e --- /dev/null +++ b/src/dispatch.lib.c @@ -0,0 +1,59 @@ +/* +fork/exec/wait a command + +if the error values returned by the exec'd program +are less than 1 << 16, then + +*/ + +// without this #define execvpe is undefined +#define _GNU_SOURCE +#include +#include + +#include +#include +#include +#include +#include "local_common.h" +#include "dispatch.lib.h" + + + +/* + Execs the command passed in argv[0]; + Returns -1 upon failure. + + The wstatus returned from wait() might be either the error we returned when + exec failed, or the return value from the command. An arbitary command is + passed in, so we don't know what its return values might be. Consquently, we + have no way of multiplexing a unique exec error code with the command return + value within wstatus. If the prorgrammer knows the return values of the command + passed in, and wants better behavior, he or she can spin a special version of + dispatch for that command. +*/ +int dispatch(char **argv, char **envp){ + if( !argv || !argv[0] ){ + fprintf(stderr, "argv[0] null. Null command passed into dispatch().\n"); + return -1; + } + char *command = argv[0]; + pid_t pid = fork(); + if( pid == -1 ){ + fprintf(stderr, "fork() failed in dispatch().\n"); + return -1; + } + if( pid == 0 ){ // we are the child + execvpe(command, argv, envp); + // exec will only return if it has an error .. + perror(command); + return -1; + }else{ // we are the parent + int wstatus; + waitpid(pid, &wstatus, 0); + if(wstatus) + return -1; + else + return 0; + } +} diff --git a/src/dispatch.h b/src/dispatch.lib.h similarity index 62% rename from src/dispatch.h rename to src/dispatch.lib.h index 8f4ce44..620c6f9 100644 --- a/src/dispatch.h +++ b/src/dispatch.lib.h @@ -1,5 +1,5 @@ -#ifndef DISPATCH_FI_H -#define DISPATCH_FI_H +#ifndef DISPATCH_LIB_H +#define DISPATCH_LIB_H #include "local_common.h" int dispatch(char **argv, char **envp); diff --git a/src/dispatch_useradd.c b/src/dispatch_useradd.c deleted file mode 100644 index 4bfbcf5..0000000 --- a/src/dispatch_useradd.c +++ /dev/null @@ -1,42 +0,0 @@ -/* -There is no C library interface to useradd(8), but if there were, these functions -would be found there instead. - -*/ - -#include -#include -#include -#include -#include -#include "local_common.h" -#include "dispatch_useradd.h" - -// we have a contract with the caller that argv[1] is always the subuname -useradd_ret dispatch_useradd(char **argv, char **envp){ - run_err_init(run_err); - if( !argv || !argv[0] || !argv[1]){ - fprintf(stderr,"useradd() needs a first argument as the name of the user to be made"); - return useradd_ret(USERADD_ERR_ARGC, NULL); - } - char *subu_name = argv[1]; - if( run(argv, envp) == -1 ){ - fprintf(stderr,"%s failed\n", argv[0]); - return useradd_ret(USER_ERR_RUN); - } - struct password *pw_record = getpwnam(subu_name); - uint count = 1; - while( !pw_record && count <= 3 ){ - #ifdef DEBUG - printf("try %u, getpwnam failed, trying again\n", count); - #endif - sleep(1); - pw_record = getpwnam(subu_name); - count++; - } - if( !pw_record ){ - return struct useradd_ret(USERADD_ERR_PWREC, NULL); - } - return struct useradd_ret(0, pw_record); -} - diff --git a/src/dispatch_useradd.h b/src/dispatch_useradd.h deleted file mode 100644 index 39dc77e..0000000 --- a/src/dispatch_useradd.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef DISPATCH_USERADD_H -#define DISPATCH_USERADD_H - -#include -#include -#include - -// some value larger than any wstatus value -#define USERADD_ERR_UNDEFINED (1 << 16); -#define USERADD_ERR_ARGCNT (2 << 16); -#define USERADD_ERR_PWREC (3 << 16); - -// only use pw_record if error is zero -struct dispatch_useradd_ret{ - useradd_ret(error=USERADD_ERR_UNDEFINED,pwd=NULL):error(error),pwd(pwd){} - int error; - struct password *pw_record;// as per getpwnam man page do not free() this. -}; -struct dispatch_useradd_ret useradd(char **argv, char **envp); - -#endif - - diff --git a/src/dispatch_useradd.lib.c b/src/dispatch_useradd.lib.c new file mode 100644 index 0000000..c3823f9 --- /dev/null +++ b/src/dispatch_useradd.lib.c @@ -0,0 +1,57 @@ +/* +There is no C library interface to useradd(8), but if there were, these functions +would be found there instead. + +*/ + +#include +#include +#include +#include +#include +#include "local_common.h" +#include "dispatch.lib.h" +#include "dispatch_useradd.lib.h" + +// we have a contract with the caller that argv[1] is always the subuname +struct dispatch_useradd_ret_t dispatch_useradd(char **argv, char **envp){ + struct dispatch_useradd_ret_t ret; + { + if( !argv || !argv[0] || !argv[1]){ + fprintf(stderr,"useradd() needs a first argument as the name of the user to be made"); + ret.error = DISPATCH_USERADD_ERR_ARGC; + ret.pw_record = NULL; + return ret; + } + + char *subu_name; + { + subu_name = argv[1]; + if( dispatch(argv, envp) == -1 ){ + fprintf(stderr,"%s failed\n", argv[0]); + ret.error = DISPATCH_USERADD_ERR_DISPATCH; + ret.pw_record = NULL; + return ret; + }} + + { + struct passwd *pw_record = getpwnam(subu_name); + uint count = 1; + while( !pw_record && count <= 3 ){ + #ifdef DEBUG + printf("try %u, getpwnam failed, trying again\n", count); + #endif + sleep(1); + pw_record = getpwnam(subu_name); + count++; + } + if( !pw_record ){ + ret.error = DISPATCH_USERADD_ERR_PWREC; + ret.pw_record = NULL; + return ret; + } + ret.error = 0; + ret.pw_record = pw_record; + return ret; + }}} + diff --git a/src/dispatch_useradd.lib.h b/src/dispatch_useradd.lib.h new file mode 100644 index 0000000..ee82c3d --- /dev/null +++ b/src/dispatch_useradd.lib.h @@ -0,0 +1,24 @@ +#ifndef DISPATCH_USERADD_LIB_H +#define DISPATCH_USERADD_LIB_H + +#include +#include +#include + +// some value larger than any wstatus value +#define DISPATCH_USERADD_ERR_UNDEFINED 1; +#define DISPATCH_USERADD_ERR_ARGC 2; +#define DISPATCH_USERADD_ERR_PWREC 3; +#define DISPATCH_USERADD_ERR_DISPATCH 4; + +// only use pw_record if error is zero +struct dispatch_useradd_ret_t{ + int error; + struct passwd *pw_record;// as per getpwnam man page do not free() this. +}; + +struct dispatch_useradd_ret_t dispatch_useradd(char **argv, char **envp); + +#endif + + diff --git a/src/local_common.h b/src/local_common.h index 50ac521..b9beb20 100644 --- a/src/local_common.h +++ b/src/local_common.h @@ -1,6 +1,7 @@ #ifndef LOCAL_COMMON_H #define LOCAL_COMMON_H +#include "config.h" #include #define DEBUG diff --git a/src/makefile b/src/makefile index 0f43241..ad6d48b 100644 --- a/src/makefile +++ b/src/makefile @@ -99,7 +99,8 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) -am_subu_mk_0_OBJECTS = subu-mk-0.$(OBJEXT) useradd-0.$(OBJEXT) +am_subu_mk_0_OBJECTS = subu-mk-0.cli.$(OBJEXT) subu-mk-0.lib.$(OBJEXT) \ + dispatch.lib.$(OBJEXT) dispatch_useradd.lib.$(OBJEXT) subu_mk_0_OBJECTS = $(am_subu_mk_0_OBJECTS) subu_mk_0_LDADD = $(LDADD) AM_V_P = $(am__v_P_$(V)) @@ -117,8 +118,9 @@ am__v_at_1 = DEFAULT_INCLUDES = -I. -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/subu-mk-0.Po \ - ./$(DEPDIR)/useradd-0.Po +am__depfiles_remade = ./$(DEPDIR)/dispatch.lib.Po \ + ./$(DEPDIR)/dispatch_useradd.lib.Po \ + ./$(DEPDIR)/subu-mk-0.cli.Po ./$(DEPDIR)/subu-mk-0.lib.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -245,8 +247,10 @@ top_build_prefix = ../ top_builddir = .. top_srcdir = .. subu_mk_0_SOURCES = \ - subu-mk-0.c\ - useradd-0.c + subu-mk-0.cli.c\ + subu-mk-0.lib.c\ + dispatch.lib.c\ + dispatch_useradd.lib.c all: all-am @@ -334,8 +338,10 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -include ./$(DEPDIR)/subu-mk-0.Po # am--include-marker -include ./$(DEPDIR)/useradd-0.Po # am--include-marker +include ./$(DEPDIR)/dispatch.lib.Po # am--include-marker +include ./$(DEPDIR)/dispatch_useradd.lib.Po # am--include-marker +include ./$(DEPDIR)/subu-mk-0.cli.Po # am--include-marker +include ./$(DEPDIR)/subu-mk-0.lib.Po # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -484,8 +490,10 @@ clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am - -rm -f ./$(DEPDIR)/subu-mk-0.Po - -rm -f ./$(DEPDIR)/useradd-0.Po + -rm -f ./$(DEPDIR)/dispatch.lib.Po + -rm -f ./$(DEPDIR)/dispatch_useradd.lib.Po + -rm -f ./$(DEPDIR)/subu-mk-0.cli.Po + -rm -f ./$(DEPDIR)/subu-mk-0.lib.Po -rm -f makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -531,8 +539,10 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/subu-mk-0.Po - -rm -f ./$(DEPDIR)/useradd-0.Po + -rm -f ./$(DEPDIR)/dispatch.lib.Po + -rm -f ./$(DEPDIR)/dispatch_useradd.lib.Po + -rm -f ./$(DEPDIR)/subu-mk-0.cli.Po + -rm -f ./$(DEPDIR)/subu-mk-0.lib.Po -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/makefile.am b/src/makefile.am index 3c4c5fd..98a91ac 100644 --- a/src/makefile.am +++ b/src/makefile.am @@ -1,6 +1,10 @@ bin_PROGRAMS=subu-mk-0 subu_mk_0_SOURCES=\ - subu-mk-0.c\ - useradd-0.c + subu-mk-0.cli.c\ + subu-mk-0.lib.c\ + dispatch.lib.c\ + dispatch_useradd.lib.c + + diff --git a/src/makefile.in b/src/makefile.in index 79b7af5..bf9fde3 100644 --- a/src/makefile.in +++ b/src/makefile.in @@ -99,7 +99,8 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) -am_subu_mk_0_OBJECTS = subu-mk-0.$(OBJEXT) useradd-0.$(OBJEXT) +am_subu_mk_0_OBJECTS = subu-mk-0.cli.$(OBJEXT) subu-mk-0.lib.$(OBJEXT) \ + dispatch.lib.$(OBJEXT) dispatch_useradd.lib.$(OBJEXT) subu_mk_0_OBJECTS = $(am_subu_mk_0_OBJECTS) subu_mk_0_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) @@ -117,8 +118,9 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/subu-mk-0.Po \ - ./$(DEPDIR)/useradd-0.Po +am__depfiles_remade = ./$(DEPDIR)/dispatch.lib.Po \ + ./$(DEPDIR)/dispatch_useradd.lib.Po \ + ./$(DEPDIR)/subu-mk-0.cli.Po ./$(DEPDIR)/subu-mk-0.lib.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -245,8 +247,10 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ subu_mk_0_SOURCES = \ - subu-mk-0.c\ - useradd-0.c + subu-mk-0.cli.c\ + subu-mk-0.lib.c\ + dispatch.lib.c\ + dispatch_useradd.lib.c all: all-am @@ -334,8 +338,10 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subu-mk-0.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/useradd-0.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dispatch.lib.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dispatch_useradd.lib.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subu-mk-0.cli.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subu-mk-0.lib.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -484,8 +490,10 @@ clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am - -rm -f ./$(DEPDIR)/subu-mk-0.Po - -rm -f ./$(DEPDIR)/useradd-0.Po + -rm -f ./$(DEPDIR)/dispatch.lib.Po + -rm -f ./$(DEPDIR)/dispatch_useradd.lib.Po + -rm -f ./$(DEPDIR)/subu-mk-0.cli.Po + -rm -f ./$(DEPDIR)/subu-mk-0.lib.Po -rm -f makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -531,8 +539,10 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/subu-mk-0.Po - -rm -f ./$(DEPDIR)/useradd-0.Po + -rm -f ./$(DEPDIR)/dispatch.lib.Po + -rm -f ./$(DEPDIR)/dispatch_useradd.lib.Po + -rm -f ./$(DEPDIR)/subu-mk-0.cli.Po + -rm -f ./$(DEPDIR)/subu-mk-0.lib.Po -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/old_makefile b/src/old_makefile deleted file mode 100644 index 0967cac..0000000 --- a/src/old_makefile +++ /dev/null @@ -1,11 +0,0 @@ - -#CFLAGS= -std=c11 -Werror -H -fsyntax-only -#CFLAGS= -std=c11 -Werror -O -CFLAGS= -std=c11 -Werror -ggdb - -all: subu-mk-0 - -subu-mk-0: subu-mk-0.c - gcc -c $(CFLAGS) subu-mk-0.c - sudo ./setuid_root_subu-mk-0 - diff --git a/src/subu-mk-0.c b/src/subu-mk-0.cli.c similarity index 73% rename from src/subu-mk-0.c rename to src/subu-mk-0.cli.c index 7764191..cc07a78 100644 --- a/src/subu-mk-0.c +++ b/src/subu-mk-0.cli.c @@ -4,7 +4,7 @@ */ #include -#include "subu-mk-0.fi.h" +#include "subu-mk-0.lib.h" int main(int argc, char **argv, char **env){ char *command = argv[0]; @@ -12,6 +12,5 @@ int main(int argc, char **argv, char **env){ fprintf(stderr, "usage: %s subu", command); return ERR_ARG_CNT; } - uid_gid ug = subu-mk-0(argv[1]); - return ug.error; + return subu_mk_0(argv[1]); } diff --git a/src/subu-mk-0.fi.c b/src/subu-mk-0.fi.c deleted file mode 100644 index 9d32d7b..0000000 --- a/src/subu-mk-0.fi.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - Makes a new subu user. - - According to the man page, we are not alloed to free the buffers made by getpwid(). - - 1. We have to make the subu first so that we will have subu_uid and subu_gid - to work with. - - 2. Then we add user access via setfacl to masteru's home directory and to - subuland, so that we have permissions to make the home directory. - - 3. Then we create the subu home directory. .. I wonder where the system - gets the umask for this? Perhaps we should create the dir, and then change - the ownership instead? - - 4. Still as subu, we add facls to our directory to give masteru access. - - ... then finished, good part is that we never need to move back to root. - -setfacl -m u:subu:x masteru -setfacl -m u:subu:x masteru/subuland -setfacl -m d:u:masteru:rwX,u:masteru:rwX subu - -*/ -// without #define get warning: implicit declaration of function ‘seteuid’/‘setegid’ -#define _GNU_SOURCE - -#include -#include -#include -#include -#include -#include -#include -#include -#include "config.h" -#include "useradd.h" -#include "subu-mk-0.fi.h" - -typedef unsigned int uint; - -uid_gid subu_mk_0(char *subuname){ - - //-------------------------------------------------------------------------------- - // we must be invoked from a user account and be running as root - uid_t uid = getuid(); - uid_t euid = geteuid(); - gid_t gid = getgid(); - gid_t egid = getegid(); - #ifdef DEBUG - printf("uid %u, gid %u, euid %u\n", uid, gid, euid); - #endif - if( uid == 0 || euid != 0 ){ - fprintf(stderr, "this program must be run setuid root from a user account\n"); - return ERR_SETUID_ROOT; - } - - //-------------------------------------------------------------------------------- - // who are these people anyway? - size_t subuname_len; - char *masteru_name; - { - // subuname is the first argument passed in - // verify that subuname is legal! --> code goes here ... - subuname_len = strlen(subuname); - struct passwd *masteru_pw_record_pt = getpwuid(uid); - masteru_name = materu_pw_record_pt->pw_name; - } - #ifdef DEBUG - printf("masteru_name: %s\n", masteru_name); - #endif - - //-------------------------------------------------------------------------------- - // build the subuland path - char *masteru_home; - char *subuland; - size_t subuland_len; - { - masteru_home = passwd_record_pt->pw_dir; - size_t masteru_home_len = strlen(masteru_home); - if( masteru_home_len == 0 || masteru_home[0] == '(' ){ - fprintf(stderr,"strange, %s has no home directory\n", masteru_name); - return ERR_BAD_MASTERU_HOME; - } - char *subuland_extension = "/subuland/"; - size_t subuland_extension_len = strlen(subuland_extension); - subuland = (char *)malloc( masteru_home_len + subuland_extension_len + 1 ); - strcpy(subuland, masteru_home); - strcpy(subuland + masteru_home_len, subuland_extension); - subuland_len = masteru_home_len + subuland_extension_len + subuname_len; - } - #ifdef DEBUG - printf("The path to subuland: \"%s\"\n", subuland); - #endif - - //-------------------------------------------------------------------------------- - // Just because masteru_home is referenced in /etc/passwd does not mean it exists. - // We also require that the subuland sub directory exists. - { - struct stat st; - if( stat(masteru_home, &st) == -1) { - fprintf(stderr, "Strange, masteru home does not exist, \"%s\".", masteru_home); - return ERR_NOT_EXIST_MASTERU_HOME; - } - if( stat(subuland, &st) == -1) { - fprintf(stderr, "$masteru_home/subuland not exist"); - return ERR_NOT_EXIST_SUBULAND; - } - } - - //-------------------------------------------------------------------------------- - // the name for the subu home directory, which is subuland/subuname - char subuhome; - { - subuhome_len = subuland_len + subuname_len; - subuhome = (char *)malloc(subuhome_len + 1); - strcpy (subuhome, subuland); - strcpy (subuhome + subuland_len, subuname); - } - #ifdef DEBUG - printf("subuhome: %s\n", subuhome); - #endif - - /*-------------------------------------------------------------------------------- - make the subservient user account - We can't make the home directory yet, because we need to add execute access rights to - masteru home and subuland so that the subu user can cd to subuhome. - -d, --home-dir HOME_DIR - The new user will be created using HOME_DIR as the value for the user's login directory. The default - is to append the LOGIN name to BASE_DIR and use that as the login directory name. The directory - HOME_DIR does not have to exist but will not be created if it is missing. - */ - uid_t subu_uid; - tid_t subu_gid; - { - char *argv[5]; - argv[0] = "/usr/bin/useradd"; - argv[1] = subuname; - argv[2] = "-d"; - argv[3] = subuhome; - argv[4] = (char *) NULL; - char *envp[1]; - envp[0] (char *) NULL; - struct ret u_ret = useradd(argv, envp); - if(ret.error){ - fprintf(stderr, "%u useradd failed\n", ret.error) - return ERR_FAILED_USERADD; - } - subu_uid = user_ret.pw_record->pw_uid; - subu_gid = user_ret.pw_record->pw_gid; - } - - //-------------------------------------------------------------------------------- - // give subu x access to masteru and subuland - { - char access[2 + subuname_len + 2 + 1]; - strcpy(access, "u:"); - strcpy(access + 2, subuname); - strcpy(access + 2 + subuname_len, ":x"); - - char *argv[]; - argv[0] = "/usr/bin/setfacl"; - argv[1] = "-m"; - argv[2] = access; - argv[3] = masteru_home - - } - - // subu sets acls to allow masteru access - - free(subuland); - free(subuhome); - return 0; -} - -/* - // change to subu space - if( seteuid(subu_uid) == -1 || setegid(subu_gid) == -1 ){ // we are root so this should never happen - fprintf(stderr,"Strangely, root could not seteuid/setegid to %s\n", subuname); - return ERR_FAILED_MKDIR_SUBU; - } - -*/ diff --git a/src/subu-mk-0.lib.c b/src/subu-mk-0.lib.c new file mode 100644 index 0000000..71bac28 --- /dev/null +++ b/src/subu-mk-0.lib.c @@ -0,0 +1,242 @@ +/* + Makes a new subu user. + + According to the man page, we are not alloed to free the memory allocated by getpwid(). + + +setfacl -m d:u:masteru:rwX,u:masteru:rwX subuname + +*/ +// without this #define we get the warning: implicit declaration of function ‘seteuid’/‘setegid’ +#define _GNU_SOURCE +#include +#include + +#include +#include +#include +#include +#include +#include +#include "dispatch.lib.h" +#include "dispatch_useradd.lib.h" +#include "subu-mk-0.lib.h" + +typedef unsigned int uint; + +int subu_mk_0(char *subuname){ + + //-------------------------------------------------------------------------------- + // check that we are run from a user account (the masteru) and that we have setuid to root + uid_t uid = getuid(); + uid_t euid = geteuid(); + gid_t gid = getgid(); + gid_t egid = getegid(); + #ifdef DEBUG + printf("uid %u, gid %u, euid %u\n", uid, gid, euid); + #endif + if( uid == 0 || euid != 0 ){ + fprintf(stderr, "this program must be run setuid root from a user account\n"); + return ERR_SETUID_ROOT; + } + + //-------------------------------------------------------------------------------- + // who are these people anyway? + size_t subuname_len; + char *masteru_name; + size_t masteru_name_len; + struct passwd *masteru_pw_record_pt; + { + // subuname is the first argument passed in + // verify that subuname is legal! --> code goes here ... + subuname_len = strlen(subuname); + masteru_pw_record_pt = getpwuid(uid); + masteru_name = masteru_pw_record_pt->pw_name; + masteru_name_len = strlen(masteru_name); + } + #ifdef DEBUG + printf("masteru_name: %s\n", masteru_name); + #endif + + //-------------------------------------------------------------------------------- + // build the subuland path + char *masteru_home; + size_t masteru_home_len; + char *subuland; + size_t subuland_len; + { + masteru_home = masteru_pw_record_pt->pw_dir; + masteru_home_len = strlen(masteru_home); + if( masteru_home_len == 0 || masteru_home[0] == '(' ){ + fprintf(stderr,"strange, %s has no home directory\n", masteru_name); + return ERR_BAD_MASTERU_HOME; + } + char *subuland_extension = "/subuland/"; + size_t subuland_extension_len = strlen(subuland_extension); + subuland = (char *)malloc( masteru_home_len + subuland_extension_len + 1 ); + strcpy(subuland, masteru_home); + strcpy(subuland + masteru_home_len, subuland_extension); + subuland_len = masteru_home_len + subuland_extension_len; + } + #ifdef DEBUG + printf("masteru_home: \"%s\"\n", masteru_home); + printf("The path to subuland: \"%s\"\n", subuland); + #endif + + //-------------------------------------------------------------------------------- + // Just because masteru_home is referenced in /etc/passwd does not mean it exists. + // We also require that the subuland sub directory exists. + { + struct stat st; + if( stat(masteru_home, &st) == -1) { + fprintf(stderr, "Strange, masteru home does not exist, \"%s\".", masteru_home); + free(subuland); + return ERR_NOT_EXIST_MASTERU_HOME; + } + if( stat(subuland, &st) == -1) { + fprintf(stderr, "$masteru_home/subuland/ does not exist"); + free(subuland); + return ERR_NOT_EXIST_SUBULAND; + } + } + + //-------------------------------------------------------------------------------- + // the name for the subu home directory, which is $(masteru_home)/subuland/subuname + char *subuhome; + size_t subuhome_len; + { + subuhome_len = subuland_len + subuname_len; + subuhome = (char *)malloc(subuhome_len + 1); + if( !subuhome ){ + perror("subu_mk_0"); + free(subuland); + return ERR_MALLOC; + } + strcpy (subuhome, subuland); + strcpy (subuhome + subuland_len, subuname); + } + #ifdef DEBUG + printf("subuhome: %s\n", subuhome); + #endif + + /*-------------------------------------------------------------------------------- + make the subservient user account + + We need to add execute access rights to masteru home and subuland so that + the subu user can cd to subuhome. + + Ok to specify the new home directory to useradd, note this from the man page: + + -d, --home-dir HOME_DIR The new user will be created using HOME_DIR + as the value for the user's login directory. ... The directory HOME_DIR + does not have to exist but will not be created if it is missing. + */ + uid_t subuuid; + gid_t subugid; + { + char *argv[5]; + argv[0] = "/usr/bin/useradd"; + argv[1] = subuname; + argv[2] = "-d"; + argv[3] = subuhome; + argv[4] = (char *) NULL; + char *envp[1]; + envp[0] = (char *) NULL; + struct dispatch_useradd_ret_t ret; + ret = dispatch_useradd(argv, envp); + if(ret.error){ + fprintf(stderr, "%u useradd failed\n", ret.error); + free(subuland); + free(subuhome); + return ERR_FAILED_USERADD; + } + subuuid = ret.pw_record->pw_uid; + subugid = ret.pw_record->pw_gid; + } + + //-------------------------------------------------------------------------------- + // give subu x access to masteru and subuland + // setfacl -m u:subuname:x masteru + // setfacl -m u:subuname:x masteru/subuland + { + char access[2 + subuname_len + 2 + 1]; + strcpy(access, "u:"); + strcpy(access + 2, subuname); + strcpy(access + 2 + subuname_len, ":x"); + + char *argv[5]; + argv[0] = "/usr/bin/setfacl"; + argv[1] = "-m"; + argv[2] = access; + argv[3] = masteru_home; + argv[4] = (char *) NULL; + char *envp[1]; + envp[0] = (char *) NULL; + if( dispatch(argv, envp) == -1 ){ + fprintf(stderr, "'setfacl -m u:%s:x %s' returned an error.\n", subuname, masteru_home); + free(subuland); + free(subuhome); + return ERR_SETFACL; + } + } + + //-------------------------------------------------------------------------------- + // create subuhome directory + { + int ret = mkdir(subuhome, 0x0700); + if( ret == -1 ){ + perror("subu_mk_0"); + free(subuland); + free(subuhome); + return ERR_MK_SUBUHOME; + } + ret = chown(subuhome, subuuid, subugid); + if( ret == -1 ){ + perror("subu_mk_0"); + free(subuland); + free(subuhome); + return ERR_MK_SUBUHOME; + } + } + + //-------------------------------------------------------------------------------- + // give masteru access to subu_home and all descendents. This is why subu is + // said to be subservient. + // setfacl -R -m d:u:masteru:rwX,u:masteru:rwX subuhome + { + char access[4 + masteru_name_len + 7 + masteru_name_len + 5 + subuhome_len + 1]; + strcpy(access, "d:u:"); + strcpy(access + 4, masteru_name); + strcpy(access + 4 + masteru_name_len, ":rwX,u:"); + strcpy(access + 4 + masteru_name_len + 7, masteru_name); + strcpy(access + 4 + masteru_name_len + 7 + masteru_name_len, ":rwX "); + strcpy(access + 4 + masteru_name_len + 7 + masteru_name_len + 5, subuhome); + + char *argv[6]; + argv[0] = "/usr/bin/setfacl"; + argv[1] = "-R"; // just in case the dir already existed with stuff in it + argv[2] = "-m"; + argv[3] = access; + argv[4] = subuhome; + argv[5] = (char *) NULL; + char *envp[1]; + envp[0] = (char *) NULL; + if( dispatch(argv, envp) == -1 ){ + fprintf + ( + stderr, + "'setfacl -$ -m d:u:%s:rwX,u:%s:rwX %s' returned an error.\n", + masteru_name, + masteru_name, + subuhome + ); + free(subuland); + free(subuhome); + return ERR_SETFACL; + } + } + + free(subuland); + free(subuhome); + return 0; +} diff --git a/src/subu-mk-0.fi.h b/src/subu-mk-0.lib.h similarity index 54% rename from src/subu-mk-0.fi.h rename to src/subu-mk-0.lib.h index 2e13d8c..a93701f 100644 --- a/src/subu-mk-0.fi.h +++ b/src/subu-mk-0.lib.h @@ -1,16 +1,18 @@ -#ifndef SUBU_MK_0_H -#define SUBU_MK_0_H +#ifndef SUBU_MK_0_LIB_H +#define SUBU_MK_0_LIB_H #define ERR_ARG_CNT 1 #define ERR_SETUID_ROOT 2 #define ERR_BAD_MASTERU_HOME 3 #define ERR_NOT_EXIST_MASTERU_HOME 4 -#define ERR_NOT_EXIST_SUBU_LAND 5 +#define ERR_NOT_EXIST_SUBULAND 5 #define ERR_FAILED_MKDIR_SUBU 6 #define ERR_FAILED_RESTORATION 7 #define ERR_FAILED_USERADD 8 +#define ERR_SETFACL 9 +#define ERR_MALLOC 10 +#define ERR_MK_SUBUHOME 11 - -struct uid_gid subu_mk_0(char *subuname); +int subu_mk_0(char *subuname); #endif diff --git a/src/subu-mk.py b/src_py/subu-mk.py similarity index 100% rename from src/subu-mk.py rename to src_py/subu-mk.py -- 2.20.1