+++ /dev/null
-
-This worked to force the include to be part of the interface:
-
-#if INTERFACE
-#include <sqlite3.h>
-#endif
-
-But this did not:
-
-#if INTERFACE
- #include <sqlite3.h>
-#endif
-
-makeheaders looks to be sensitive to indentation
-
-
-2019-02-05T23:14:40Z morpheus@manorhouse§~/src/subu§
- error can cause subu-mk-0 to leave the creating of a subu
- in an intermediate state. Rather than bailing on some
- of the errors we need to clean up instead. Perhaps the
- yet to be written subu-rm program will be resilent enough
- to do more general cleanup.
-
-2019-02-21T22:02:15Z morpheus@manorhouse§~/src/subu§
- subu-mk-0 only gives x privs via setfacl to subu on masteru home and on
- subuland. Hence a subu can not run subu-mk-0 and be guaranteed access to the
- subu's newly made subu. I.e. cd might not work for recurisve subu.
-
- The easy fix would be to use perms instead of facls, and give all home
- directories other 'x' privs. Another fix would be to take apart the subu
- home path, and make sure that all sub paths have 'x'.
-
- For now, I'm just leaving it to one layer.
-
-2019-02-23T18:56:31Z morpheus@manorhouse§~/subu_land/subu/src§
- need to modify subu-init to take a configuration file name argument
- might want to add arguments to other subu commands also
-subdirectories=$(shell /usr/bin/find . -maxdepth 1 -printf "%f " | sed y/\./\ /)
+#subdirectories=$(shell /usr/bin/find . -maxdepth 1 -printf "%f " | sed y/\./\ /)
+subdirectories=src
all :
$(foreach dir, $(subdirectories), \
+++ /dev/null
-#!/bin/sh
-
-make --no-print-directory -f $RT_BASE/bin/source_local_makefile $@
-
--- /dev/null
+common.lib.o: common.lib.c
+dispatch_useradd.lib.o: dispatch_useradd.lib.c dispatch_useradd.lib.h
+subu-mk-0.lib.o: subu-mk-0.lib.c subu-mk-0.lib.h
+subu-config.lib.o: subu-config.lib.c subu-config.lib.h
+dispatch_exec.lib.o: dispatch_exec.lib.c dispatch_exec.lib.h
+dbprintf.lib.o: dbprintf.lib.c dbprintf.lib.h
+dispatch_f.lib.o: dispatch_f.lib.c dispatch_f.lib.h
+subu-number.cli.o: subu-number.cli.c subu-number.cli.h
+subu-mk-0.cli.o: subu-mk-0.cli.c subu-mk-0.lib.h
+subu-init.cli.o: subu-init.cli.c subu-init.cli.h
+
+subu-init : subu-init.cli.o . /libsubu.a
+ g++ -o subu-init subu-init.cli.o -L. -lsubu
+
+subu-mk-0 : subu-mk-0.cli.o . /libsubu.a
+ g++ -o subu-mk-0 subu-mk-0.cli.o -L. -lsubu
+
+subu-number : subu-number.cli.o . /libsubu.a
+ g++ -o subu-number subu-number.cli.o -L. -lsubu
--- /dev/null
+these are the comments from my RT makefile:
+
+#
+# 2010 11 20 TWL Created
+# 2011 05 26 TWL Modified to generalize
+# 2012 02 23 NLS Add ECHO variable to use on different environnement
+# corrected setup macro --> add include directory in the path to copy
+# corrected install macro --> change the name of installed library : lib$(LIB)$(LIBSUFFIX)
+# changed DOC_DIR directory name to 5_documents
+# 2012 02 23 TWL removed LIB variable which is now set from the command line so
+# so that all source dirs can use the same makefile
+# 2012 02 23 TWL added target make dist_clean which also deletes the 2_makefile_deps file
+# 2012 04 11 AWW added creation of temporary disk before each test is run
+# 2012 06 05 TWL moved tests and try .cc files to directories. caused rtmake tests to
+# dist_clean and make deps
+#
+#
+#----------------------------------------------------------------------------
+# use this makefile to compile and test the code:
+#
+# for a first time run, or for regression use the following:
+#
+# $ make setup # makes the directories, though should already exist
+# $ make regress
+#
+# the usual development workflow makes use of these:
+#
+# $ make deps # only when needed, for example if headers includes change or new files introduced
+# $ cd tests; make deps # only when needed
+# $ make lib # this makes the local library
+# $ make tests # this updates tests and compiles
+# $ make clean # deletes the .o files and library to force a recompile
+# $ cd 1_tests; make clean
+#
+# for a release of a component
+#
+# $ make regress
+# $ make install # this will only work if all the tests in 1_tests are passing
+#
+# before a checkin
+#
+# $ make dist_clean # will also clean the tests and try directories
+#
+# .lib.cc c++ files taken as source of object files for local build library
+# .exl.cc c++ files taken to have main calls and are linked against local build libary
+# .ex.cc c++ files taken to have main calls and are not linked against the local build library
+# there are no rules for other files in this makefile
+#
+# about dependencies
+# The makefile has no way of knowing if an edit changed the dependencies. Often they do not
+# and it would be unwieldy to make the deps every time. Hence *the programmer* must delete
+# the deps file if he has made any changes that change the dependencies.
+#
+# The makefile will make the 2_makefile_deps if the file is missing.
+#
+#
+# about testing
+#
+# the name of the directory you run make in is taken to also be: the name of the library,
+# the name of the main include file (with a .h added), and the name of the include directory
+# where the individual headers are found. It is called LIB
+#
+# test programs are kept in a subdirectory called 1_tests, and are either .exl.cc, ex.cc,
+# .sh files. When 'make tests' target is invoked they are all run. Test executables return 0
+# if the test fails, non-zero otherwise.
+#
+# to remove a test from the pool move it into the subdirectory in 1_tests, 9_broken,
+# 5_more_tests of 5_scratch. broken tests are things that are known but must be fixed
+# before a release. 5_more_tests are tests being worked on. 5_scratch is stuff that is
+# probably going to be deleted. if there is a 5_deprecated, that is for good stuff but it
+# is no longer used for some reason or other.
+#
+# There is a standard source code template and a
+# messaging convention. Also, the names, by convention,are test_xxxx_ where xxx is a
+# hexadecimal series nummber. If all the test executables pass the file 1_TESTS_PASSED is
+# left in the directory. Otherwise the file 1_TESTS_FAILED is left in the directory.
+#
+# about release directory
+#
+# this is set in the ApplicationBase variable by rt_init
+#
+# after the tests pass stuff might be copied to the release directory using
+#
+# make install
+#
+# the release directory must have these subdirectories:
+#
+# bin documents include src
+#
+#
+#
--- /dev/null
+
+This worked to force the include to be part of the interface:
+
+#if INTERFACE
+#include <sqlite3.h>
+#endif
+
+But this did not:
+
+#if INTERFACE
+ #include <sqlite3.h>
+#endif
+
+makeheaders looks to be sensitive to indentation
+
+
--- /dev/null
+2019-02-05T23:14:40Z morpheus@manorhouse§~/src/subu§
+ error can cause subu-mk-0 to leave the creating of a subu in an intermediate
+ state. Rather than bailing on some of the errors we need to clean up instead.
+ Perhaps the yet to be written subu-rm program will be resilent enough to do
+ more general cleanup.
+
+2019-02-23T18:56:31Z morpheus@manorhouse§~/subu_land/subu/src§
+ need to modify subu-init to take a configuration file name argument instead of
+ using a global variabel value. might want to add arguments to other subu
+ commands also
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+typedef unsigned int uint;
+#define INTERFACE 0
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+int dbprintf(const char *format,...);
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+int dbprintf(const char *format,...);
+int dispatch_exec(char **argv,char **envp);
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+int dispatch_f_euid_egid(char *fname,int(*f)(void *arg),void *f_arg,uid_t euid,gid_t egid);
+int dbprintf(const char *format,...);
+int dispatch_f(char *fname,int(*f)(void *arg),void *f_arg);
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+typedef unsigned int uint;
+int dispatch_exec(char **argv,char **envp);
+struct dispatch_useradd_ret_t dispatch_useradd(char **argv,char **envp);
--- /dev/null
+
+# a single space literal, for example if you wanted to subsitute commas to
+# spaces: $(subst $(space),;,$(string)) we ran into this out of a need to send
+# multiple separate command arguments to a shell script from one variable value
+blank :=
+space :=$(blank) $(blank)
+
+# some versions of Linux need a -e option others complain if there is a -e .. and it isn't the binary for echo ..
+ECHO= echo
+#ECHO= echo -e
+
+SHELL=/bin/bash
+SCRATCHDIR= 5_scratch # clean and others put things here
+CC=gcc
+CFLAGS="-std=c11 -fPIC -I. -ggdb -DDEBUG"
+LIB="libsubu.a"
+LIBPATH="." #no trailing slash
+LINKFLAGS="-L. -lsubu"
+
+SOURCES_LIB= $(wildcard *.lib.c)
+SOURCES_CLI= $(wildcard *.cli.c)
+SOURCES= $(SOURCES_LIB) $(SOURCES_CLI)
+
+OBJECTS_LIB= $(patsubst %.c, %.o, $(SOURCES_LIB))
+OBJECTS_CLI= $(patsubst %.c, %.o, $(SOURCES_CLI))
+OBJECTS= $(OBJECTS_LIB) $(OBJECTS_CLI)
+
+# sort causes compiles to go in lexical order by file name, this is used to order the tests e.g.
+EXECS= $(sort $(patsubst %.cli.c, %, $(wildcard *.cli.c)))
+
+version:
+ @echo '---- make $@:------------------------------------------------------------'
+ @echo `pwd`'>'
+ @echo makefile version 2.0
+ @echo "CC: " $(CC)
+ @echo "CFLAGS: " $(CFLAGS)
+ @echo "LIB: " $(LIB)
+ @echo "LIBPATH: " $(LIBPATH)
+ @echo "LINKFLAGS: " $(LINKFLAGS)
+ @echo '______end make $@_____'
+
+# safe to run this in an already setup or partially setup directory
+setup:
+ @echo '---- make $@:------------------------------------------------------------'
+ @echo `pwd`'>'
+ if [ ! -e $(SCRATCHDIR) ]; then mkdir $(SCRATCHDIR); fi
+ if [ ! -e 1_tests ]; then mkdir 1_tests; fi
+ if [ ! -e 1_try ]; then mkdir 1_try; fi
+ if [ ! -e 2_bin ]; then mkdir 2_bin; fi
+ if [ ! -e 3_documents ]; then mkdir 3_documents; fi
+ if [ ! -e 3_to_do.txt ]; then touch 3_to_do.txt; fi
+ if [ ! -e 5_deprecated ]; then mkdir 5_deprecated; fi
+ @echo '______end make $@_____'
+
+
+deps:
+ @echo '---- make $@:------------------------------------------------------------'
+ @echo `pwd`'>'
+ $(CC) $(CFLAGS) -MM $(SOURCES) 1> 2_makefile_deps
+ for i in $(EXECS) ; do\
+ echo >> 2_makefile_deps;\
+ $(ECHO) "$$i : $$i.cli.o" >> 2_makefile_deps;\
+ $(ECHO) " $(CC) -o $$i $$i.cli.o" >> 2_makefile_deps;\
+ done
+ @echo '______end make $@_____'
+
+lib: clear_test_flags
+ @echo '---- make $@:------------------------------------------------------------'
+ @echo `pwd`'>'
+ if [ ! -e 2_makefile_deps ]; then make deps; fi # the user must delete 2_makefile_deps if deps change!
+ make sub_lib
+ @echo '______end make $@_____'
+
+sub_lib: $(LIB)
+
+
+$(LIBPATH)/$(LIB):
+ @if [ "$(LIBPATH)" != "$(APPLICATION_BASE)" ]; then \
+ echo "LIBPATH: " "$(LIBPATH)";\
+ echo "$APPLICATION_BASE: " "$(APPLICATION_BASE)";\
+ echo "The library path is not the same as the application base so don't know how to make it.";\
+ fi
+ [ "$(LIBPATH)" == "$(APPLICATION_BASE)" ]
+ cd $(APPLICATION_BASE); make lib
+
+execs: $(LIBPATH)/$(LIB)
+ @echo '---- make $@:------------------------------------------------------------'
+ @echo `pwd`'>'
+ if [ ! -e 2_makefile_deps ]; then make deps; fi
+ make sub_execs
+ # for i in $(EXEC_OBJECTS); do rm $$i; done
+ @echo '______end make $@_____'
+
+sub_execs: $(EXECS)
+
+install: all
+ @echo '---- make $@:------------------------------------------------------------'
+ @echo `pwd`'>'
+ @if[ ! -e 1_tests_passed ]; then echo "can't install as tests have not passed"; fi
+ @test -e test_passed
+ for i in $(BIN); do cp $$i $(RT_BASE)/bin; done
+ cp $(LIB) $(RT_BASE)/lib
+ cp $(APPLICATION).h $(RT_BASE)/include
+ if [ -d $(APPLICATION) ]; then cp $(APPLICATION)/*.h $(RT_BASE)/include/$(APPLICATION); fi
+ @echo '______end make $@_____'
+
+# "make lib" "make execs" now cleans up the .o files afterward, so clean should not be needed often
+# clean works on the current working directory, dist_clean also descends into 1_tests and 1_try
+#
+clean:
+ @echo '---- make $@:------------------------------------------------------------'
+ @echo `pwd`'>'
+ for i in $(wildcard *~); do mv $$i $(SCRATCHDIR); done
+ for i in $(wildcard *.lib.o) $(wildcard *.exl.o) $(wildcard *.ex.o); do rm $$i; done
+ if [ -f 2_makefile_deps ]; then rm 2_makefile_deps; fi
+ if [ -f $(LIB) ]; then mv $(LIB) 5_scratch; fi
+ for i in $(EXEC_WL) $(EXEC); do if [ -e $$i ]; then rm $$i; fi; done
+ @echo '______end make $@_____'
+
+
+# dist_clean is used to clean thing up before doing a checkin, hg add should be safe after a dist_clean
+# dist_clean will recurse into the include directory = $(APPLICATION), tests, and try if they are present
+#
+dist_clean:
+ @echo '---- make $@:------------------------------------------------------------'
+ @echo `pwd`'>'
+ make clean
+ if [ -d $(APPLICATION) ]; then cd $(APPLICATION); make clean; fi
+ if [ -d 1_tests ]; then cd 1_tests; make clean; fi
+ if [ -d 1_try ] ; then cd 1_try; make clean; fi
+ @echo '______end make $@_____'
+
+
+-include 2_makefile_deps
+
+# recipe for making object files:
+#
+%.o : %.cc
+ $(CC) $(CFLAGS) -c $<
+
+
+#
+$(LIB) : $(LIB_OBJECTS)
+ ar rcs $(LIB) $(LIB_OBJECTS)
+# for i in $(LIB_OBJECTS); do rm $$i; done
+
+
+
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+#include <sqlite3.h>
+typedef unsigned int uint;
+int subu_number(sqlite3 *db,uint&subu_number);
+int schema(sqlite3 *db,uint max_subu_number);
+extern char config_file[];
+#define ERR_CONFIG_FILE -1
+#define INTERFACE 0
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+#include <sqlite3.h>
+#define ERR_CONFIG_FILE -1
+typedef unsigned int uint;
+int schema(sqlite3 *db,uint max_subu_number);
+extern char config_file[];
+int main();
+int main();
+int main(int argc,char **argv,char **env);
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+#include <sqlite3.h>
+extern char config_file[];
+int subu_mk_0(char *subuname,char *config_file);
+int main();
+int main();
+int main(int argc,char **argv,char **env);
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+int dispatch_exec(char **argv,char **envp);
+struct dispatch_useradd_ret_t dispatch_useradd(char **argv,char **envp);
+int dispatch_f_euid_egid(char *fname,int(*f)(void *arg),void *f_arg,uid_t euid,gid_t egid);
+#include <sqlite3.h>
+#define ERR_CONFIG_FILE -1
+int dbprintf(const char *format,...);
+extern char config_file[];
+int subu_mk_0(char *subuname,char *config_file);
+int masteru_makes_subuhome(void *arg);
+int allowed_subuname(char *subuname);
+typedef unsigned int uint;
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+#include <sqlite3.h>
+typedef unsigned int uint;
+int subu_number(sqlite3 *db,uint&subu_number);
+#define ERR_CONFIG_FILE -1
+extern char config_file[];
+int main();
+int main();
+int main(int argc,char **argv,char **env);
--- /dev/null
+
+
+#if INTERFACE
+typedef unsigned int uint;
+#endif
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+typedef unsigned int uint;
+#define INTERFACE 0
+#include "dbprintf.lib.h"
+
#include <stdarg.h>
#include <stdio.h>
-#include "dbprintf.aux.h"
int dbprintf(const char *format, ...){
va_list args;
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+int dbprintf(const char *format,...);
command passed in, and wants better behavior, he or she can spin a special
version of dispatch for that command.
*/
+#include "dispatch_exec.lib.h"
// without this #define execvpe is undefined
#define _GNU_SOURCE
+
#include <sys/types.h>
#include <unistd.h>
-
#include <wait.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
-#include "local_common.h"
-#include "dispatch_exec.lib.h"
+
+
int dispatch_exec(char **argv, char **envp){
if( !argv || !argv[0] ){
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+int dbprintf(const char *format,...);
+int dispatch_exec(char **argv,char **envp);
version of dispatch for that command.
*/
+#include "dispatch_f.lib.h"
+
// without this #define execvpe is undefined
#define _GNU_SOURCE
#include <sys/types.h>
#include <unistd.h>
-
#include <wait.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
-#include "local_common.h"
-#include "dispatch_f.lib.h"
int dispatch_f(char *fname, int (*f)(void *arg), void *f_arg){
char *perror_src = "dispatch_f_as";
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+int dispatch_f_euid_egid(char *fname,int(*f)(void *arg),void *f_arg,uid_t euid,gid_t egid);
+int dbprintf(const char *format,...);
+int dispatch_f(char *fname,int(*f)(void *arg),void *f_arg);
/*
-There is no C library interface to useradd(8), but if there were, these functions
+There is no C library interface to useradd(8), but if there were, this function
would be found there instead.
*/
+#include "dispatch_useradd.lib.h"
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
-#include "local_common.h"
-#include "dispatch_exec.lib.h"
-#include "dispatch_useradd.lib.h"
+
+#if INTERFACE
+#include <sys/types.h>
+#include <pwd.h>
+#define ERR_DISPATCH_USERADD_ARGC 1
+#define ERR_DISPATCH_USERADD_DISPATCH 2
+#define ERR_DISPATCH_USERADD_PWREC 3
+struct dispatch_useradd_ret_t{
+ uint error;
+ struct passwd *pw_record;
+};
+#endif
+
// 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){
{
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.error = ERR_DISPATCH_USERADD_ARGC;
ret.pw_record = NULL;
return ret;
}
subu_name = argv[1];
if( dispatch_exec(argv, envp) == -1 ){
fprintf(stderr,"%s failed\n", argv[0]);
- ret.error = DISPATCH_USERADD_ERR_DISPATCH;
+ ret.error = ERR_DISPATCH_USERADD_DISPATCH;
ret.pw_record = NULL;
return ret;
}}
count++;
}
if( !pw_record ){
- ret.error = DISPATCH_USERADD_ERR_PWREC;
+ ret.error = ERR_DISPATCH_USERADD_PWREC;
ret.pw_record = NULL;
return ret;
}
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+int dispatch_exec(char **argv,char **envp);
+#include <sys/types.h>
+#include <pwd.h>
+typedef struct dispatch_useradd_ret_t dispatch_useradd_ret_t;
+typedef unsigned int uint;
+struct dispatch_useradd_ret_t {
+ uint error;
+ struct passwd *pw_record;
+};
+struct dispatch_useradd_ret_t dispatch_useradd(char **argv,char **envp);
+#define ERR_DISPATCH_USERADD_PWREC 3
+#define ERR_DISPATCH_USERADD_DISPATCH 2
+#define ERR_DISPATCH_USERADD_ARGC 1
+#define INTERFACE 0
+++ /dev/null
-
-
-typedef unsigned int uint;
-
+++ /dev/null
-
-
-typedef unsigned int uint;
-
# Copyright 2011 (C) Reasoning Technology Ltd. All Rights Reserved
#
# 2010 11 20 TWL Created
-# 2011 05 26 TWL Modified to generalize
-# 2012 02 23 NLS Add ECHO variable to use on different environnement
-# corrected setup macro --> add include directory in the path to copy
-# corrected install macro --> change the name of installed library : lib$(LIB)$(LIBSUFFIX)
-# changed DOC_DIR directory name to 5_documents
-# 2012 02 23 TWL removed LIB variable which is now set from the command line so
-# so that all source dirs can use the same makefile
-# 2012 02 23 TWL added target make dist_clean which also deletes the 2_makefile_deps file
-# 2012 04 11 AWW added creation of temporary disk before each test is run
-# 2012 06 05 TWL moved tests and try .cc files to directories. caused rtmake tests to
-# dist_clean and make deps
-#
-#
-#----------------------------------------------------------------------------
-# use this makefile to compile and test the code:
-#
-# for a first time run, or for regression use the following:
-#
-# $ make setup # makes the directories, though should already exist
-# $ make regress
-#
-# the usual development workflow makes use of these:
-#
-# $ make deps # only when needed, for example if headers includes change or new files introduced
-# $ cd tests; make deps # only when needed
-# $ make lib # this makes the local library
-# $ make tests # this updates tests and compiles
-# $ make clean # deletes the .o files and library to force a recompile
-# $ cd 1_tests; make clean
-#
-# for a release of a component
-#
-# $ make regress
-# $ make install # this will only work if all the tests in 1_tests are passing
-#
-# before a checkin
-#
-# $ make dist_clean # will also clean the tests and try directories
-#
-# .lib.cc c++ files taken as source of object files for local build library
-# .exl.cc c++ files taken to have main calls and are linked against local build libary
-# .ex.cc c++ files taken to have main calls and are not linked against the local build library
-# there are no rules for other files in this makefile
-#
-# about dependencies
-# The makefile has no way of knowing if an edit changed the dependencies. Often they do not
-# and it would be unwieldy to make the deps every time. Hence *the programmer* must delete
-# the deps file if he has made any changes that change the dependencies.
-#
-# The makefile will make the 2_makefile_deps if the file is missing.
-#
-#
-# about testing
-#
-# the name of the directory you run make in is taken to also be: the name of the library,
-# the name of the main include file (with a .h added), and the name of the include directory
-# where the individual headers are found. It is called LIB
-#
-# test programs are kept in a subdirectory called 1_tests, and are either .exl.cc, ex.cc,
-# .sh files. When 'make tests' target is invoked they are all run. Test executables return 0
-# if the test fails, non-zero otherwise.
-#
-# to remove a test from the pool move it into the subdirectory in 1_tests, 9_broken,
-# 5_more_tests of 5_scratch. broken tests are things that are known but must be fixed
-# before a release. 5_more_tests are tests being worked on. 5_scratch is stuff that is
-# probably going to be deleted. if there is a 5_deprecated, that is for good stuff but it
-# is no longer used for some reason or other.
-#
-# There is a standard source code template and a
-# messaging convention. Also, the names, by convention,are test_xxxx_ where xxx is a
-# hexadecimal series nummber. If all the test executables pass the file 1_TESTS_PASSED is
-# left in the directory. Otherwise the file 1_TESTS_FAILED is left in the directory.
-#
-# about release directory
-#
-# this is set in the ApplicationBase variable by rt_init
-#
-# after the tests pass stuff might be copied to the release directory using
-#
-# make install
-#
-# the release directory must have these subdirectories:
-#
-# bin documents include src
-#
-#
-#
-
-# set the shell to use
-SHELL=/bin/bash
+# 2019 02 24 TWL modified for subu project and placed under MIT license
-# the LIB variable is now passed in to us as a parameter to make, see 'rtmake'
-# LIB=
+# a single space literal, for example if you wanted to subsitute commas to
+# spaces: $(subst $(space),;,$(string)) we ran into this out of a need to send
+# multiple separate command arguments to a shell script from one variable value
+blank :=
+space :=$(blank) $(blank)
# some versions of Linux need a -e option others complain if there is a -e .. and it isn't the binary for echo ..
ECHO= echo
#ECHO= echo -e
-# a single space literal, for example if you wanted to subsitute commas to spaces: $(subst $(space),;,$(string))
-# we ran into this out of a need to send multiple separate command arguments to a shell script from one variable value
-#
-blank :=
-space :=$(blank) $(blank)
-
-
+SHELL=/bin/bash
SCRATCHDIR= 5_scratch # clean and others put things here
+CC=gcc
+CFLAGS=-std=c11 -fPIC -I. -ggdb -DDEBUG
+LIB="libsubu.a"
+LIBPATH="." #no trailing slash
+LINKFLAGS="-L. -lsubu"
+#these are the source files that exist
+SOURCES_LIB= $(wildcard *.lib.c)
+SOURCES_CLI= $(wildcard *.cli.c)
+SOURCES= $(SOURCES_LIB) $(SOURCES_CLI)
-# see 2_bin/local_build for the compile and link flags
-SOURCES= $(wildcard *.lib.cc) $(wildcard *.exl.cc) $(wildcard *.ex.cc)
+#these are the object files to be made
+OBJECTS_LIB= $(patsubst %.c, %.o, $(SOURCES_LIB))
+OBJECTS_CLI= $(patsubst %.c, %.o, $(SOURCES_CLI))
+OBJECTS= $(OBJECTS_LIB) $(OBJECTS_CLI)
-OBJECTS= $(patsubst %.cc, %.o, $(SOURCES))
-LIB_OBJECTS= $(patsubst %.cc, %.o, $(wildcard *.lib.cc))
-EXEC_OBJECTS= $(patsubst %.cc, %.o, $(wildcard *.ex.cc) $(wildcard *.exl.cc) )
+#these are the header files that exist, makeheaders will want to see them
+HFILES = $(wildcard *.lib.h) $(wildcard *.cli.h)
-# the sort causes compiles to go in lexical order by file name, this is used to order the tests e.g.
-EXEC= $(sort $(patsubst %.ex.cc, %, $(wildcard *.ex.cc)))
-EXEC_WL= $(sort $(patsubst %.exl.cc, %, $(wildcard *.exl.cc)))
-EXECS= $(sort $(EXEC_WL) $(EXEC))
+# sort causes compiles to go in lexical order by file name, this is used to order the tests e.g.
+EXECS= $(sort $(patsubst %.cli.c, %, $(wildcard *.cli.c)))
+
+all: version deps lib execs
version:
- @echo '---- rtmake $@:------------------------------------------------------------'
- @echo `pwd`'>'
- @echo source_local_makefile version 4.0
- @echo "RT_BASE: " $(RT_BASE)
- @echo "APPLICATION_BASE: " $(APPLICATION_BASE)
- @echo "APPLICATION: " $(APPLICATION)
- @echo "CXX: " $(CXX)
- @echo "CXXFLAGS: " $(CXXFLAGS)
+ @echo '---- make $@:------------------------------------------------------------'
+ @echo `pwd`'>'
+ @echo makefile version 2.0
+ @echo "CC: " $(CC)
+ @echo "CFLAGS: " $(CFLAGS)
@echo "LIB: " $(LIB)
@echo "LIBPATH: " $(LIBPATH)
@echo "LINKFLAGS: " $(LINKFLAGS)
- @echo "note, the rt bin directory, and the application 2_bin directory must be in the path for rtmake to work:"
- @echo "PATH: " $(PATH)
- @echo '______end rtmake $@_____'
-
-
-# chances are if you got to this makefile that rt_init has been run, but we can catch application_init here
-#
-init:
- @if [ "$(RT_BASE)" == "" ]; then echo "init_rt has not been sourced"; exit 1; fi
- @if [ "$(APPLICATION_BASE)" == "" ]; then echo "init_application has not been sourced"; exit 1; fi
-
-
-
-all: regress
+ @echo '______end make $@_____'
# safe to run this in an already setup or partially setup directory
setup:
- @echo '---- rtmake $@:------------------------------------------------------------'
+ @echo '---- make $@:------------------------------------------------------------'
@echo `pwd`'>'
if [ ! -e $(SCRATCHDIR) ]; then mkdir $(SCRATCHDIR); fi
- if [ ! -e $(RT_BASE)/include/$(APPLICATION) ]; then mkdir $(RT_BASE)/include/$(APPLICATION); fi # a place to put the individual header files
- if [ ! -e 0_Copyright_Notice.txt ]; then cp $(RT_BASE)/documents/0_Copyright_Notice.txt .; fi
if [ ! -e 1_tests ]; then mkdir 1_tests; fi
if [ ! -e 1_try ]; then mkdir 1_try; fi
if [ ! -e 2_bin ]; then mkdir 2_bin; fi
if [ ! -e 3_documents ]; then mkdir 3_documents; fi
if [ ! -e 3_to_do.txt ]; then touch 3_to_do.txt; fi
if [ ! -e 5_deprecated ]; then mkdir 5_deprecated; fi
- @echo '______end rtmake $@_____'
+ @echo '______end make $@_____'
-deps: init
- @echo '---- rtmake $@:------------------------------------------------------------'
+deps:
+ @echo '---- make $@:------------------------------------------------------------'
@echo `pwd`'>'
- $(CXX) $(CXXFLAGS) -MM $(SOURCES) 1> 2_makefile_deps
- for i in $(EXEC_WL) ; do\
- $(ECHO) >> 2_makefile_deps;\
- $(ECHO) "$$i : $$i.exl.o $(LIBPATH)/$(LIB)" >> 2_makefile_deps;\
- $(ECHO) " $(CXX) -o $$i $$i.exl.o $(LINKFLAGS)" >> 2_makefile_deps;\
- done
- for i in $(EXEC) ; do\
- echo >> 2_makefile_deps;\
- $(ECHO) "$$i : $$i.ex.o" >> 2_makefile_deps;\
- $(ECHO) " $(CXX) -o $$i $$i.ex.o" >> 2_makefile_deps;\
- done
- @echo '______end rtmake $@_____'
-
-lib: init clear_test_flags
- @echo '---- rtmake $@:------------------------------------------------------------'
+ makeheaders $(SOURCES) $(HFILES)
+ $(CC) $(CFLAGS) -MM $(SOURCES) 1> 2_makefile_deps
+ for i in $(EXECS) ; do\
+ $(ECHO) >> 2_makefile_deps;\
+ $(ECHO) "$$i : $$i.cli.o $(LIBPATH)/$(LIB)" >> 2_makefile_deps;\
+ $(ECHO) " $(CXX) -o $$i $$i.cli.o $(LINKFLAGS)" >> 2_makefile_deps;\
+ done
+ @echo '______end make $@_____'
+
+lib:
+ @echo '---- make $@:------------------------------------------------------------'
@echo `pwd`'>'
- if [ ! -e 2_makefile_deps ]; then rtmake deps; fi # the user must delete 2_makefile_deps if deps change!
- rtmake sub_lib
- @echo '______end rtmake $@_____'
+ if [ ! -e 2_makefile_deps ]; then make deps; fi # the user must delete 2_makefile_deps if deps change!
+ make sub_lib
+ @echo '______end make $@_____'
sub_lib: $(LIB)
-$(LIBPATH)/$(LIB):
- @if [ "$(LIBPATH)" != "$(APPLICATION_BASE)" ]; then \
- echo "LIBPATH: " "$(LIBPATH)";\
- echo "$APPLICATION_BASE: " "$(APPLICATION_BASE)";\
- echo "The library path is not the same as the application base so don't know how to make it.";\
- fi
- [ "$(LIBPATH)" == "$(APPLICATION_BASE)" ]
- cd $(APPLICATION_BASE); rtmake lib
-
-execs: init $(LIBPATH)/$(LIB)
- @echo '---- rtmake $@:------------------------------------------------------------'
+execs: $(LIBPATH)/$(LIB)
+ @echo '---- make $@:------------------------------------------------------------'
@echo `pwd`'>'
- if [ ! -e 2_makefile_deps ]; then rtmake deps; fi
- rtmake sub_execs
- # for i in $(EXEC_OBJECTS); do rm $$i; done
- @echo '______end rtmake $@_____'
+ if [ ! -e 2_makefile_deps ]; then make deps; fi
+ make sub_execs
+ @echo '______end make $@_____'
sub_execs: $(EXECS)
-
-clear_test_flags:
- @if [ ! -d 1_tests ]; then echo "can only rtmake tests when there is a 1_tests directory, did you mean: rtmake execs ?"; fi
- @ test -d 1_tests # we only need to clear tests flags when there is a tests dir
- @echo '---- rtmake $@:------------------------------------------------------------'
- @echo `pwd`'>'
- echo `date_stamp` $(APPLICATION) > 1_tests_log
- if [ -f 1_tests_passed ]; then \
- if [ `repo_tracks 1_tests_passed` == "y" ]; then hg rm 1_tests_passed; else rm 1_tests_passed; fi; \
- fi
- if [ -f 1_tests_failed ]; then \
- if [ `repo_tracks 1_tests_failed` == "y" ]; then hg rm 1_tests_failed; else rm 1_tests_failed; fi; \
- fi
- echo "tests have not been run" > 1_tests_log
- @echo '______end rtmake $@_____'
-
-tests: clear_test_flags
- @echo '---- rtmake $@:------------------------------------------------------------'
- @echo `pwd`'>'
- echo `date_stamp` $(APPLICATION) > 1_tests_log
- cd 1_tests; rtmake sub_test;
- @echo '______end rtmake $@_____'
-
-sub_test:
- rtmake execs
- for i in $(EXECS); do \
- echo >> ../1_tests_log; \
- echo ">$$i launching .." | tee -a ../1_tests_log;\
- if ./$$i 2>> ../1_tests_log; then echo ">$$i passed" | tee -a ../1_tests_log; else echo "#>$$i failed" | tee -a ../1_tests_log; touch ../1_tests_failed; fi;\
- done
- if [ -e ../1_tests_failed ]; then echo "test set FAIL" | tee -a ../1_tests_log; \
- else echo "test set PASS" | tee -a ../1_tests_log; touch ../1_tests_passed; fi #if none failed, then they passed
-
-regress: init
- @if [ ! -d 1_tests ]; then echo "can only do regression when there is a 1_tests directory"; fi
- @test -d 1_tests
- @echo '---- rtmake $@:------------------------------------------------------------'
- @echo `pwd`'>'
- rtmake dist_clean
- rtmake deps
- rtmake lib
- rtmake tests
- @echo '______end rtmake $@_____'
-
+#not ready yet
install: all
- @echo '---- rtmake $@:------------------------------------------------------------'
+ @echo '---- make $@:------------------------------------------------------------'
@echo `pwd`'>'
@if[ ! -e 1_tests_passed ]; then echo "can't install as tests have not passed"; fi
@test -e test_passed
cp $(LIB) $(RT_BASE)/lib
cp $(APPLICATION).h $(RT_BASE)/include
if [ -d $(APPLICATION) ]; then cp $(APPLICATION)/*.h $(RT_BASE)/include/$(APPLICATION); fi
- @echo '______end rtmake $@_____'
+ @echo '______end make $@_____'
-# "rtmake lib" "rtmake execs" now cleans up the .o files afterward, so clean should not be needed often
-# clean works on the current working directory, dist_clean also descends into 1_tests and 1_try
-#
-clean: init
- @echo '---- rtmake $@:------------------------------------------------------------'
+clean:
+ @echo '---- make $@:------------------------------------------------------------'
@echo `pwd`'>'
for i in $(wildcard *~); do mv $$i $(SCRATCHDIR); done
- for i in $(wildcard *.lib.o) $(wildcard *.exl.o) $(wildcard *.ex.o); do rm $$i; done
+ for i in $(wildcard *.lib.o) $(wildcard *.cli.o); do rm $$i; done
+ for i in $(HFILES); do mv $$i 5_scratch; done # just in case someone wrote a header file
if [ -f 2_makefile_deps ]; then rm 2_makefile_deps; fi
- if [ -f $(LIB) ]; then mv $(LIB) 5_scratch; fi
- for i in $(EXEC_WL) $(EXEC); do if [ -e $$i ]; then rm $$i; fi; done
- @echo '______end rtmake $@_____'
+ if [ -f $(LIB) ]; then rm $(LIB); fi
+ for i in $(EXECS); do if [ -e $$i ]; then rm $$i; fi; done
+ @echo '______end make $@_____'
+# not ready ...
# dist_clean is used to clean thing up before doing a checkin, hg add should be safe after a dist_clean
# dist_clean will recurse into the include directory = $(APPLICATION), tests, and try if they are present
#
-dist_clean: init
- @echo '---- rtmake $@:------------------------------------------------------------'
+dist_clean:
+ @echo '---- make $@:------------------------------------------------------------'
@echo `pwd`'>'
- rtmake clean
- if [ -d $(APPLICATION) ]; then cd $(APPLICATION); rtmake clean; fi
- if [ -d 1_tests ]; then cd 1_tests; rtmake clean; fi
- if [ -d 1_try ] ; then cd 1_try; rtmake clean; fi
- @echo '______end rtmake $@_____'
+ make clean
+ if [ -d $(APPLICATION) ]; then cd $(APPLICATION); make clean; fi
+ if [ -d 1_tests ]; then cd 1_tests; make clean; fi
+ if [ -d 1_try ] ; then cd 1_try; make clean; fi
+ @echo '______end make $@_____'
-include 2_makefile_deps
# recipe for making object files:
#
-%.o : %.cc
- $(CXX) $(CXXFLAGS) -c $<
+%.o : %.c
+ $(CC) $(CFLAGS) -c $<
#
-$(LIB) : $(LIB_OBJECTS)
- ar rcs $(LIB) $(LIB_OBJECTS)
-# for i in $(LIB_OBJECTS); do rm $$i; done
-
-
-
+$(LIB) : $(OBJECTS_LIB)
+ ar rcs $(LIB) $(OBJECTS_LIB)
currently a unit converted to base 10 will always fit in a 21 bit buffer.
*/
+#include "subu-config.lib.h"
#if INTERFACE
#include <sqlite3.h>
#define ERR_CONFIG_FILE -1
#endif
+
#include <stdio.h>
#include <string.h>
-#include "subu-config.lib.h"
+#include <stdlib.h>
//char config_file[] = "/etc/subu.db";
char config_file[] = "subu.db";
return sqlite3_exec(db, sql, NULL, NULL, NULL);
}
-int subu_number(sqlite3 *db, uint &subu_number){
- subu_number = 0;
+int subu_number(sqlite3 *db, uint **subu_number){
+ *subu_number = 0;
char *sql =
"BEGIN TRANSACTION;"
"UPDATE Key_Int SET value = value + 1 WHERE key = 'max_subu_number';"
sqlite3_stmt *stmt;
ret = sqlite3_prepare_v2(db, sql, sql_len, &stmt, NULL);
if( ret != SQLITE_OK ){
- free(subuland);
- free(subuhome);
- sqlite3_close(db);
return ERR_CONFIG_FILE;
}
sqlite3_stmt *res;
#undef INTERFACE
#include <sqlite3.h>
typedef unsigned int uint;
-int subu_number(sqlite3 *db,uint&subu_number);
+int subu_number(sqlite3 *db,uint **subu_number);
int schema(sqlite3 *db,uint max_subu_number);
extern char config_file[];
#define ERR_CONFIG_FILE -1
int schema(sqlite3 *db,uint max_subu_number);
extern char config_file[];
int main();
+int main();
+int main(int argc,char **argv,char **env);
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+#include <sqlite3.h>
+extern char config_file[];
+int subu_mk_0(char *subuname,char *config_file);
+int main();
+int main();
+int main(int argc,char **argv,char **env);
*/
+#include "subu-mk-0.lib.h"
// without this #define we get the warning: implicit declaration of function ‘seteuid’/‘setegid’
#define _GNU_SOURCE
#include <string.h>
#include <sys/stat.h>
#include <stdbool.h>
-#include "dispatch_f.lib.h"
-#include "dispatch_exec.lib.h"
-#include "dispatch_useradd.lib.h"
-#include "subu-mk-0.lib.h"
-typedef unsigned int uint;
+#if INTERFACE
+#define ERR_SUBU_MK_0_CONFIG_FILE 1
+#define ERR_SUBU_MK_0_SETUID_ROOT 2
+#define ERR_SUBU_MK_0_BAD_MASTERU_HOME 3
+#define ERR_SUBU_MK_0_MALLOC 4
+#define ERR_SUBU_MK_0_MK_SUBUHOME 5
+#define ERR_SUBU_MK_0_FAILED_MKDIR_SUBU 6
+#define ERR_SUBU_MK_0_BUG_SSS 7
+#define ERR_SUBU_MK_0_FAILED_USERADD 8
+#define ERR_SUBU_MK_0_SETFACL 9
+#endif
+
/*
Fedora 29's sss_cache is checking the inherited uid instead of the effective
// a well formed subuname
// returns the length of the subuname, or -1
int allowed_subuname(char *subuname){
- char *ch = token;
+ char *ch = subuname;
uint i = 0;
while(
*ch
&&
i < max_subuname_len
&&
- ( ch >= 'a' && ch <= 'z'
+ ( *ch >= 'a' && *ch <= 'z'
||
- ch >= 'A' && ch <= 'Z'
+ *ch >= 'A' && *ch <= 'Z'
||
- ch >= '0' && ch <= '9'
+ *ch >= '0' && *ch <= '9'
||
- ch == '_'
+ *ch == '_'
||
- ch == '.'
+ *ch == '.'
||
- ch == ' '
+ *ch == ' '
)
){
ch++;
i++;
}
- if( !*ch && i < max_len; )
+ if( !*ch && i < max_subuname_len )
return i;
else
return -1;
sqlite3 *db;
{
if( sqlite3_open(config_file, &db) ){
- fprintf(stderr, "error exit, could not open config file, \"%s\"\n", file);
- return ERR_CONFIG_FILE;
+ fprintf(stderr, "error exit, could not open config file, \"%s\"\n", config_file);
+ return ERR_SUBU_MK_0_CONFIG_FILE;
}
}
if( masteru_uid == 0 || set_euid != 0 ){
fprintf(stderr, "error exit, this program must be run setuid root from a user account\n");
sqlite3_close(db);
- return ERR_SETUID_ROOT;
+ return ERR_SUBU_MK_0_SETUID_ROOT;
}
}
if( subuname_len == -1 ){
fprintf(stderr, "error exit, subuname is not in [ _.a-zA-Z0-9]* less than %u characters", max_subuname_len);
sqlite3_close(db);
- return ERR_CONFIG_FILE;
+ return ERR_SUBU_MK_0_CONFIG_FILE;
}
}
char *subuhome;
size_t subuhome_len;
{
- masteru_pw_record_pt = getpwuid(masteru_uid); // reading /etc/passwd
+ struct passwd *masteru_pw_record_pt = getpwuid(masteru_uid); // reading /etc/passwd
masteru_name = masteru_pw_record_pt->pw_name;
#ifdef DEBUG
dbprintf("masteru_name \"%s\"\n", masteru_name);
if( masteru_name_len == -1 ){
fprintf(stderr, "error exit, masteru_name is not in [ _.a-zA-Z0-9]* less than %u characters", max_subuname_len);
sqlite3_close(db);
- return ERR_CONFIG_FILE;
+ return ERR_SUBU_MK_0_CONFIG_FILE;
}
masteru_home = masteru_pw_record_pt->pw_dir;
#ifdef DEBUG
if( masteru_home_len == 0 || masteru_home[0] == '(' ){
fprintf(stderr,"error exit, %s has no home directory\n", masteru_name);
sqlite3_close(db);
- return ERR_BAD_MASTERU_HOME;
+ return ERR_SUBU_MK_0_BAD_MASTERU_HOME;
}
char *subuland_extension = "/subuland/";
size_t subuland_extension_len = strlen(subuland_extension);
perror(perror_src);
free(subuland);
sqlite3_close(db);
- return ERR_MALLOC;
+ return ERR_SUBU_MK_0_MALLOC;
}
strcpy (subuhome, subuland);
strcpy (subuhome + subuland_len, subuname);
free(subuland);
free(subuhome);
sqlite3_close(db);
- return ERR_MK_SUBUHOME;
+ return ERR_SUBU_MK_0_MK_SUBUHOME;
}
int ret = dispatch_f_euid_egid
(
free(subuland);
free(subuhome);
sqlite3_close(db);
- return ERR_FAILED_MKDIR_SUBU;
+ return ERR_SUBU_MK_0_FAILED_MKDIR_SUBU;
}
}
#ifdef DEBUG
free(subuland);
free(subuhome);
sqlite3_close(db);
- return ERR_BUG_SSS;
+ return ERR_SUBU_MK_0_BUG_SSS;
}
#endif
char *command = "/usr/sbin/useradd";
free(subuland);
free(subuhome);
sqlite3_close(db);
- return ERR_FAILED_USERADD;
+ return ERR_SUBU_MK_0_FAILED_USERADD;
}
#ifdef DEBUG
dbprintf("useradd finished\n");
free(subuland);
free(subuhome);
sqlite3_close(db);
- return ERR_SETFACL;
+ return ERR_SUBU_MK_0_SETFACL;
}
// 2.1 x acls on subuland
// setfacl -m u:subuname:x subuland
free(subuland);
free(subuhome);
sqlite3_close(db);
- return ERR_SETFACL;
+ return ERR_SUBU_MK_0_SETFACL;
}
// 2.2 x acls on masteru_home
// setfacl -m u:subuname:x masteru_home
free(subuland);
free(subuhome);
sqlite3_close(db);
- return ERR_SETFACL;
+ return ERR_SUBU_MK_0_SETFACL;
}
// 3. give subu ownership of subuhome
free(subuland);
free(subuhome);
sqlite3_close(db);
- return ERR_SETFACL;
+ return ERR_SUBU_MK_0_SETFACL;
}
#ifdef DEBUG
dbprintf("masteru now has default access\n");
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+int dispatch_exec(char **argv,char **envp);
+#include <sys/types.h>
+#include <pwd.h>
+typedef struct dispatch_useradd_ret_t dispatch_useradd_ret_t;
+typedef unsigned int uint;
+struct dispatch_useradd_ret_t {
+ uint error;
+ struct passwd *pw_record;
+};
+struct dispatch_useradd_ret_t dispatch_useradd(char **argv,char **envp);
+int dispatch_f_euid_egid(char *fname,int(*f)(void *arg),void *f_arg,uid_t euid,gid_t egid);
+int dbprintf(const char *format,...);
+#include <sqlite3.h>
+extern char config_file[];
+int subu_mk_0(char *subuname,char *config_file);
+int masteru_makes_subuhome(void *arg);
+int allowed_subuname(char *subuname);
+#define ERR_SUBU_MK_0_SETFACL 9
+#define ERR_SUBU_MK_0_FAILED_USERADD 8
+#define ERR_SUBU_MK_0_BUG_SSS 7
+#define ERR_SUBU_MK_0_FAILED_MKDIR_SUBU 6
+#define ERR_SUBU_MK_0_MK_SUBUHOME 5
+#define ERR_SUBU_MK_0_MALLOC 4
+#define ERR_SUBU_MK_0_BAD_MASTERU_HOME 3
+#define ERR_SUBU_MK_0_SETUID_ROOT 2
+#define ERR_SUBU_MK_0_CONFIG_FILE 1
+#define INTERFACE 0
--- /dev/null
+/* \aThis file was automatically generated. Do not edit! */
+#undef INTERFACE
+#include <sqlite3.h>
+typedef unsigned int uint;
+int subu_number(sqlite3 *db,uint **subu_number);
+#define ERR_CONFIG_FILE -1
+extern char config_file[];
+int main();
+int main();
+int main(int argc,char **argv,char **env);