summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-11-09 05:16:25 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-11-09 05:16:25 +0800
commit5b17379b7b9e93482ce886ee75eae41b2e5a9bb6 (patch)
tree87fba80f039bea2f23dd299780b9e3b33f305f47
parent10624ecf13fd3d2537619cb895334257882e06ae (diff)
downloadpttbbs-5b17379b7b9e93482ce886ee75eae41b2e5a9bb6.tar
pttbbs-5b17379b7b9e93482ce886ee75eae41b2e5a9bb6.tar.gz
pttbbs-5b17379b7b9e93482ce886ee75eae41b2e5a9bb6.tar.bz2
pttbbs-5b17379b7b9e93482ce886ee75eae41b2e5a9bb6.tar.lz
pttbbs-5b17379b7b9e93482ce886ee75eae41b2e5a9bb6.tar.xz
pttbbs-5b17379b7b9e93482ce886ee75eae41b2e5a9bb6.tar.zst
pttbbs-5b17379b7b9e93482ce886ee75eae41b2e5a9bb6.zip
remove mdclean, splitpasswd
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@567 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--util/.cvsignore2
-rw-r--r--util/Makefile10
-rw-r--r--util/mdclean.c98
-rw-r--r--util/splitpasswd.c32
4 files changed, 2 insertions, 140 deletions
diff --git a/util/.cvsignore b/util/.cvsignore
index d33e906f..28defeaa 100644
--- a/util/.cvsignore
+++ b/util/.cvsignore
@@ -41,6 +41,4 @@ jungo
bbsctl
mandex
shmctl
-mdclean
-splitpasswd
indexuser
diff --git a/util/Makefile b/util/Makefile
index e3b2a783..8e0479e4 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.21 2002/11/04 08:46:50 in2 Exp $
+# $Id: Makefile,v 1.22 2002/11/08 21:16:25 in2 Exp $
BBSHOME?=$(HOME)
OSTYPE!=uname
@@ -30,7 +30,7 @@ CPROGS= bbsmail BM_money post account birth deluserfile expire mandex\
poststat showboard antispam countalldice webgrep bbsrf\
initbbs outmail xchatd userlist tunepasswd buildir reaper shmsweep\
merge_passwd merge_board inndBM buildAnnounce rmuid \
- toplazyBM jungo toplazyBBM shmctl mdclean splitpasswd indexuser
+ toplazyBM jungo toplazyBBM shmctl indexuser
PROGS= $(CPROGS) BM_money.sh backpasswd.sh mailog.sh opendice.sh\
openticket.sh stock.sh topsong.sh weather.sh stock.perl weather.perl\
@@ -162,12 +162,6 @@ bbsctl: bbsctl.c
shmctl: shmctl.c $(OBJS)
$(CC) $(CFLAGS) -o $@ $@.c $(OBJS)
-mdclean: mdclean.c
- $(CC) $(CFLAGS) -o $@ $@.c
-
-splitpasswd: splitpasswd.c
- $(CC) $(CFLAGS) -o $@ $@.c
-
install: $(PROGS)
install -d $(BBSHOME)/bin/
install -c -m 755 $(PROGS) $(BBSHOME)/bin/
diff --git a/util/mdclean.c b/util/mdclean.c
deleted file mode 100644
index 196fc9ee..00000000
--- a/util/mdclean.c
+++ /dev/null
@@ -1,98 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "config.h"
-#include <sys/types.h>
-#include <dirent.h>
-#include <unistd.h>
-#include <err.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-
-#define MAXDSs 1048576
-
-typedef struct {
- time_t atime;
- char name[60];
-} DS;
-
-DS ds[MAXDSs];
-int nDSs;
-
-int compar(const void *a, const void *b)
-{
- return ((DS *)a)->atime - ((DS *)b)->atime;
-}
-
-int main(int argc, char **argv)
-{
- DIR *dirp;
- struct dirent *dp;
- struct stat sb;
- struct statfs sf;
- char *fn;
- time_t now;
- int sleeptime, leavespace, clean;
-
- if( argc != 4 ){
- puts("usage:\tmdclean sleeptime(secs) leavespace(k) clean(%%)\n");
- return 0;
- }
- sleeptime = (atoi(argv[1]) < 1) ? 1 : atoi(argv[1]);
- leavespace= (atoi(argv[2]) <100)?100: atoi(argv[2]);
- clean = (atoi(argv[3]) < 1) ? 1 : atoi(argv[3]);
-
- if( chdir(BBSHOME "/cache") < 0 )
- err(1, "chdir");
-
- while( 1 ){
- puts("sleeping...");
- sleep(sleeptime);
- if( (dirp = opendir(".")) == NULL )
- err(1, "opendir");
-
- statfs(".", &sf);
- if( sf.f_bfree * sf.f_bsize / 1024 > leavespace )
- continue;
-
- nDSs = 0;
- now = time(NULL);
- while( (dp = readdir(dirp)) != NULL ){
- fn = dp->d_name;
- if( fn[0] != 'e' && fn[0] != 'b' ){
- unlink(fn);
- continue;
- }
- if( stat(fn, &sb) < 0 )
- continue;
- if( sb.st_atime < now - 1800 ){
- printf("atime: %s\n", fn);
- unlink(fn);
- }
- else if( sb.st_mtime < now - 10800 ){
- printf("mtime: %s\n", fn);
- unlink(fn);
- }
- else{
- if( nDSs != MAXDSs ){
- strcpy(ds[nDSs].name, fn);
- ds[nDSs].atime = sb.st_atime;
- ++nDSs;
- }
- }
- }
- closedir(dirp);
-
- statfs(".", &sf);
- if( sf.f_bfree * sf.f_bsize / 1024 <= leavespace ){
- qsort(ds, nDSs, sizeof(DS), compar);
- nDSs = nDSs * clean / 100;
- while( nDSs-- ){
- printf("%s\n", ds[nDSs].name);
- unlink(ds[nDSs].name);
- }
- }
- }
- return 0;
-}
diff --git a/util/splitpasswd.c b/util/splitpasswd.c
deleted file mode 100644
index 1a800f6c..00000000
--- a/util/splitpasswd.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "bbs.h"
-#include <err.h>
-
-int main(int argc, char **argv)
-{
- userec_t xuser;
- int fd, ufd;
- char path[80], fn[80];
-
- chdir(BBSHOME);
- if( (fd = open(".PASSWDS", O_RDONLY)) < 0 )
- err(1, ".PASSWDS");
-
- while( read(fd, &xuser, sizeof(xuser)) > 0 ){
- if( strcmp(xuser.userid, "in2") != 0 )
- continue;
- sprintf(path, "home/%c/%s", xuser.userid[0], xuser.userid);
- if( access(path, 0) < 0 ){
- printf("user home error (%s) (%s)\n", xuser.userid, path);
- continue;
- }
- sprintf(fn, "%s/.passwd", path);
- if( (ufd = open(fn, O_WRONLY | O_CREAT, 0600)) < 0 ){
- perror(path);
- continue;
- }
- write(ufd, &xuser, sizeof(xuser));
- close(ufd);
- }
-
- return 0;
-}