*** 1.27r3-pre/linuxconf/rules.mak Sat Mar 2 21:13:46 2002
--- 1.27r4/linuxconf/rules.mak Fri Apr 12 14:16:39 2002
***************
*** 27,33 ****
endif
CC=gcc
LINUXCONF_REV=1.27
! LINUXCONF_SUBREV=3
LINUXCONF_SUBSUBREV=0
# liblinuxconf revision
LIB_REV=1
--- 27,33 ----
endif
CC=gcc
LINUXCONF_REV=1.27
! LINUXCONF_SUBREV=4
LINUXCONF_SUBSUBREV=0
# liblinuxconf revision
LIB_REV=1
***************
*** 56,61 ****
--- 56,64 ----
WWWTECHBASE=$(WWWBASE)/linuxconf/tech
SPEC_FILE = $(shell $(GCC) -v 2>&1 | head -1 | sed 's/^.* //')
LD_FILE = $(notdir $(shell cat $(SPEC_FILE) | sed -n -e '/:-dynamic-linker/s/^.*:-dynamic-linker \([^}]*\).*/\1/p'))
+ ifeq ($(LD_FILE),%(elf_dynamic_linker))
+ LD_FILE = $(notdir $(shell cat $(SPEC_FILE) | sed -n -e '/^\*elf_dynamic_linker:/,+1 { /^[^\*]/p}'))
+ endif
ifeq ($(patsubst ld.so.%,ld2,$(LD_FILE)),ld2)
LD2=1
endif
*** 1.27r3-pre/linuxconf/builder/ccrules.mak Tue Feb 19 21:59:05 2002
--- 1.27r4/linuxconf/builder/ccrules.mak Mon Apr 8 12:37:54 2002
***************
*** 37,48 ****
.cc.o:
@echo " " $<
@$(GPP) $(FLAGS) $(CPP_DEFINES) -DPACKAGE_REV=\"$(PACKAGE_REV)\" \
! $(INCLUDEDIRECTIVES) -I/usr/include/tlmp -I/usr/include/linuxconf -c $< -o $@
.cc.os:
@echo " " $<
@$(GPP) -fPIC $(FLAGS) $(CPP_DEFINES) -DPACKAGE_REV=\"$(PACKAGE_REV)\" \
! $(INCLUDEDIRECTIVES) -I/usr/include/tlmp -I/usr/include/linuxconf -c $< -o $@
.tlcc.o:
@echo " " $<
--- 37,52 ----
.cc.o:
@echo " " $<
@$(GPP) $(FLAGS) $(CPP_DEFINES) -DPACKAGE_REV=\"$(PACKAGE_REV)\" \
! $(INCLUDEDIRECTIVES) -I/usr/include/tlmp -I/usr/include/linuxconf \
! $(CCDEFINES) \
! -c $< -o $@
.cc.os:
@echo " " $<
@$(GPP) -fPIC $(FLAGS) $(CPP_DEFINES) -DPACKAGE_REV=\"$(PACKAGE_REV)\" \
! $(INCLUDEDIRECTIVES) -I/usr/include/tlmp -I/usr/include/linuxconf \
! $(CCDEFINES) \
! -c $< -o $@
.tlcc.o:
@echo " " $<
***************
*** 56,61 ****
--- 60,66 ----
$< `basename $< .tlcc`.cpp
@$(GPP) $(FLAGS) $(CPP_DEFINES) -DPACKAGE_REV=\"$(PACKAGE_REV)\" \
$(INCLUDEDIRECTIVES) -I/usr/include/tlmp -I/usr/include/linuxconf \
+ $(CCDEFINES) \
-c `basename $< .tlcc`.cpp -o $@ || \
( rm -f `basename $< .tlcc`.cpp ; exit 1)
@rm -f `basename $< .tlcc`.cpp /tmp/`basename $< .tlcc`.versions
***************
*** 72,77 ****
--- 77,83 ----
$< `basename $< .tlcc`.cpp
@$(GPP) -fPIC $(FLAGS) $(CPP_DEFINES) -DPACKAGE_REV=\"$(PACKAGE_REV)\" \
$(INCLUDEDIRECTIVES) -I/usr/include/tlmp -I/usr/include/linuxconf \
+ $(CCDEFINES) \
-c `basename $< .tlcc`.cpp -o $@ || \
( rm -f `basename $< .tlcc`.cpp ; exit 1)
@rm -f `basename $< .tlcc`.cpp /tmp/`basename $< .tlcc`.versions
***************
*** 87,92 ****
--- 93,102 ----
clean: $(LOCAL_CLEAN)
rm -f x *.o *.os *.obt *.bak .bak *~ *.a *.old *.log *.nap *.nar core
@for i in $(DIRS); do make -C $$i clean || exit 1; done
+
+ all:
+ @for i in $(DIRS); do make GCC=$(GCC) GPP=$(GPP) -C $$i $@ || exit 1; done
+
else
clean: $(LOCAL_CLEAN)
rm -f x *.o *.os *.obt *.bak *~ *.a *.old *.log *.nap *.nar
*** 1.27r3-pre/linuxconf/help.files/sources/updatemon/FILE_LIST Tue Nov 28 21:53:18 2000
--- 1.27r4/linuxconf/help.files/sources/updatemon/FILE_LIST Sat Apr 6 23:07:34 2002
***************
*** 1,3 ****
updatemon
updatewin
!
--- 1,3 ----
updatemon
updatewin
! commandwin
*** 1.27r3-pre/linuxconf/help.files/sources/updatemon/commandwin-1.html
--- 1.27r4/linuxconf/help.files/sources/updatemon/commandwin-1.html Sat Apr 6 23:13:07 2002
***************
*** 0 ****
--- 1,42 ----
+
+
+
+
+ Linuxconf actions log window: The "Actions" pane
+
+
+
+
+ Next
+ Previous
+ Contents
+
+
+
+ This log window is presented at the bottom of the main linuxconf window.
+ In treemenu mode. It is only available in treemenu mode.
+
The window presents a line for action done by linuxconf. Those
+ actions are also logged in the file /var/log/netconf.log
+ and you can review this file using the menu
+ "status/logs/linuxconf logs"
+
+
+
+ The log window may be presented from the updates menu bar.
+ Even if the log window
+ is not visible, actions are still recorded, so you can open and
+ close the window during a session as needed.
+
+
+
+ Visit the menu "status/logs/linuxconf logs" to review all the
+ actions logged in /var/log/netconf.log
.
+
+
+ Next
+ Previous
+ Contents
+
+
*** 1.27r3-pre/linuxconf/help.files/sources/updatemon/commandwin.help
--- 1.27r4/linuxconf/help.files/sources/updatemon/commandwin.help Sat Apr 6 23:13:06 2002
***************
*** 0 ****
--- 1,66 ----
+ Linuxconf actions log window
+
+
+ Many people really want to learn what is going on under the hood.
+ They either want to learn what linuxconf is doing, or how they can
+ achieve a change manually. The module updatemon provides some help.
+
+ 11.. TThhee ""AAccttiioonnss"" ppaannee
+
+ This log window is presented at the bottom of the main linuxconf
+ window. In treemenu mode. It is only available in treemenu mode.
+
+ The window presents a line for action done by linuxconf. Those actions
+ are also logged in the file /var/log/netconf.log and you can review
+ this file using the menu "status/logs/linuxconf logs"
+
+
+ 11..11.. OOppeerraattiioonn iinn GGUUII mmooddee
+
+ The log window may be presented from the updates menu bar. Even if
+ the log window is not visible, actions are still recorded, so you can
+ open and close the window during a session as needed.
+
+
+ 11..22.. OOppeerraattiioonn iinn tteexxtt aanndd HHTTMMLL mmooddee
+
+ Visit the menu "status/logs/linuxconf logs" to review all the actions
+ logged in /var/log/netconf.log.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
*** 1.27r3-pre/linuxconf/help.files/sources/updatemon/commandwin.html
--- 1.27r4/linuxconf/help.files/sources/updatemon/commandwin.html Sat Apr 6 23:13:07 2002
***************
*** 0 ****
--- 1,36 ----
+
+
+
+
+ Linuxconf actions log window
+
+
+
+
+
+ Next
+ Previous
+ Contents
+
+ Linuxconf actions log window
+
+
+
+ Many people really want to learn what is going on under the hood.
+ They either want to learn what linuxconf is doing, or how they
+ can achieve a change manually. The module updatemon provides
+ some help.
+
+
+
+
+
+
+ Next
+ Previous
+ Contents
+
+
*** 1.27r3-pre/linuxconf/help.files/sources/updatemon/commandwin.sgml
--- 1.27r4/linuxconf/help.files/sources/updatemon/commandwin.sgml Sat Apr 6 23:13:03 2002
***************
*** 0 ****
--- 1,36 ----
+
+
+ Linuxconf actions log window
+
+
+
+ Many people really want to learn what is going on under the hood.
+ They either want to learn what linuxconf is doing, or how they
+ can achieve a change manually. The module updatemon provides
+ some help.
+
+
+ The "Actions" pane
+
+ This log window is presented at the bottom of the main linuxconf window.
+ In treemenu mode. It is only available in treemenu mode.
+
+ The window presents a line for action done by linuxconf. Those
+ actions are also logged in the file /var/log/netconf.log
+ and you can review this file using the menu
+ "status/logs/linuxconf logs"
+
+ Operation in GUI mode
+
+ The log window may be presented from the updates menu bar.
+ Even if the log window
+ is not visible, actions are still recorded, so you can open and
+ close the window during a session as needed.
+
+ Operation in text and HTML mode
+
+ Visit the menu "status/logs/linuxconf logs" to review all the
+ actions logged in /var/log/netconf.log .
+
+
+
*** 1.27r3-pre/linuxconf/main/Makefile Mon Jul 30 13:14:31 2001
--- 1.27r4/linuxconf/main/Makefile Sat Apr 6 13:59:09 2002
***************
*** 28,35 ****
`../utils/no_samples samples.o $(LIBS)` $(DBGLIBS)
OBJWRAPPER=../userconf/usercomng.o ../userconf/privi.o ../tlmp/*/*.o
! wrapper: wrapper.o ../misc/module.o ../misc/libmodules.o _dict.o
! $(GPPLINK) wrapper.o ../misc/module.o ../misc/libmodules.o \
_dict.o `../utils/no_samples samples.o $(OBJWRAPPER)` -o linuxconf-wrapper $(LDF) \
../userconf/userconf.a ../fstab/fstab.a ../netconf/netconf.a \
../askrunlevel/askrunlevel.a \
--- 28,35 ----
`../utils/no_samples samples.o $(LIBS)` $(DBGLIBS)
OBJWRAPPER=../userconf/usercomng.o ../userconf/privi.o ../tlmp/*/*.o
! wrapper: wrapper.o ../misc/module.o ../misc/filecfg.o ../misc/libmodules.o _dict.o
! $(GPPLINK) wrapper.o ../misc/module.o ../misc/filecfg.o ../misc/libmodules.o \
_dict.o `../utils/no_samples samples.o $(OBJWRAPPER)` -o linuxconf-wrapper $(LDF) \
../userconf/userconf.a ../fstab/fstab.a ../netconf/netconf.a \
../askrunlevel/askrunlevel.a \
*** 1.27r3-pre/linuxconf/main/linuxconf.cc Wed Jan 2 22:54:28 2002
--- 1.27r4/linuxconf/main/linuxconf.cc Thu Apr 4 17:04:19 2002
***************
*** 773,779 ****
}
}
! static SSTRINGS tree_keys,tree_titles,tree_icons,tree_modules;
static SSTRING tree_version,tree_lang;
static FILE_CFG *collect_fout = NULL;
--- 773,779 ----
}
}
! static SSTRINGS tree_keys,tree_titles,tree_icons,tree_modules,tree_others;
static SSTRING tree_version,tree_lang;
static FILE_CFG *collect_fout = NULL;
***************
*** 824,837 ****
static const char K_VERSION[]="version";
static const char K_LANG[]="lang";
- SSTRINGS others;
if (tree_keys.getnb()==0){
CONFDB db (f_treemenu);
db.getall (K_TREE,K_KEY,tree_keys,1);
db.getall (K_TREE,K_TITLE,tree_titles,1);
db.getall (K_TREE,K_ICON,tree_icons,1);
db.getall (K_TREE,K_MODULE,tree_modules,1);
! db.getall (K_TREE,K_OTHER,others,1);
tree_version.setfrom (db.getval (K_TREE,K_VERSION));
tree_lang.setfrom (db.getval (K_TREE,K_LANG));
}
--- 824,836 ----
static const char K_VERSION[]="version";
static const char K_LANG[]="lang";
if (tree_keys.getnb()==0){
CONFDB db (f_treemenu);
db.getall (K_TREE,K_KEY,tree_keys,1);
db.getall (K_TREE,K_TITLE,tree_titles,1);
db.getall (K_TREE,K_ICON,tree_icons,1);
db.getall (K_TREE,K_MODULE,tree_modules,1);
! db.getall (K_TREE,K_OTHER,tree_others,1);
tree_version.setfrom (db.getval (K_TREE,K_VERSION));
tree_lang.setfrom (db.getval (K_TREE,K_LANG));
}
***************
*** 843,849 ****
curothers.sort();
}
if (linuxconf_diffmod (*curloaded,tree_modules)
! || linuxconf_diffmod (curothers,others)
|| tree_version.cmp(PACKAGE_REV)!=0
|| tree_lang.cmp(linuxconf_getlang())!=0){
xconf_notice (MSG_U(N_BUILDTREE
--- 842,848 ----
curothers.sort();
}
if (linuxconf_diffmod (*curloaded,tree_modules)
! || linuxconf_diffmod (curothers,tree_others)
|| tree_version.cmp(PACKAGE_REV)!=0
|| tree_lang.cmp(linuxconf_getlang())!=0){
xconf_notice (MSG_U(N_BUILDTREE
*** 1.27r3-pre/linuxconf/messages/sources/redhatppp.dic Fri Nov 24 00:03:14 2000
--- 1.27r4/linuxconf/messages/sources/redhatppp.dic Fri Apr 12 14:14:44 2002
***************
*** 171,173 ****
--- 171,175 ----
:E Update the firewall rules
!I_PPPDEVDESC
:E Dialout configuration %s
+ !I_USEWVDIAL
+ :E Use wvdial
*** 1.27r3-pre/linuxconf/messages/sources/updatemon.dic Fri Dec 8 11:01:12 2000
--- 1.27r4/linuxconf/messages/sources/updatemon.dic Sat Apr 6 23:18:22 2002
***************
*** 1,4 ****
! @version 1
!T_USAGE
:E linuxconf --modulemain updatemon usage\n\n updatemon --option ...\n
!M_updatemon
--- 1,4 ----
! @version 2
!T_USAGE
:E linuxconf --modulemain updatemon usage\n\n updatemon --option ...\n
!M_updatemon
***************
*** 6,20 ****
!M_UPDLOG
:E Updates
!M_LOGWIN
! :E Log window
!M_INTERACTIVE
:E Interactive updates
- !M_HISTORY
- :E History
!T_UPDATEMON
:E Updates monitor
!H_FILEPATH
! :E Time\tUpdated configuration files
!F_FILE
:E Configuration file
!F_DIFF
--- 6,18 ----
!M_UPDLOG
:E Updates
!M_LOGWIN
! :E File updates log
!M_INTERACTIVE
:E Interactive updates
!T_UPDATEMON
:E Updates monitor
!H_FILEPATH
! :E Date\tAdmin.\tUpdated configuration files
!F_FILE
:E Configuration file
!F_DIFF
***************
*** 40,46 ****
!T_UPDATING
:E Updating one file
!M_UPDHISTORY
! :E update history
!M_SHOWDIFF
:E differences
!M_EXTRACT
--- 38,44 ----
!T_UPDATING
:E Updating one file
!M_UPDHISTORY
! :E updates history
!M_SHOWDIFF
:E differences
!M_EXTRACT
***************
*** 69,71 ****
--- 67,81 ----
:E Enable the file updates window
!F_DIFFOPT
:E Diff command options
+ !P_VIEWUPDATES
+ :E view file updates
+ !F_LENLOG
+ :E filesupd.log length
+ !T_COMMANDLOG
+ :E Actions
+ !M_CMDWIN
+ :E Linuxconf actions log
+ !H_COMMANDS
+ :E Date\tActions
+ !I_CMDWIN
+ :E Enable the actions window
*** 1.27r3-pre/linuxconf/misc/cfgarchive Fri Dec 8 11:00:45 2000
--- 1.27r4/linuxconf/misc/cfgarchive Thu Apr 4 22:41:07 2002
***************
*** 57,62 ****
--- 57,64 ----
rm -f $TARGET
fi
elif [ "$1" = "--extr" ] ; then
+ # We flush whatever linuxconf is sending to us
+ cat >/dev/null
if [ -f $TARGET,v ] ; then
$RCSCO $RCSOPT $TARGET 2>/dev/null
cat $TARGET
***************
*** 69,74 ****
--- 71,77 ----
echo "### no arch ###"
fi
elif [ "$1" = "--hist" ] ; then
+ # We flush whatever linuxconf is sending to us
cat >/dev/null
if [ -x $RCSRLOG ] ; then
if [ -f $TARGET,v ] ; then
*** 1.27r3-pre/linuxconf/misc/configf.cc Mon Nov 5 16:30:51 2001
--- 1.27r4/linuxconf/misc/configf.cc Fri Apr 5 14:01:25 2002
***************
*** 976,981 ****
--- 976,982 ----
sprintf (args,"%s %s %s",cfg_arg,intern->realpath,arch);
POPEN pop (cfg_command,args);
if (pop.isok()){
+ pop.closepipe();
if (pop.wait(10)>=0){
char line[300];
if (pop.readout(line,sizeof(line)-1) != -1){
*** 1.27r3-pre/linuxconf/misc/misc.h Tue Aug 21 13:21:20 2001
--- 1.27r4/linuxconf/misc/misc.h Sat Apr 6 21:33:15 2002
***************
*** 65,70 ****
--- 65,80 ----
};
+ template< class T>
+ class ARRAY_OBJS: public ARRAY{
+ public:
+ T *getitem(int no) const
+ {
+ return (T*)ARRAY::getitem(no);
+ }
+ };
+
+
#ifndef SSTRING_H
#include "sstring.h"
#endif
***************
*** 126,135 ****
--- 136,147 ----
const char *_key2);
CONTEXT_LOCK (const char *key);
private:
+ void check (bool msg)const;
void init (const char *_key1,
const char *_key2,
int _flags);
public:
+ bool isok (int seconds)const;
bool isok (void)const;
~CONTEXT_LOCK (void);
/*~PROTOEND~ CONTEXT_LOCK */
*** 1.27r3-pre/linuxconf/misc/popen.cc Fri Feb 1 22:56:56 2002
--- 1.27r4/linuxconf/misc/popen.cc Fri Apr 5 14:01:07 2002
***************
*** 784,793 ****
/*
Closing the PIPE to standard input of the command.
- Expect the command to terminate soon (20 seconds timeout).
- Return the exit code
*/
! PUBLIC int POPEN::close()
{
if (fds.fin != NULL){
fclose (fds.fin);
--- 784,791 ----
/*
Closing the PIPE to standard input of the command.
*/
! PUBLIC void POPEN::closepipe()
{
if (fds.fin != NULL){
fclose (fds.fin);
***************
*** 797,802 ****
--- 795,812 ----
::close (fds.in);
fds.in = -1;
}
+ }
+
+
+
+ /*
+ Closing the PIPE to standard input of the command.
+ Expect the command to terminate soon (20 seconds timeout).
+ Return the exit code
+ */
+ PUBLIC int POPEN::close()
+ {
+ closepipe();
time_t end = time(NULL) + 20;
//printf ("outbuf size %d eof %d pid %d\n",outbuf.getlen(),eof,pid);
while (time(NULL) < end && !eof && pid != -1){
*** 1.27r3-pre/linuxconf/misc/popen.h Tue May 22 00:44:16 2001
--- 1.27r4/linuxconf/misc/popen.h Fri Apr 5 14:01:14 2002
***************
*** 107,112 ****
--- 107,113 ----
void checksignal (void);
public:
int close (void);
+ void closepipe (void);
void forget (void);
int getstatus (void);
private:
*** 1.27r3-pre/linuxconf/misc/sstring.cc Sun Jan 20 23:11:13 2002
--- 1.27r4/linuxconf/misc/sstring.cc Sat Apr 6 23:31:01 2002
***************
*** 462,480 ****
*/
PUBLIC int SSTRING::cnv2lines (SSTRINGS &tb)
{
! int ret = 0;
! const char *pt = get();
! while (*pt != '\0'){
! const char *start = pt;
! while (*pt != '\n' && *pt != '\0') pt++;
! SSTRING *n = new SSTRING;
! int len = (int)(pt-start);
! if (len > 0) n->setfrom (start,len);
! tb.add (n);
! ret++;
! if (*pt == '\n') pt++;
! }
! return ret;
}
--- 462,468 ----
*/
PUBLIC int SSTRING::cnv2lines (SSTRINGS &tb)
{
! return str_cnv2lines(get(),tb);
}
*** 1.27r3-pre/linuxconf/misc/str.cc Mon Aug 28 20:49:45 2000
--- 1.27r4/linuxconf/misc/str.cc Sat Apr 6 23:32:10 2002
***************
*** 197,199 ****
--- 197,219 ----
return words.getnb()-start;
}
+ /*
+ Split a multi-line string in a table
+ Return the number of lines found.
+ */
+ int str_cnv2lines(const char *pt, SSTRINGS &tb)
+ {
+ int ret = 0;
+ while (*pt != '\0'){
+ const char *start = pt;
+ while (*pt != '\n' && *pt != '\0') pt++;
+ SSTRING *n = new SSTRING;
+ int len = (int)(pt-start);
+ if (len > 0) n->setfrom (start,len);
+ tb.add (n);
+ ret++;
+ if (*pt == '\n') pt++;
+ }
+ return ret;
+ }
+
*** 1.27r3-pre/linuxconf/misc/misc.p Wed Mar 27 13:08:04 2002
--- 1.27r4/linuxconf/misc/misc.p Sat Apr 6 23:32:25 2002
***************
*** 2,8 ****
/* arraykey.cc 12/12/1999 22.30.32 */
void arraykey_required (void);
/* confdb.cc 24/11/2000 00.01.46 */
! /* configf.cc 05/11/2001 16.30.50 */
void configf_required (void);
void configf_forgetpath (void);
void configf_readlookup (void);
--- 2,8 ----
/* arraykey.cc 12/12/1999 22.30.32 */
void arraykey_required (void);
/* confdb.cc 24/11/2000 00.01.46 */
! /* configf.cc 05/04/2002 14.01.24 */
void configf_required (void);
void configf_forgetpath (void);
void configf_readlookup (void);
***************
*** 59,65 ****
const char *group,
int perm);
bool context_fexist (const char *path);
! /* context_lock.cc 06/04/2001 23.04.18 */
void context_lock_required (void);
/* _dict.cc 14/08/1996 14.39.06 */
/* dictionary.cc 30/07/2001 17.02.06 */
--- 59,65 ----
const char *group,
int perm);
bool context_fexist (const char *path);
! /* context_lock.cc 06/04/2002 15.09.58 */
void context_lock_required (void);
/* _dict.cc 14/08/1996 14.39.06 */
/* dictionary.cc 30/07/2001 17.02.06 */
***************
*** 127,133 ****
int gid,
int mode);
int file_followlink (const char *fpath, char *realpath);
! /* filecfg.cc 31/03/2001 15.27.24 */
void filecfg_setrelink (FILE_CFG *c);
FILE_CFG *filecfg_new (FILE *f, const CONFIG_FILE *cf);
int fclose (FILE_CFG *fout);
--- 127,133 ----
int gid,
int mode);
int file_followlink (const char *fpath, char *realpath);
! /* filecfg.cc 06/04/2002 13.57.02 */
void filecfg_setrelink (FILE_CFG *c);
FILE_CFG *filecfg_new (FILE *f, const CONFIG_FILE *cf);
int fclose (FILE_CFG *fout);
***************
*** 171,176 ****
--- 171,177 ----
int fgetc (FILE_CFG *f);
int fputc (int c, FILE_CFG *f);
int fileno (FILE_CFG *f);
+ FILE *filecfg_tofile (FILE_CFG *f);
/* fopen1.cc 30/07/1998 02.03.12 */
void xconf_fopencfg_bypass (bool _bypass);
FILE *xconf_fopencfg (PRIVILEGE *priv,
***************
*** 178,184 ****
const char *mode);
/* fopen.cc 22/12/1997 00.37.36 */
FILE *xconf_fopen (const char *fname, const char *mode);
! /* fviews.cc 27/03/2002 13.07.56 */
void fviews_required (void);
/* helpf.cc 01/09/2000 00.19.10 */
void help_setlang (const char *_lang, const char *envvar);
--- 179,185 ----
const char *mode);
/* fopen.cc 22/12/1997 00.37.36 */
FILE *xconf_fopen (const char *fname, const char *mode);
! /* fviews.cc 27/03/2002 13.08.20 */
void fviews_required (void);
/* helpf.cc 01/09/2000 00.19.10 */
void help_setlang (const char *_lang, const char *envvar);
***************
*** 313,324 ****
void module_unsetone (const char *path);
bool module_is_enabled (const char *path);
int module_requestpkg (const char *logical_name);
! /* popen.cc 01/02/2002 22.56.56 */
void popen_initsignal (void);
int popen_getloginuid (void);
/* samples.cc 06/04/2001 22.46.22 */
/* sstream.cc 26/11/2000 22.48.04 */
! /* sstring.cc 20/01/2002 23.11.12 */
/* sstrings.cc 06/09/2001 22.51.54 */
/* str1.cc 12/11/1997 02.59.48 */
int str_strip (const char *str, char *newstr);
--- 314,325 ----
void module_unsetone (const char *path);
bool module_is_enabled (const char *path);
int module_requestpkg (const char *logical_name);
! /* popen.cc 05/04/2002 14.01.06 */
void popen_initsignal (void);
int popen_getloginuid (void);
/* samples.cc 06/04/2001 22.46.22 */
/* sstream.cc 26/11/2000 22.48.04 */
! /* sstring.cc 06/04/2002 23.31.00 */
/* sstrings.cc 06/09/2001 22.51.54 */
/* str1.cc 12/11/1997 02.59.48 */
int str_strip (const char *str, char *newstr);
***************
*** 340,346 ****
/* str6.cc 29/11/1997 13.38.50 */
void str6_required (void);
int str_exptab (const char *src, int step, char *dst);
! /* str.cc 28/08/2000 20.49.44 */
char *str_copyword (char *dest, const char *str);
char *str_copyword (char *dest, const char *str, int size);
int str_isword (const char *str, const char *word);
--- 341,347 ----
/* str6.cc 29/11/1997 13.38.50 */
void str6_required (void);
int str_exptab (const char *src, int step, char *dst);
! /* str.cc 06/04/2002 23.32.10 */
char *str_copyword (char *dest, const char *str);
char *str_copyword (char *dest, const char *str, int size);
int str_isword (const char *str, const char *word);
***************
*** 352,357 ****
--- 353,359 ----
void strupr (char *str);
const char *str_extract (const char *buf, SSTRING&s);
int str_splitline (const char *line, char delim, SSTRINGS&words);
+ int str_cnv2lines (const char *pt, SSTRINGS&tb);
/* stub.cc 10/03/2001 15.07.54 */
void html_access_log (int , const char *);
int html_access_check (int);
*** 1.27r3-pre/linuxconf/misc/misc.pm Wed Mar 27 13:08:04 2002
--- 1.27r4/linuxconf/misc/misc.pm Sat Apr 6 23:32:25 2002
***************
*** 138,144 ****
PUBLIC void CONFDB::delsys (const char *_sys);
PUBLIC VIRTUAL int CONFDB::extract (SSTREAM&ss, const char *_sys);
PUBLIC void CONFDB::patchsys (void);
! /* configf.cc 05/11/2001 16.30.50 */
PUBLIC CONFIG_FILE_LISTER::CONFIG_FILE_LISTER (void (*f)());
PUBLIC CONFIG_FILE_INTERNAL::CONFIG_FILE_INTERNAL (HELP_FILE&_helpfile,
const char *_path,
--- 138,144 ----
PUBLIC void CONFDB::delsys (const char *_sys);
PUBLIC VIRTUAL int CONFDB::extract (SSTREAM&ss, const char *_sys);
PUBLIC void CONFDB::patchsys (void);
! /* configf.cc 05/04/2002 14.01.24 */
PUBLIC CONFIG_FILE_LISTER::CONFIG_FILE_LISTER (void (*f)());
PUBLIC CONFIG_FILE_INTERNAL::CONFIG_FILE_INTERNAL (HELP_FILE&_helpfile,
const char *_path,
***************
*** 246,260 ****
PUBLIC LINUXCONF_CONTEXT::LINUXCONF_CONTEXT (void);
PUBLIC void LINUXCONF_CONTEXT::set (LINUXCONF_CONTEXT&cur);
PUBLIC void LINUXCONF_CONTEXT::settitle (const char *title);
! /* context_lock.cc 06/04/2001 23.04.18 */
PRIVATE void CONTEXT_LOCK::init (const char *_key1,
const char *_key2,
int _flags);
PUBLIC CONTEXT_LOCK::CONTEXT_LOCK (const char *key);
PUBLIC CONTEXT_LOCK::CONTEXT_LOCK (const char *_key1,
const char *_key2);
PUBLIC CONTEXT_LOCK::~CONTEXT_LOCK (void);
PUBLIC bool CONTEXT_LOCK::isok (void)const;
/* _dict.cc 14/08/1996 14.39.06 */
/* dictionary.cc 30/07/2001 17.02.06 */
PUBLIC DICTIONARY::DICTIONARY (void);
--- 246,262 ----
PUBLIC LINUXCONF_CONTEXT::LINUXCONF_CONTEXT (void);
PUBLIC void LINUXCONF_CONTEXT::set (LINUXCONF_CONTEXT&cur);
PUBLIC void LINUXCONF_CONTEXT::settitle (const char *title);
! /* context_lock.cc 06/04/2002 15.09.58 */
PRIVATE void CONTEXT_LOCK::init (const char *_key1,
const char *_key2,
int _flags);
+ PRIVATE void CONTEXT_LOCK::check (bool msg)const;
PUBLIC CONTEXT_LOCK::CONTEXT_LOCK (const char *key);
PUBLIC CONTEXT_LOCK::CONTEXT_LOCK (const char *_key1,
const char *_key2);
PUBLIC CONTEXT_LOCK::~CONTEXT_LOCK (void);
PUBLIC bool CONTEXT_LOCK::isok (void)const;
+ PUBLIC bool CONTEXT_LOCK::isok (int seconds)const;
/* _dict.cc 14/08/1996 14.39.06 */
/* dictionary.cc 30/07/2001 17.02.06 */
PUBLIC DICTIONARY::DICTIONARY (void);
***************
*** 279,289 ****
/* fgets1.cc 13/12/1996 23.39.36 */
/* fgets.cc 31/03/2001 15.25.52 */
/* file.cc 03/05/2001 11.18.06 */
! /* filecfg.cc 31/03/2001 15.27.24 */
PUBLIC FILE_CFG::FILE_CFG (FILE *_f, const CONFIG_FILE *_cf);
/* fopen1.cc 30/07/1998 02.03.12 */
/* fopen.cc 22/12/1997 00.37.36 */
! /* fviews.cc 27/03/2002 13.07.56 */
PUBLIC VIEWITEMS_PARSER::VIEWITEMS_PARSER (void);
PUBLIC VIRTUAL void VIEWITEMS_PARSER::init (VIEWITEMS&_vi);
PUBLIC VIRTUAL bool VIEWITEMS_PARSER::is_comment (const char *line);
--- 281,291 ----
/* fgets1.cc 13/12/1996 23.39.36 */
/* fgets.cc 31/03/2001 15.25.52 */
/* file.cc 03/05/2001 11.18.06 */
! /* filecfg.cc 06/04/2002 13.57.02 */
PUBLIC FILE_CFG::FILE_CFG (FILE *_f, const CONFIG_FILE *_cf);
/* fopen1.cc 30/07/1998 02.03.12 */
/* fopen.cc 22/12/1997 00.37.36 */
! /* fviews.cc 27/03/2002 13.08.20 */
PUBLIC VIEWITEMS_PARSER::VIEWITEMS_PARSER (void);
PUBLIC VIRTUAL void VIEWITEMS_PARSER::init (VIEWITEMS&_vi);
PUBLIC VIRTUAL bool VIEWITEMS_PARSER::is_comment (const char *line);
***************
*** 457,463 ****
bool force,
bool enabled);
PUBLIC void MODULE_INFOS::unsetone (const char *path);
! /* popen.cc 01/02/2002 22.56.56 */
PROTECTED void POPENFD::setfds (int fdin,
int fdout,
int fderr,
--- 459,465 ----
bool force,
bool enabled);
PUBLIC void MODULE_INFOS::unsetone (const char *path);
! /* popen.cc 05/04/2002 14.01.06 */
PROTECTED void POPENFD::setfds (int fdin,
int fdout,
int fderr,
***************
*** 516,521 ****
--- 518,524 ----
PUBLIC int POPEN::wait (int timeout, int otherfd);
PUBLIC int POPEN::wait (int timeout);
PUBLIC int POPEN::getstatus (void);
+ PUBLIC void POPEN::closepipe (void);
PUBLIC int POPEN::close (void);
PUBLIC SSTREAM_POPEN::SSTREAM_POPEN (POPENFD&_pop);
PUBLIC SSTREAM_POPEN::~SSTREAM_POPEN (void);
***************
*** 551,557 ****
PUBLIC void SSTREAM_NUL::puts (const char *);
PUBLIC char *SSTREAM_NUL::gets (char *, int);
PUBLIC long SSTREAM_NUL::getoffset (void);
! /* sstring.cc 20/01/2002 23.11.12 */
PUBLIC SSTRING::SSTRING (void);
PUBLIC SSTRING::SSTRING (const char *_str);
PUBLIC SSTRING::SSTRING (const char *_str, int _maxsiz);
--- 554,560 ----
PUBLIC void SSTREAM_NUL::puts (const char *);
PUBLIC char *SSTREAM_NUL::gets (char *, int);
PUBLIC long SSTREAM_NUL::getoffset (void);
! /* sstring.cc 06/04/2002 23.31.00 */
PUBLIC SSTRING::SSTRING (void);
PUBLIC SSTRING::SSTRING (const char *_str);
PUBLIC SSTRING::SSTRING (const char *_str, int _maxsiz);
***************
*** 614,620 ****
/* str1.cc 12/11/1997 02.59.48 */
/* str3.cc 12/12/1999 22.09.10 */
/* str6.cc 29/11/1997 13.38.50 */
! /* str.cc 28/08/2000 20.49.44 */
/* stub.cc 10/03/2001 15.07.54 */
/* subsys.cc 27/11/2000 22.06.14 */
PRIVATE void LINUXCONF_SUBSYS::init (const char *key);
--- 617,623 ----
/* str1.cc 12/11/1997 02.59.48 */
/* str3.cc 12/12/1999 22.09.10 */
/* str6.cc 29/11/1997 13.38.50 */
! /* str.cc 06/04/2002 23.32.10 */
/* stub.cc 10/03/2001 15.07.54 */
/* subsys.cc 27/11/2000 22.06.14 */
PRIVATE void LINUXCONF_SUBSYS::init (const char *key);
*** 1.27r3-pre/linuxconf/misc/filecfg.cc Sat Mar 31 15:27:25 2001
--- 1.27r4/linuxconf/misc/filecfg.cc Sat Apr 6 13:57:03 2002
***************
*** 267,269 ****
--- 267,276 ----
return fileno(f->f);
}
+ /*
+ Return the original FILE handle associated with a FILE_CFG
+ */
+ FILE *filecfg_tofile (FILE_CFG *f)
+ {
+ return f != NULL ? f->f : NULL;
+ }
*** 1.27r3-pre/linuxconf/misc/context_lock.cc Fri Apr 6 23:04:18 2001
--- 1.27r4/linuxconf/misc/context_lock.cc Sat Apr 6 15:09:58 2002
***************
*** 83,88 ****
--- 83,93 ----
priv->flags = _flags;
priv->ok = true;
priv->fpos = -1;
+ }
+
+ PRIVATE void CONTEXT_LOCK::check(
+ bool msg) const // Present a message to the user ?
+ {
if (geteuid() == 0){
priv->ok = false;
const char *path = f_lockdb.getpath();
***************
*** 105,138 ****
if (rec.pid == 0){
// fprintf (stderr,"Free record at %ld\n",t);
recfree = t;
! }else if (strcmp(rec.key1,_key1)==0
! && strcmp(rec.key2,_key2)==0){
// Is the process still alive ?
if (kill(rec.pid,0)==-1){
// fprintf (stderr,"Stealing the lock, position %ld\n",t);
recfree = t;
}else{
! if (getpid()==rec.pid){
! xconf_notice (MSG_U(N_YOURLOCK
! ,"You are already accessing this area\n"
! "from Linuxconf. Can't enter"));
! }else{
! const char *user = "root";
! struct passwd *p = getpwuid (rec.uid);
! if (p != NULL) user = p->pw_name;
! xconf_notice (MSG_U(N_ISLOCKED
! ,"Another administrator is currently\n"
! "using Linuxconf in this area\n"
! "\n"
! "Here are the details:\n"
! "Lock granted : %s\n"
! "User ID : %s\n"
! "Process ID : %d\n"
! "Terminal : %s\n"
! "X display : %s\n")
! ,asctime(localtime(&rec.stamp))
! ,user
! ,rec.pid,rec.term,rec.display);
}
priv->ok = false;
break;
--- 110,146 ----
if (rec.pid == 0){
// fprintf (stderr,"Free record at %ld\n",t);
recfree = t;
! }else if (strcmp(rec.key1,priv->key1)==0
! && strcmp(rec.key2,priv->key2)==0){
// Is the process still alive ?
if (kill(rec.pid,0)==-1){
// fprintf (stderr,"Stealing the lock, position %ld\n",t);
recfree = t;
+ break;
}else{
! if (msg){
! if (getpid()==rec.pid){
! xconf_notice (MSG_U(N_YOURLOCK
! ,"You are already accessing this area\n"
! "from Linuxconf. Can't enter"));
! }else{
! const char *user = "root";
! struct passwd *p = getpwuid (rec.uid);
! if (p != NULL) user = p->pw_name;
! xconf_notice (MSG_U(N_ISLOCKED
! ,"Another administrator is currently\n"
! "using Linuxconf in this area\n"
! "\n"
! "Here are the details:\n"
! "Lock granted : %s\n"
! "User ID : %s\n"
! "Process ID : %d\n"
! "Terminal : %s\n"
! "X display : %s\n")
! ,asctime(localtime(&rec.stamp))
! ,user
! ,rec.pid,rec.term,rec.display);
! }
}
priv->ok = false;
break;
***************
*** 144,151 ****
rec.stamp = time(NULL);
rec.uid = getuid();
rec.pid = getpid();
! strcpy (rec.key1,_key1);
! strcpy (rec.key2,_key2);
const char *display = getenv ("DISPLAY");
if (display == NULL) display = "";
const char *term = ttyname (0);
--- 152,159 ----
rec.stamp = time(NULL);
rec.uid = getuid();
rec.pid = getpid();
! strcpy (rec.key1,priv->key1);
! strcpy (rec.key2,priv->key2);
const char *display = getenv ("DISPLAY");
if (display == NULL) display = "";
const char *term = ttyname (0);
***************
*** 223,229 ****
*/
PUBLIC bool CONTEXT_LOCK::isok() const
{
! return priv->ok;
}
--- 231,254 ----
*/
PUBLIC bool CONTEXT_LOCK::isok() const
{
! return isok(0);
}
+ /*
+ Wait until the lock is granted.
+ Return true if the lock was granted.
+
+ If it returns false, the user has been notified about the lock. You
+ just go away.
+ */
+ PUBLIC bool CONTEXT_LOCK::isok(int seconds) const
+ {
+ bool ret = false;
+ for (; seconds >= 0 && ret == false; seconds--){
+ check (seconds == 0);
+ ret = priv->ok;
+ if (!ret && seconds > 0) sleep(1);
+ }
+ return ret;
+ }
*** 1.27r3-pre/linuxconf/modules/dhcpd/dhcpedit.cc Tue Mar 20 09:02:09 2001
--- 1.27r4/linuxconf/modules/dhcpd/dhcpedit.cc Fri Apr 12 14:17:11 2002
***************
*** 302,307 ****
--- 302,308 ----
FILE_CFG *fout = f_dhcp.fopen ("w");
if (fout != NULL){
fprintf (fout,"server-identifier %s;\n",identifier.get());
+ fprintf (fout,"ddns-update-style ad-hoc;\n");
if (default_lease_time.seconds != 0){
fprintf (fout,"default-lease-time %ld;\n",default_lease_time.seconds);
}
*** 1.27r3-pre/linuxconf/modules/firewall/ipfwrule.cc Thu Aug 16 23:03:13 2001
--- 1.27r4/linuxconf/modules/firewall/ipfwrule.cc Fri Mar 29 13:53:30 2002
***************
*** 514,527 ****
bool ret = false;
if (strncmp(name,prefix,len)==0){
const char *pt = name + len;
! // The rest must be digits
! ret = true;
! while (*pt != '\0'){
! if (!isdigit(*pt)){
! ret = false;
! break;
! }
! pt++;
}
}
return ret;
--- 514,525 ----
bool ret = false;
if (strncmp(name,prefix,len)==0){
const char *pt = name + len;
! // The rest must be digits optionally followed by a dot and digits
! // for vlans devices
! if (isdigit(*pt)){
! pt = str_skipdig(pt);
! if (pt[0] == '.' && isdigit(pt[1])) pt = str_skipdig(pt+1);
! ret = *pt == '\0';
}
}
return ret;
*** 1.27r3-pre/linuxconf/modules/mailconf/sendmail-check.cc Mon Feb 12 17:48:32 2001
--- 1.27r4/linuxconf/modules/mailconf/sendmail-check.cc Sat Apr 6 11:44:02 2002
***************
*** 142,148 ****
--- 142,154 ----
if (fscanf(fin,"%d",&pid)==1){
time_t start = process_getstarttime (pid);
if (date > start) printf ("restart\n");
+ }else{
+ // The pid file is broken. Better do a restart
+ printf ("restart\n");
}
+ fclose (fin);
+ }else{
+ printf ("start\n");
}
}
return ret;
*** 1.27r3-pre/linuxconf/modules/mailconf/redhat/mailconf.paths
--- 1.27r4/linuxconf/modules/mailconf/redhat/mailconf.paths Wed Apr 3 22:36:23 2002
***************
*** 0 ****
--- 1,2 ----
+ /var/spool/mqueue /var/spool/mqueue
+ /etc/sendmail.cf /etc/mail/sendmail.cf
*** 1.27r3-pre/linuxconf/modules/mailconf/redhat/mailconf.daemons
--- 1.27r4/linuxconf/modules/mailconf/redhat/mailconf.daemons Fri Apr 5 14:17:43 2002
***************
*** 0 ****
--- 1,5 ----
+ sendmail /usr/sbin/sendmail -bd
+ smrsh /usr/sbin/smrsh
+ makemap /usr/bin/makemap
+ mailq /usr/bin/mailq
+
*** 1.27r3-pre/linuxconf/modules/mailconf/redhat/4/mailconf.paths
--- 1.27r4/linuxconf/modules/mailconf/redhat/4/mailconf.paths Wed Apr 3 22:35:49 2002
***************
*** 0 ****
--- 1 ----
+ /var/spool/mqueue /var/spool/mqueue
*** 1.27r3-pre/linuxconf/modules/mailconf/redhat/5/mailconf.paths
--- 1.27r4/linuxconf/modules/mailconf/redhat/5/mailconf.paths Wed Apr 3 22:35:52 2002
***************
*** 0 ****
--- 1 ----
+ /var/spool/mqueue /var/spool/mqueue
*** 1.27r3-pre/linuxconf/modules/mailconf/redhat/6/mailconf.paths
--- 1.27r4/linuxconf/modules/mailconf/redhat/6/mailconf.paths Wed Apr 3 22:35:54 2002
***************
*** 0 ****
--- 1 ----
+ /var/spool/mqueue /var/spool/mqueue
*** 1.27r3-pre/linuxconf/modules/mailconf/redhat/7.0/mailconf.paths
--- 1.27r4/linuxconf/modules/mailconf/redhat/7.0/mailconf.paths Wed Apr 3 22:35:59 2002
***************
*** 0 ****
--- 1 ----
+ /var/spool/mqueue /var/spool/mqueue
*** 1.27r3-pre/linuxconf/modules/mailconf/redhat/7.1/mailconf.paths
--- 1.27r4/linuxconf/modules/mailconf/redhat/7.1/mailconf.paths Wed Apr 3 22:35:59 2002
***************
*** 0 ****
--- 1 ----
+ /var/spool/mqueue /var/spool/mqueue
*** 1.27r3-pre/linuxconf/modules/mailconf/redhat/7.2/mailconf.paths
--- 1.27r4/linuxconf/modules/mailconf/redhat/7.2/mailconf.paths Wed Apr 3 22:35:59 2002
***************
*** 0 ****
--- 1 ----
+ /var/spool/mqueue /var/spool/mqueue
*** 1.27r3-pre/linuxconf/modules/redhatppp/ppp.cc Sat Apr 7 00:50:08 2001
--- 1.27r4/linuxconf/modules/redhatppp/ppp.cc Fri Apr 12 14:14:43 2002
***************
*** 77,82 ****
--- 77,83 ----
}
static const char NAME[]="NAME";
+ static const char USEWVDIAL[]="USEWVDIAL";
static const char WVDIALSECT[]="WVDIALSECT";
static const char DEFROUTE[]="DEFROUTE";
static const char HARDFLOWCTL[]="HARDFLOWCTL";
***************
*** 120,125 ****
--- 121,127 ----
class RHPPP{
public:
SSTRING name;
+ char usewvdial;
SSTRING wvdialsect;
SSTRING device;
char userctl;
***************
*** 428,433 ****
--- 430,436 ----
char tmp[1000];
name.setfrom (items.locateval (NAME,tmp));
+ usewvdial = items.locatebval (USEWVDIAL,1);
wvdialsect.setfrom (items.locateval (WVDIALSECT,tmp));
if (!wvdialsect.is_empty()){
stupidmode = wvdial_getstupidmode(wvdialsect.get()) ? 1 : 0;
***************
*** 680,685 ****
--- 683,689 ----
dia.newf_str (MSG_U(F_MODEMINIT,"Modem init string"),modeminit);
dia.newf_str (MSG_U(F_MODEMDIAL,"Modem dial command"),modemdial);
dia.newf_str (MSG_U(F_PHONE,"Phone number"),phone);
+ dia.newf_chk ("",usewvdial,MSG_U(I_USEWVDIAL,"Use wvdial"));
if (type == TYPE_PPP){
if (wvdial_is_installed()){
dia.newf_chk (MSG_U(F_LINKSETUP,"Link setup"),stupidmode
***************
*** 874,883 ****
chat.add (new SSTRING("5"));
chat.add (new SSTRING("~--"));
chat.add (new SSTRING(""));
! if (usepap){
! papname.setfrom (login);
! secret.setfrom (password);
! }
if (code == MENU_USR1){
ret = edit();
}else{
--- 878,885 ----
chat.add (new SSTRING("5"));
chat.add (new SSTRING("~--"));
chat.add (new SSTRING(""));
! papname.setfrom (login);
! secret.setfrom (password);
if (code == MENU_USR1){
ret = edit();
}else{
***************
*** 940,946 ****
items.update ("MODE",mode ? "CSLIP" : "SLIP");
}
items.update (NAME,name);
! items.update (WVDIALSECT, modemport.is_empty() ? "" : wvdialsect.get());
items.updatebval (ONBOOT,onboot);
items.updatebval (USERCTL,userctl);
items.updatebval (PEERDNS,peerdns);
--- 942,949 ----
items.update ("MODE",mode ? "CSLIP" : "SLIP");
}
items.update (NAME,name);
! items.update (USEWVDIAL, usewvdial ? "yes" : "no");
! items.update (WVDIALSECT, !usewvdial || modemport.is_empty() ? "" : wvdialsect.get());
items.updatebval (ONBOOT,onboot);
items.updatebval (USERCTL,userctl);
items.updatebval (PEERDNS,peerdns);
*** 1.27r3-pre/linuxconf/modules/redhatppp/redhatppp.m Fri Nov 24 00:03:14 2000
--- 1.27r4/linuxconf/modules/redhatppp/redhatppp.m Fri Apr 12 14:14:44 2002
***************
*** 97,99 ****
--- 97,100 ----
#define F_PASSWORD2 81
#define I_FIREWALL 82
#define I_PPPDEVDESC 83
+ #define I_USEWVDIAL 84
*** 1.27r3-pre/linuxconf/modules/updatemon/updatemon.tlcc Wed Aug 29 18:01:04 2001
--- 1.27r4/linuxconf/modules/updatemon/updatemon.tlcc Sat Apr 6 23:33:32 2002
***************
*** 2,7 ****
--- 2,9 ----
#include
#include
#include
+ #include
+ #include
#include
#include
#include
***************
*** 12,30 ****
#include
#include
#include
static HELP_FILE help_updatewin ("updatemon","updatewin");
static HELP_FILE help_updatemon ("updatemon","updatemon");
MODULE_DEFINE_VERSION(updatemon);
! static bool is_running = false;
static SSTRING logctx;
static const char K_UPDATEMON[]="updatemon";
static const char K_LOGWIN[]="logwin";
static const char K_DIFFOPT[]="diffopt";
static PRIVATE_MESSAGE update_msg;
! static SSTRINGS files,dates;
static void update_edittext (
--- 14,114 ----
#include
#include
#include
+ #include
static HELP_FILE help_updatewin ("updatemon","updatewin");
+ static HELP_FILE help_commandwin ("updatemon","commandwin");
static HELP_FILE help_updatemon ("updatemon","updatemon");
+ static CONFIG_FILE f_updated ("/var/log/filesupd.log",help_updatemon
+ ,CONFIGF_OPTIONAL|CONFIGF_MANAGED|CONFIGF_FIXEDBASE
+ ,"root","root",0600);
MODULE_DEFINE_VERSION(updatemon);
! static bool file_is_running = false;
! static bool cmd_is_running = false;
static SSTRING logctx;
static const char K_UPDATEMON[]="updatemon";
static const char K_LOGWIN[]="logwin";
+ static const char K_CMDWIN[]="cmdwin";
static const char K_DIFFOPT[]="diffopt";
+ static const char K_LENLOG[]="lenlog";
static PRIVATE_MESSAGE update_msg;
! class UPDFILE: public ARRAY_OBJ{
! public:
! SSTRING file;
! SSTRING admin; // Who has performed the update
! time_t date;
! };
!
! static ARRAY_OBJS files;
! static time_t last_revision;
!
! /*
! Update the filesupd.log.
! The files is always rewritten. Older entries are sometime removed
! from the start of the file this way
! */
!
! static void updatemon_writelog()
! {
! CONTEXT_LOCK lock ("updatemon_writelog");
! if (lock.isok(10)){
! (f_updated,false);
!
! for (int i=0; idate,u->admin.get(),u->file.get());
! }
! return 0;
!
!
! struct stat st;
! if (stat(f_updated.getpath(),&st)!=-1) last_revision = st.st_mtime;
! }
! }
!
!
! /*
! Read the list of updated configuration file
! and remove the old entries. Keep only the last 500
! */
!
! static void updatemon_readlog()
! {
! struct stat st;
! time_t revision = last_revision;
! if (stat(f_updated.getpath(),&st)!=-1) revision = st.st_mtime;
! if (files.getnb()==0
! || revision != last_revision){
! files.remove_all();
! (f_updated.getpath(),true);
!
!
!
! UPDFILE *u = new UPDFILE;
! u->date = atoi(line);
! line = str_skipdig(line);
! line = u->admin.copyword(line);
! u->file.copyword(line);
! files.add (u);
! return 0;
!
!
! last_revision = revision;
! /* #Specification: filesupd.log / cleanup
! Whenever the file reached 500 entries, the older
! entries are removed
! */
! if (files.getnb()>500){
! while (files.getnb() > 500){
! files.remove_del(0);
! }
! updatemon_writelog();
! }
! }
! }
!
static void update_edittext (
***************
*** 122,128 ****
SSTREAM_BUF ss;
SSTRING tmp;
tmp.setfromf ("%s --diffopt %s %s",opt,updatemon_getdiffopt(),cmd);
! if (configf_archive (t,"cfgarchive",tmp.get(),ss,false) != -1){
update_str2lines (ss.getbuf(),glocal.lines);
if (strcmp(cmd,"--hist")==0){
SSTRING title;
--- 206,213 ----
SSTREAM_BUF ss;
SSTRING tmp;
tmp.setfromf ("%s --diffopt %s %s",opt,updatemon_getdiffopt(),cmd);
! if (perm_rootaccess(MSG_U(P_VIEWUPDATES,"view file updates"))
! && configf_archive (t,"cfgarchive",tmp.get(),ss,false) != -1){
update_str2lines (ss.getbuf(),glocal.lines);
if (strcmp(cmd,"--hist")==0){
SSTRING title;
***************
*** 183,251 ****
}
}
static void update_fct()
{
! is_running = true;
(MSG_U(T_UPDATELOG,"File updates"),"",help_updatewin);
!
! newf_head (MSG_U(H_FILEPATH,"Time\tUpdated configuration files"));
! setcontext (logctx.get());
! waitfor (update_msg);
!
!
! int nb = files.getnb();
! for (int i=0; iget(),"%-79s"
! ,files.getitem(i)->get());
! }
! for (int i=nb; i<4; i++){
! new_menuitemf ("","%79s","");
! }
! if (nb > 0) setcursor (nb-1);
!
!
! if (no < files.getnb()){
! DIALOG_MENUPOPUP dia;
! dia.new_menuitem (MSG_U(M_SHOW,"Show"),MSG_U(M_UPDHISTORY,"updates history"));
! dia.new_menuitem (MSG_R(M_SHOW),MSG_U(M_SHOWDIFF,"differences"));
! dia.new_menuitem (MSG_U(M_EXTRACT,"Extract"),MSG_U(M_LASTVERSION,"last version"));
! dia.new_menuitem (MSG_U(M_EDIT,"Edit"),MSG_U(M_THEFILE,"the file"));
! int nof = 0;
! if (dia.editmenu ("",nof)==MENU_OK){
! const char *fname = files.getitem(no)->get();
! if (nof == 0){
! update_archivecmd (fname,"--hist","");
! }else if (nof == 1){
! update_archivecmd (fname,"--diff","");
! }else if (nof == 2){
! SSTRINGS t;
! t.add (new SSTRING(fname));
! configf_extract (t,"cfgarchive","--extr");
! }else if (nof == 3){
! update_editfile (fname);
! }
}
}
!
!
! setvsize (4);
! newf_clist();
! gui_passthrough (P_Form,"form $hexpand=0");
! new_button_icon (1,"xquit","");
! newline();
! new_button_help ();
! newline();
! gui_passthrough (P_End,"");
! nobutton();
!
!
! if (id == 1){
! endedit();
! }
!
! is_running = false;
}
--- 268,429 ----
}
}
+ /*
+ Put the pane at the bottom showing updated files
+ */
static void update_fct()
{
! file_is_running = true;
! updatemon_readlog();
!
! PRIVATE_MESSAGE timer;
!
! dialog_settimer (glocal.timer,3,true);
(MSG_U(T_UPDATELOG,"File updates"),"",help_updatewin);
!
! newf_head (MSG_U(H_FILEPATH,"Date\tAdmin.\tUpdated configuration files"));
! setcontext (logctx.get());
! waitfor (update_msg);
! waitfor (glocal.timer);
! int nb = files.getnb()-1;
! if (nb > 0) setcursor (nb-1);
!
!
! int nb = files.getnb();
! for (int i=0; idate);
! char tmp[20];
! sprintf (tmp,"%04d/%02d/%02d %02d:%02d:%02d"
! ,t->tm_year+1900,t->tm_mon+1,t->tm_mday
! ,t->tm_hour,t->tm_min,t->tm_sec);
! new_menuitemf (tmp,"%-10s\t%-59s"
! ,u->admin.get(),u->file.get());
! }
! char empty[20];
! memset (empty,' ',20);
! empty[19] = '\0';
! for (int i=nb; i<4; i++){
! new_menuitemf (empty,"%10s\t%59s","","");
! }
!
!
! if (no < files.getnb()){
! DIALOG_MENUPOPUP dia;
! dia.new_menuitem (MSG_U(M_SHOW,"Show"),MSG_U(M_UPDHISTORY,"updates history"));
! dia.new_menuitem (MSG_R(M_SHOW),MSG_U(M_SHOWDIFF,"differences"));
! dia.new_menuitem (MSG_U(M_EXTRACT,"Extract"),MSG_U(M_LASTVERSION,"last version"));
! dia.new_menuitem (MSG_U(M_EDIT,"Edit"),MSG_U(M_THEFILE,"the file"));
! int nof = 0;
! if (dia.editmenu ("",nof)==MENU_OK){
! const char *fname = files.getitem(no)->file.get();
! if (nof == 0){
! update_archivecmd (fname,"--hist","");
! }else if (nof == 1){
! update_archivecmd (fname,"--diff","");
! }else if (nof == 2){
! SSTRINGS t;
! t.add (new SSTRING(fname));
! configf_extract (t,"cfgarchive","--extr");
! }else if (nof == 3){
! update_editfile (fname);
}
}
! }
!
!
! setvsize (4);
! newf_clist();
! gui_passthrough (P_Form,"form $hexpand=0");
! new_button_icon (1,"xquit","");
! newline();
! new_button_help ();
! newline();
! gui_passthrough (P_End,"");
! nobutton();
!
!
! if (id == 1){
! endedit();
! }
!
!
! if (dialog_testmessage(glocal.timer)){
! updatemon_readlog();
! }else if (dialog_testmessage(update_msg)){
! setcursor (files.getnb()-1);
! }
!
! dialog_deltimer (glocal.timer);
! file_is_running = false;
! }
!
!
! class COMMANDITEM: public ARRAY_OBJ{
! public:
! SSTRING line;
! time_t date;
! COMMANDITEM(const char *_line){
! line.setfrom(_line);
! line.strip_end();
! date = time(NULL);
! }
! };
! static ARRAY_OBJS commands;
! static PRIVATE_MESSAGE command_msg;
! /*
! Put the pane at the bottom showing the command log
! */
!
! static void command_fct()
! {
!
!
! cmd_is_running = true;
! (MSG_U(T_COMMANDLOG,"Actions"),"",help_commandwin);
!
! newf_head (MSG_U(H_COMMANDS,"Date\tActions"));
! setcontext (logctx.get());
! waitfor (command_msg);
!
!
! int nb = commands.getnb();
! for (int i=0; idate);
! char tmp[20];
! sprintf (tmp,"%02d:%02d:%02d"
! ,t->tm_hour,t->tm_min,t->tm_sec);
! new_menuitemf (tmp,"%-79.79s",c->line.get());
! }
! // Make sure we have 4 lines in the pane
! for (int i=nb; i<4; i++){
! new_menuitemf (" ","%79s","","");
! }
! setcursor (nb == 0 ? 0 : nb - 1);
!
!
!
!
! setvsize (4);
! newf_clist();
! gui_passthrough (P_Form,"form $hexpand=0");
! new_button_icon (1,"xquit","");
! newline();
! new_button_help ();
! newline();
! gui_passthrough (P_End,"");
! nobutton();
!
!
! if (id == 1){
! endedit();
! }
!
!
! cmd_is_running = false;
}
***************
*** 253,259 ****
{
int ret = -1;
if (force || linuxconf_getvalnum (K_UPDATEMON,K_LOGWIN,1)!=0){
! if (!is_running){
uithread (update_fct);
}
ret = 0;
--- 431,437 ----
{
int ret = -1;
if (force || linuxconf_getvalnum (K_UPDATEMON,K_LOGWIN,1)!=0){
! if (!file_is_running){
uithread (update_fct);
}
ret = 0;
***************
*** 261,266 ****
--- 439,456 ----
return ret;
}
+ static int command_win (bool force)
+ {
+ int ret = -1;
+ if (force || linuxconf_getvalnum (K_UPDATEMON,K_CMDWIN,1)!=0){
+ if (!cmd_is_running){
+ uithread (command_fct);
+ }
+ ret = 0;
+ }
+ return ret;
+ }
+
static bool mon_running = false;
static bool mon_file_accepted = false; // The admin accepted the update
static const char *mon_file=NULL,*mon_file_new=NULL;
***************
*** 422,428 ****
int ret = LNCF_NOT_APPLICABLE;
! if (strcmp(msg,"updatefile")==0){
ret = 0;
mon_file = argv[0];
mon_file_new = argv[1];
--- 612,622 ----
int ret = LNCF_NOT_APPLICABLE;
! extern CONFIG_FILE f_treemenu;
! // No need to talk about treemenu.cache
! if (strcmp(msg,"updatefile")==0
! && strcmp(argv[0],f_treemenu.getpath())!=0
! && strcmp(argv[0],f_updated.getpath())!=0){
ret = 0;
mon_file = argv[0];
mon_file_new = argv[1];
***************
*** 432,459 ****
ret = mon_file_accepted ? 0 : -1;
}
if (ret == 0){
! files.add (new SSTRING(argv[0]));
! time_t ti = time(NULL);
! struct tm *t = localtime (&ti);
! char tmp[20];
! sprintf (tmp,"%02d:%02d:%02d",t->tm_hour,t->tm_min,t->tm_sec);
! dates.add (new SSTRING (tmp));
dialog_sendmessage (update_msg);
}
}else if (strcmp(msg,"tree_is_up")==0){
logctx.setfrom (argv[1]);
if (update_win(false) != -1) ret = 0;
}else if (strcmp(msg,"build-menubar")==0){
ret = 0;
diagui_sendcmd (P_Submenu,"\"%s\"\n",MSG_U(M_UPDLOG,"Updates"));
! diagui_sendcmd (P_Menuentry,"200 \"%s\"\n",MSG_U(M_LOGWIN,"Log window"));
diagui_sendcmd (P_Menuentry,"201 \"%s\"\n",MSG_U(M_INTERACTIVE,"Interactive updates"));
! // diagui_sendcmd (P_Menuentry,"202 \"%s\"\n",MSG_U(M_HISTORY,"History"));
diagui_sendcmd (P_End,"\n");
}else if (strcmp(msg,"build-helpmenu")==0){
diagui_sendcmd (P_Submenu,"\"%s\"\n",MSG_R(M_UPDLOG));
diagui_sendcmd (P_Menuentry,"210 \"%s\"\n",MSG_R(M_LOGWIN));
diagui_sendcmd (P_Menuentry,"211 \"%s\"\n",MSG_R(M_INTERACTIVE));
diagui_sendcmd (P_End,"\n");
}else if (strcmp(msg,"menubar")==0){
ret = 0;
--- 626,665 ----
ret = mon_file_accepted ? 0 : -1;
}
if (ret == 0){
! updatemon_readlog();
! UPDFILE *u = new UPDFILE;
! u->date = time(NULL);
! int uid = perm_getadminuid();
! struct passwd *p = getpwuid(uid);
! u->admin.setfrom (p != NULL ? p->pw_name : "root");
! u->file.setfrom(mon_file);
! files.add (u);
! updatemon_writelog();
dialog_sendmessage (update_msg);
}
+ }else if (strcmp(msg,"netconf.log")==0){
+ SSTRINGS tb;
+ int n = str_cnv2lines (argv[0],tb);
+ for (int i=0; iget()));
+ }
+ dialog_sendmessage (command_msg);
}else if (strcmp(msg,"tree_is_up")==0){
logctx.setfrom (argv[1]);
if (update_win(false) != -1) ret = 0;
+ if (command_win(false) != -1) ret = 0;
}else if (strcmp(msg,"build-menubar")==0){
ret = 0;
diagui_sendcmd (P_Submenu,"\"%s\"\n",MSG_U(M_UPDLOG,"Updates"));
! diagui_sendcmd (P_Menuentry,"200 \"%s\"\n",MSG_U(M_LOGWIN,"File updates log"));
diagui_sendcmd (P_Menuentry,"201 \"%s\"\n",MSG_U(M_INTERACTIVE,"Interactive updates"));
! diagui_sendcmd (P_Menuentry,"202 \"%s\"\n",MSG_U(M_CMDWIN,"Linuxconf actions log"));
diagui_sendcmd (P_End,"\n");
}else if (strcmp(msg,"build-helpmenu")==0){
diagui_sendcmd (P_Submenu,"\"%s\"\n",MSG_R(M_UPDLOG));
diagui_sendcmd (P_Menuentry,"210 \"%s\"\n",MSG_R(M_LOGWIN));
diagui_sendcmd (P_Menuentry,"211 \"%s\"\n",MSG_R(M_INTERACTIVE));
+ diagui_sendcmd (P_Menuentry,"212 \"%s\"\n",MSG_R(M_CMDWIN));
diagui_sendcmd (P_End,"\n");
}else if (strcmp(msg,"menubar")==0){
ret = 0;
***************
*** 463,472 ****
--- 669,681 ----
}else if (sel == 201){
if (!mon_running) uithread (update_monitor);
}else if (sel == 202){
+ command_win(true);
}else if (sel == 210){
diagui_showhelp(help_updatewin);
}else if (sel == 211){
diagui_showhelp(help_updatemon);
+ }else if (sel == 212){
+ diagui_showhelp(help_commandwin);
}
}
return ret;
***************
*** 492,498 ****
--- 701,709 ----
class UPDATEMON_COMNG: public USERACCT_COMNG{
char logwin;
+ char cmdwin;
SSTRING diffopt;
+ int lenlog; // Number of lines in the log file
/*~PROTOBEG~ UPDATEMON_COMNG */
public:
UPDATEMON_COMNG (DICTIONARY&_dict);
***************
*** 508,514 ****
--- 719,727 ----
: USERACCT_COMNG (_dict)
{
logwin = linuxconf_getvalnum (K_UPDATEMON,K_LOGWIN,1);
+ cmdwin = linuxconf_getvalnum (K_UPDATEMON,K_CMDWIN,1);
diffopt.setfrom (linuxconf_getval (K_UPDATEMON,K_DIFFOPT,"-c"));
+ lenlog = linuxconf_getvalnum (K_UPDATEMON,K_LENLOG,500);
}
PUBLIC void UPDATEMON_COMNG::setupdia (
***************
*** 516,523 ****
--- 729,738 ----
{
dia.newf_title (MSG_U(T_MODUPDATEMON,"Module updatemon"),1,"",MSG_R(T_MODUPDATEMON));
dia.newf_chk ("",logwin,MSG_U(I_LOGWIN,"Enable the file updates window"));
+ dia.newf_chk ("",cmdwin,MSG_U(I_CMDWIN,"Enable the actions window"));
dia.newf_str (MSG_U(F_DIFFOPT,"Diff command options"),diffopt);
dia.last_noempty();
+ dia.newf_num (MSG_U(F_LENLOG,"filesupd.log length"),lenlog);
dia.addhelp (help_updatewin,MSG_R(T_MODUPDATEMON));
}
***************
*** 525,531 ****
--- 740,748 ----
PRIVILEGE *priv)
{
linuxconf_replace (K_UPDATEMON,K_LOGWIN,logwin);
+ linuxconf_replace (K_UPDATEMON,K_CMDWIN,cmdwin);
linuxconf_replace (K_UPDATEMON,K_DIFFOPT,diffopt);
+ linuxconf_replace (K_UPDATEMON,K_LENLOG,lenlog);
return 0;
}
*** 1.27r3-pre/linuxconf/modules/updatemon/updatemon.m Fri Dec 8 11:01:12 2000
--- 1.27r4/linuxconf/modules/updatemon/updatemon.m Sat Apr 6 23:18:22 2002
***************
*** 2,8 ****
#ifndef DICTIONARY_REQUEST
#define DICTIONARY_REQUEST \
const char **_dictionary_updatemon;\
! TRANSLATE_SYSTEM_REQ _dictionary_req_updatemon("updatemon",_dictionary_updatemon,34,1);\
void dummy_dict_updatemon(){}
#endif
#ifndef MSG_U
--- 2,8 ----
#ifndef DICTIONARY_REQUEST
#define DICTIONARY_REQUEST \
const char **_dictionary_updatemon;\
! TRANSLATE_SYSTEM_REQ _dictionary_req_updatemon("updatemon",_dictionary_updatemon,39,2);\
void dummy_dict_updatemon(){}
#endif
#ifndef MSG_U
***************
*** 18,49 ****
#define M_UPDLOG 2
#define M_LOGWIN 3
#define M_INTERACTIVE 4
! #define M_HISTORY 5
! #define T_UPDATEMON 6
! #define H_FILEPATH 7
! #define F_FILE 8
! #define F_DIFF 9
! #define I_UPDATEMON 10
! #define T_UPDATELOG 11
! #define B_ACCEPT 12
! #define B_REJECT 13
! #define N_ALREADY 14
! #define B_EDIT 15
! #define I_EDIT 16
! #define F_NEWFILE 17
! #define T_UPDATING 18
! #define M_UPDHISTORY 19
! #define M_SHOWDIFF 20
! #define M_EXTRACT 21
! #define T_ARCHIVELOG 22
! #define M_SHOW 23
! #define M_EDIT 24
! #define M_THEFILE 25
! #define T_HISTORY 26
! #define H_HISTORY 27
! #define N_SAME 28
! #define M_REVISION 29
! #define M_LASTVERSION 30
! #define T_MODUPDATEMON 31
! #define I_LOGWIN 32
! #define F_DIFFOPT 33
--- 18,54 ----
#define M_UPDLOG 2
#define M_LOGWIN 3
#define M_INTERACTIVE 4
! #define T_UPDATEMON 5
! #define H_FILEPATH 6
! #define F_FILE 7
! #define F_DIFF 8
! #define I_UPDATEMON 9
! #define T_UPDATELOG 10
! #define B_ACCEPT 11
! #define B_REJECT 12
! #define N_ALREADY 13
! #define B_EDIT 14
! #define I_EDIT 15
! #define F_NEWFILE 16
! #define T_UPDATING 17
! #define M_UPDHISTORY 18
! #define M_SHOWDIFF 19
! #define M_EXTRACT 20
! #define T_ARCHIVELOG 21
! #define M_SHOW 22
! #define M_EDIT 23
! #define M_THEFILE 24
! #define T_HISTORY 25
! #define H_HISTORY 26
! #define N_SAME 27
! #define M_REVISION 28
! #define M_LASTVERSION 29
! #define T_MODUPDATEMON 30
! #define I_LOGWIN 31
! #define F_DIFFOPT 32
! #define P_VIEWUPDATES 33
! #define F_LENLOG 34
! #define T_COMMANDLOG 35
! #define M_CMDWIN 36
! #define H_COMMANDS 37
! #define I_CMDWIN 38
*** 1.27r3-pre/linuxconf/netconf/net.cc Thu Apr 26 12:08:40 2001
--- 1.27r4/linuxconf/netconf/net.cc Sat Apr 6 21:06:09 2002
***************
*** 134,139 ****
--- 134,141 ----
if (fout != NULL){
fputs (buf,fout);
fclose (fout);
+ const char *args[]={buf,NULL};
+ module_sendmessage ("netconf.log",1,args);
}else if (!shown_err){
shown_err = 1;
xconf_error (MSG_U(E_CANTOPEN,"Can't open file %s\n(%s)\n")
*** 1.27r3-pre/linuxconf/userconf/perm.cc Tue Mar 27 15:55:23 2001
--- 1.27r4/linuxconf/userconf/perm.cc Sat Apr 6 14:28:04 2002
***************
*** 501,517 ****
}
return ret;
}
-
-
/*
! get the authenticated user ID
*/
! int perm_getuid()
{
int ret = getuid();
if (perm_html_mode){
ret = html_uid;
}
if (time(NULL) - lasttime_root < VALIDATION_TIME){
ret = 0;
}
--- 501,524 ----
}
return ret;
}
/*
! Get user ID operating linuxconf currrently
*/
! int perm_getadminuid()
{
int ret = getuid();
if (perm_html_mode){
ret = html_uid;
}
+ return ret;
+ }
+
+ /*
+ get the authenticated user ID.
+ */
+ int perm_getuid()
+ {
+ int ret = perm_getadminuid();
if (time(NULL) - lasttime_root < VALIDATION_TIME){
ret = 0;
}
*** 1.27r3-pre/linuxconf/userconf/userconf.p Fri Sep 14 16:33:55 2001
--- 1.27r4/linuxconf/userconf/userconf.p Sat Apr 6 14:28:34 2002
***************
*** 13,19 ****
int cron_delcmd (const char *user, const char *cmd);
/* _dict.cc 14/08/1996 15.00.36 */
/* fileowner.cc 20/01/2000 20.40.46 */
! /* group.cc 11/05/2001 15.30.46 */
const char *group_gethomebase (const char *gname);
bool group_homeneeded (const char *gname);
int group_getcreateperm (const char *gname);
--- 13,19 ----
int cron_delcmd (const char *user, const char *cmd);
/* _dict.cc 14/08/1996 15.00.36 */
/* fileowner.cc 20/01/2000 20.40.46 */
! /* group.cc 18/09/2001 21.59.00 */
const char *group_gethomebase (const char *gname);
bool group_homeneeded (const char *gname);
int group_getcreateperm (const char *gname);
***************
*** 29,35 ****
/* helpf.cc 14/08/1996 15.01.30 */
/* internal.cc 27/08/1995 12.26.28 */
/* passwd_chat.cc 21/03/2000 16.26.26 */
! /* passwd_valid.cc 06/12/2000 15.40.42 */
const char *policies_getdefhome (void);
int policies_getcreateperm (void);
const char *policies_getcreatecmd (void);
--- 29,35 ----
/* helpf.cc 14/08/1996 15.01.30 */
/* internal.cc 27/08/1995 12.26.28 */
/* passwd_chat.cc 21/03/2000 16.26.26 */
! /* passwd_valid.cc 18/09/2001 22.04.14 */
const char *policies_getdefhome (void);
int policies_getcreateperm (void);
const char *policies_getcreatecmd (void);
***************
*** 43,49 ****
bool policies_mayedittasks (void);
bool policies_mayshowshadow (void);
bool policies_mayshowexpire (void);
! /* perm.cc 27/03/2001 15.55.22 */
void passwd_sethook (int (*_fct_check)(const char *user),
int (*_fct_change)(const char *user, bool pre_authenticated),
int (*_fct_check_pair)(const char *user, const char *passwd));
--- 43,49 ----
bool policies_mayedittasks (void);
bool policies_mayshowshadow (void);
bool policies_mayshowexpire (void);
! /* perm.cc 06/04/2002 14.28.04 */
void passwd_sethook (int (*_fct_check)(const char *user),
int (*_fct_change)(const char *user, bool pre_authenticated),
int (*_fct_check_pair)(const char *user, const char *passwd));
***************
*** 60,65 ****
--- 60,66 ----
int perm_rootaccess (const char *ctl, ...);
int perm_access (PRIVILEGE *priv, const char *ctl, ...);
int perm_checkpriv (PRIVILEGE *priv);
+ int perm_getadminuid (void);
int perm_getuid (void);
void perm_sethtml (bool _mode);
/* privi.cc 18/09/2000 17.52.44 */
***************
*** 99,105 ****
void userconf_editupass (USERS&users, const char *server);
void userconf_editupass (void);
/* user1.cc 04/12/2000 23.48.26 */
! /* user.cc 03/04/2001 00.19.06 */
int user_splitline (const char *line, char words[9][100]);
bool user_isadmin (const char *loginid);
int pass_isweak (const char *pass);
--- 100,106 ----
void userconf_editupass (USERS&users, const char *server);
void userconf_editupass (void);
/* user1.cc 04/12/2000 23.48.26 */
! /* user.cc 27/03/2002 14.20.16 */
int user_splitline (const char *line, char words[9][100]);
bool user_isadmin (const char *loginid);
int pass_isweak (const char *pass);
***************
*** 111,117 ****
const char *userconf_getusage (void);
int userconf_main (int argc, char *argv[]);
void userconf_listspc (void);
! /* users.cc 14/09/2001 16.33.50 */
void users_sethook (int (*_user_fct_del)(USER *, SHADOW *),
int (*_user_fct_add)(USER *, SHADOW *, bool),
int (*_user_fct_mod)(USER *, SHADOW *));
--- 112,118 ----
const char *userconf_getusage (void);
int userconf_main (int argc, char *argv[]);
void userconf_listspc (void);
! /* users.cc 21/02/2002 15.11.18 */
void users_sethook (int (*_user_fct_del)(USER *, SHADOW *),
int (*_user_fct_add)(USER *, SHADOW *, bool),
int (*_user_fct_mod)(USER *, SHADOW *));
*** 1.27r3-pre/linuxconf/userconf/userconf.pm Fri Sep 14 16:33:55 2001
--- 1.27r4/linuxconf/userconf/userconf.pm Sat Apr 6 14:28:34 2002
***************
*** 18,24 ****
PUBLIC int CRONTAB::delcmd (const char *cmd);
/* _dict.cc 14/08/1996 15.00.36 */
/* fileowner.cc 20/01/2000 20.40.46 */
! /* group.cc 11/05/2001 15.30.46 */
PRIVATE void GROUP::settbmem (char **members);
PRIVATE void GROUP::settbmem (const SSTRINGS&members);
PRIVATE void GROUP::init (const char *_name,
--- 18,24 ----
PUBLIC int CRONTAB::delcmd (const char *cmd);
/* _dict.cc 14/08/1996 15.00.36 */
/* fileowner.cc 20/01/2000 20.40.46 */
! /* group.cc 18/09/2001 21.59.00 */
PRIVATE void GROUP::settbmem (char **members);
PRIVATE void GROUP::settbmem (const SSTRINGS&members);
PRIVATE void GROUP::init (const char *_name,
***************
*** 76,86 ****
PUBLIC USERCONF_HELP_FILE::USERCONF_HELP_FILE (const char *fname);
/* internal.cc 27/08/1995 12.26.28 */
/* passwd_chat.cc 21/03/2000 16.26.26 */
! /* passwd_valid.cc 06/12/2000 15.40.42 */
PUBLIC void PASSWD_VALID::write (void);
PUBLIC PASSWD_VALID::PASSWD_VALID (void);
PUBLIC void PASSWD_VALID::edit (void);
! /* perm.cc 27/03/2001 15.55.22 */
/* privi.cc 18/09/2000 17.52.44 */
PUBLIC PRIVILEGE::PRIVILEGE (const char *_id,
TRANS_NOTLOAD *_title,
--- 76,86 ----
PUBLIC USERCONF_HELP_FILE::USERCONF_HELP_FILE (const char *fname);
/* internal.cc 27/08/1995 12.26.28 */
/* passwd_chat.cc 21/03/2000 16.26.26 */
! /* passwd_valid.cc 18/09/2001 22.04.14 */
PUBLIC void PASSWD_VALID::write (void);
PUBLIC PASSWD_VALID::PASSWD_VALID (void);
PUBLIC void PASSWD_VALID::edit (void);
! /* perm.cc 06/04/2002 14.28.04 */
/* privi.cc 18/09/2000 17.52.44 */
PUBLIC PRIVILEGE::PRIVILEGE (const char *_id,
TRANS_NOTLOAD *_title,
***************
*** 151,157 ****
PUBLIC bool USER::is_like (const USER *other)const;
PUBLIC void USER::setlike (const USER *other);
PUBLIC bool USER::is_logged (void);
! /* user.cc 03/04/2001 00.19.06 */
PUBLIC bool USER::statuschanged (bool&active);
PRIVATE void USER::init (const char *_name,
const char *_passwd,
--- 151,157 ----
PUBLIC bool USER::is_like (const USER *other)const;
PUBLIC void USER::setlike (const USER *other);
PUBLIC bool USER::is_logged (void);
! /* user.cc 27/03/2002 14.20.16 */
PUBLIC bool USER::statuschanged (bool&active);
PRIVATE void USER::init (const char *_name,
const char *_passwd,
***************
*** 248,254 ****
PUBLIC void USERACCT_COMNGS::set_bool (const char *var, bool val);
PUBLIC bool USERACCT_COMNGS::get_bool (const char *var)const;
/* userconf.cc 11/05/2001 15.27.46 */
! /* users.cc 14/09/2001 16.33.50 */
PRIVATE void USERS::readusers (void);
PUBLIC USERS::USERS (void);
PUBLIC USERS::USERS (CONFIG_FILE&_file,
--- 248,254 ----
PUBLIC void USERACCT_COMNGS::set_bool (const char *var, bool val);
PUBLIC bool USERACCT_COMNGS::get_bool (const char *var)const;
/* userconf.cc 11/05/2001 15.27.46 */
! /* users.cc 21/02/2002 15.11.18 */
PRIVATE void USERS::readusers (void);
PUBLIC USERS::USERS (void);
PUBLIC USERS::USERS (CONFIG_FILE&_file,
*** 1.27r3-pre/linuxconf/tlmp/tlmplib/file.cc Thu Feb 7 21:57:56 2002
--- 1.27r4/linuxconf/tlmp/tlmplib/file.cc Sat Apr 6 13:56:33 2002
***************
*** 70,80 ****
}
! int savefile (_F_savefile &c, const char *fname, bool append)
{
c.priv = NULL;
int ret = -1;
- FILE *fout = fopen(fname,append ? "a" : "w");
if (fout == NULL){
c.openfail (fname);
}else{
--- 70,79 ----
}
! static int savefile_gen (_F_savefile &c, const char *fname, FILE *fout)
{
c.priv = NULL;
int ret = -1;
if (fout == NULL){
c.openfail (fname);
}else{
***************
*** 82,90 ****
ret = c.dowrite (fout,fname);
fflush (fout);
c.end(fout,fname);
- if (fclose (fout) == -1) ret = -1;
}
return ret;
}
--- 81,104 ----
ret = c.dowrite (fout,fname);
fflush (fout);
c.end(fout,fname);
}
return ret;
}
+ int savefile (_F_savefile &c, const char *fname, bool append)
+ {
+ FILE *fout = fopen(fname,append ? "a" : "w");
+ int ret = savefile_gen (c,fname,fout);
+ if (fout != NULL) if (fclose (fout) == -1) ret = -1;
+ return ret;
+ }
+
+ int savefile (_F_savefile &c, CONFIG_FILE &cfg, bool append)
+ {
+ FILE_CFG *fout = cfg.fopen(append ? "a" : "w");
+ SSTRING tmp(cfg.getpath());
+ int ret = savefile_gen (c,tmp.get(),filecfg_tofile(fout));
+ if (fout != NULL) if (fclose (fout) == -1) ret = -1;
+ return ret;
+ }
*** 1.27r3-pre/linuxconf/tlmp/tlmplib/tlmplib.h Mon Feb 4 12:54:25 2002
--- 1.27r4/linuxconf/tlmp/tlmplib/tlmplib.h Mon Apr 8 12:12:09 2002
***************
*** 130,135 ****
--- 130,136 ----
class SSTREAM;
class ARRAY;
+ class CONFIG_FILE;
#include "tlmplib.p"
*** 1.27r3-pre/linuxconf/tlmp/tlmplib/tlmplib.p Sat Feb 2 22:35:31 2002
--- 1.27r4/linuxconf/tlmp/tlmplib/tlmplib.p Sat Apr 6 13:54:12 2002
***************
*** 1,16 ****
- /* _dict.cc 20/02/1999 13.39.06 */
/* copyfile.cc 08/09/2001 23.06.08 */
int copyfile (_F_copyfile&c, const char *src, const char *dst);
! /* file.cc 10/09/2001 00.57.40 */
int loadfile (_F_loadfile&c, SSTREAM&ss, bool strip);
int loadfile (_F_loadfile&c, const char *fname, bool strip);
int savefile (_F_savefile&c, const char *fname, bool append);
/* sort.cc 02/08/2001 14.42.14 */
void sort (_F_sort&c, ARRAY&a);
/* tlmplib.cc 20/02/1999 14.13.24 */
void tlmp_seterrorfct (void (*fct)(const char *errmsg));
void tlmp_error (const char *msg, ...);
! /* tlmpprogram.cc 02/02/2002 22.35.20 */
int tlmpprogram___v1 (_F_tlmpprogram___v1&c,
int argc,
char *argv[],
--- 1,18 ----
/* copyfile.cc 08/09/2001 23.06.08 */
int copyfile (_F_copyfile&c, const char *src, const char *dst);
! /* _dict.cc 20/02/1999 13.39.06 */
! /* file.cc 06/04/2002 13.53.58 */
int loadfile (_F_loadfile&c, SSTREAM&ss, bool strip);
int loadfile (_F_loadfile&c, const char *fname, bool strip);
+ int savefile (_F_savefile&c, const char *fname, FILE *fout);
int savefile (_F_savefile&c, const char *fname, bool append);
+ int savefile (_F_savefile&c, CONFIG_FILE&cfg, bool append);
/* sort.cc 02/08/2001 14.42.14 */
void sort (_F_sort&c, ARRAY&a);
/* tlmplib.cc 20/02/1999 14.13.24 */
void tlmp_seterrorfct (void (*fct)(const char *errmsg));
void tlmp_error (const char *msg, ...);
! /* tlmpprogram.cc 15/02/2002 14.43.54 */
int tlmpprogram___v1 (_F_tlmpprogram___v1&c,
int argc,
char *argv[],
***************
*** 31,38 ****
const char *command,
int timeout,
bool user);
! /* samples.tlcc 02/02/2002 22.35.30 */
! /* tlmpprogram_v0.tlcc 02/02/2002 22.35.30 */
int tlmpprogram (_F_tlmpprogram&c,
const char *progname,
int argc,
--- 33,40 ----
const char *command,
int timeout,
bool user);
! /* samples.tlcc 06/04/2002 13.54.12 */
! /* tlmpprogram_v0.tlcc 06/04/2002 13.54.12 */
int tlmpprogram (_F_tlmpprogram&c,
const char *progname,
int argc,
*** 1.27r3-pre/linuxconf/tlmp/tlmplib/tlmplib.pm Sat Feb 2 22:35:31 2002
--- 1.27r4/linuxconf/tlmp/tlmplib/tlmplib.pm Sat Apr 6 13:54:12 2002
***************
*** 1,4 ****
- /* _dict.cc 20/02/1999 13.39.06 */
/* copyfile.cc 08/09/2001 23.06.08 */
void _F_copyfile::fail (const char *src,
const char *dst,
--- 1,3 ----
***************
*** 8,14 ****
size_t size,
size_t sofar,
bool&end);
! /* file.cc 10/09/2001 00.57.40 */
void _F_loadfile::empty (void);
void _F_loadfile::start (void);
void _F_loadfile::end (off_t);
--- 7,14 ----
size_t size,
size_t sofar,
bool&end);
! /* _dict.cc 20/02/1999 13.39.06 */
! /* file.cc 06/04/2002 13.53.58 */
void _F_loadfile::empty (void);
void _F_loadfile::start (void);
void _F_loadfile::end (off_t);
***************
*** 18,39 ****
void _F_savefile::openfail (const char *fname);
/* sort.cc 02/08/2001 14.42.14 */
/* tlmplib.cc 20/02/1999 14.13.24 */
! /* tlmpprogram.cc 02/02/2002 22.35.20 */
void _F_tlmpprogram___v0::setproginfo (const char *name,
const char *version,
const char *desc);
void _F_tlmpprogram___v0::setarg (const char letter,
const char *name,
const char *desc,
! SSTRING&val);
void _F_tlmpprogram___v0::setarg (const char letter,
const char *name,
const char *desc,
! int &val);
void _F_tlmpprogram___v0::setarg (const char letter,
const char *name,
const char *desc,
! bool&val);
void _F_tlmpprogram___v1::usage (void);
void _F_tlmpprogram___v1::showerror (const char *msg);
int _F_tlmpprogram___v1::onearg (const char *, const char *);
--- 18,52 ----
void _F_savefile::openfail (const char *fname);
/* sort.cc 02/08/2001 14.42.14 */
/* tlmplib.cc 20/02/1999 14.13.24 */
! /* tlmpprogram.cc 15/02/2002 14.43.54 */
void _F_tlmpprogram___v0::setproginfo (const char *name,
const char *version,
const char *desc);
void _F_tlmpprogram___v0::setarg (const char letter,
const char *name,
const char *desc,
! const char *&val,
! bool mandatory);
! void _F_tlmpprogram___v0::setarg (const char letter,
! const char *name,
! const char *desc,
! SSTRING&val,
! bool mandatory);
! void _F_tlmpprogram___v0::setarg (const char letter,
! const char *name,
! const char *desc,
! SSTRINGS&vals,
! bool mandatory);
void _F_tlmpprogram___v0::setarg (const char letter,
const char *name,
const char *desc,
! int &val,
! bool mandatory);
void _F_tlmpprogram___v0::setarg (const char letter,
const char *name,
const char *desc,
! bool&val,
! bool mandatory);
void _F_tlmpprogram___v1::usage (void);
void _F_tlmpprogram___v1::showerror (const char *msg);
int _F_tlmpprogram___v1::onearg (const char *, const char *);
***************
*** 52,59 ****
void _F_walkpopen::fail (const char *cmd);
void _F_walkpopen::close_input (void);
void _F_walkpopen::init (FILE *, bool&);
! /* samples.tlcc 02/02/2002 22.35.30 */
! /* tlmpprogram_v0.tlcc 02/02/2002 22.35.30 */
void _F_tlmpprogram::showerror (const char *msg);
int _F_tlmpprogram::onearg (const char *, const char *);
int _F_tlmpprogram::main_noarg (void);
--- 65,72 ----
void _F_walkpopen::fail (const char *cmd);
void _F_walkpopen::close_input (void);
void _F_walkpopen::init (FILE *, bool&);
! /* samples.tlcc 06/04/2002 13.54.12 */
! /* tlmpprogram_v0.tlcc 06/04/2002 13.54.12 */
void _F_tlmpprogram::showerror (const char *msg);
int _F_tlmpprogram::onearg (const char *, const char *);
int _F_tlmpprogram::main_noarg (void);
*** 1.27r3-pre/linuxconf/lib/Makefile Thu May 10 20:33:28 2001
--- 1.27r4/linuxconf/lib/Makefile Thu Apr 4 11:52:53 2002
***************
*** 17,23 ****
@echo Creating liblinuxconf
@$(GPPLINK) -g -shared -Wl,-soname,liblinuxconf.so.$(LIB_REV) -o \
liblinuxconf.so.$(PACKAGE_REV) \
! $(MEMBERS)
@ln -sf liblinuxconf.so.$(PACKAGE_REV) liblinuxconf.so
local_clean:
--- 17,23 ----
@echo Creating liblinuxconf
@$(GPPLINK) -g -shared -Wl,-soname,liblinuxconf.so.$(LIB_REV) -o \
liblinuxconf.so.$(PACKAGE_REV) \
! $(MEMBERS) -lncurses
@ln -sf liblinuxconf.so.$(PACKAGE_REV) liblinuxconf.so
local_clean: