aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--fileio.c64
-rw-r--r--wfm.c6
-rw-r--r--wfm.h2
4 files changed, 36 insertions, 39 deletions
diff --git a/README.md b/README.md
index dfd8a43..c47688c 100644
--- a/README.md
+++ b/README.md
@@ -102,4 +102,5 @@ WFM implemented by [Antoni Sawicki](http://www.tenox.net/)
Server Side RFC 1321 implementation by [L. Peter Deutsch](https://sourceforge.net/projects/libmd5-rfc/files/)
Client Side RFC 1321 implementation by [Paul Johnston](http://pajhome.org.uk/crypt/md5/index.html)
Icons by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/)
-Web browser testing by [BrowserStack](http://www.browserstack.com/) \ No newline at end of file
+URL Encoding routines by Fred Bulback
+Web browser testing by [BrowserStack](http://www.browserstack.com/)
diff --git a/fileio.c b/fileio.c
index c2efecd..b5718d3 100644
--- a/fileio.c
+++ b/fileio.c
@@ -135,8 +135,8 @@ void edit_save(void) {
FILE *tempf;
char backup[4]={0};
char backup_filename[PHYS_DESTINATION_SIZE]={0};
- regex_t re;
- regmatch_t pmatch;
+ regex_t re;
+ regmatch_t pmatch;
struct stat tmpstat;
checkfilename(NULL);
@@ -375,21 +375,21 @@ off_t du(char *pdir) {
// Called by for move_ui()
//
void re_dir_ui(char *vdir, int level) {
- struct dirent **direntry;
- struct stat fileinfo;
- char child[VIRT_DIRNAME_SIZE]={0};
- char phy_child[PHYS_DIRNAME_SIZE]={0};
- char re_phys_dirname[PHYS_DIRNAME_SIZE]={0};
- int n;
- int nentr, e;
-
- snprintf(re_phys_dirname, PHYS_DIRNAME_SIZE, "%s/%s", HOMEDIR, vdir);
-
- if(strlen(re_phys_dirname)<2 || strlen(re_phys_dirname)>(PHYS_DIRNAME_SIZE-2))
- error("Invalid directory name.");
-
- if(regexec(&dotdot, re_phys_dirname, 0, 0, 0)==0) error("Invalid directory name.");
- if(strlen(re_phys_dirname) < strlen(HOMEDIR)) error("Invalid directory name.");
+ struct dirent **direntry;
+ struct stat fileinfo;
+ char child[VIRT_DIRNAME_SIZE]={0};
+ char phy_child[PHYS_DIRNAME_SIZE]={0};
+ char re_phys_dirname[PHYS_DIRNAME_SIZE]={0};
+ int n;
+ int nentr, e;
+
+ snprintf(re_phys_dirname, PHYS_DIRNAME_SIZE, "%s/%s", HOMEDIR, vdir);
+
+ if(strlen(re_phys_dirname)<2 || strlen(re_phys_dirname)>(PHYS_DIRNAME_SIZE-2))
+ error("Invalid directory name.");
+
+ if(regexec(&dotdot, re_phys_dirname, 0, 0, 0)==0) error("Invalid directory name.");
+ if(strlen(re_phys_dirname) < strlen(HOMEDIR)) error("Invalid directory name.");
nentr=scandir(re_phys_dirname, &direntry, 0, alphasort);
@@ -398,7 +398,7 @@ void re_dir_ui(char *vdir, int level) {
if((direntry[e]->d_name[0]!='.') && (lstat(phy_child, &fileinfo)==0) && S_ISDIR(fileinfo.st_mode)) {
- snprintf(child, VIRT_DIRNAME_SIZE, "%s/%s", vdir, direntry[e]->d_name);
+ snprintf(child, VIRT_DIRNAME_SIZE, "%s/%s", vdir, direntry[e]->d_name);
fprintf(cgiOut, "<OPTION VALUE=\"%s\">", child);
@@ -411,7 +411,7 @@ void re_dir_ui(char *vdir, int level) {
re_dir_ui(child,level+1);
}
free(direntry[e]);
- }
+ }
}
@@ -419,11 +419,11 @@ void re_dir_ui(char *vdir, int level) {
// Scandir replacement function
//
int namesort(const void *d1, const void *d2) {
- return(strcasecmp(((ASDIR*)d1)->name, ((ASDIR*)d2)->name));
+ return(strcasecmp(((ASDIR*)d1)->name, ((ASDIR*)d2)->name));
}
int rnamesort(const void *d1, const void *d2) {
- return(strcasecmp(((ASDIR*)d2)->name, ((ASDIR*)d1)->name));
+ return(strcasecmp(((ASDIR*)d2)->name, ((ASDIR*)d1)->name));
}
int sizesort(const void *d1, const void *d2) {
@@ -451,20 +451,20 @@ int rtimesort(const void *d1, const void *d2) {
}
int asscandir(const char *dir, ASDIR **namelist, int (*compar)(const void *, const void *)) {
- DIR *dirh;
- ASDIR *names;
- struct dirent *entry;
+ DIR *dirh;
+ ASDIR *names;
+ struct dirent *entry;
struct stat fileinfo;
char filename[PATH_MAX]={0};
int entries=0;
- dirh=opendir(dir);
- if(dirh==NULL)
- return -1;
-
- names=(ASDIR*)malloc(sizeof(ASDIR));
- if(names==NULL)
- return -1;
+ dirh=opendir(dir);
+ if(dirh==NULL)
+ return -1;
+
+ names=(ASDIR*)malloc(sizeof(ASDIR));
+ if(names==NULL)
+ return -1;
entry=readdir(dirh);
while(entry!=NULL) {
@@ -495,5 +495,5 @@ int asscandir(const char *dir, ASDIR **namelist, int (*compar)(const void *, con
qsort(&names[0], entries, sizeof(ASDIR), compar);
*namelist=names;
- return entries;
+ return entries;
} \ No newline at end of file
diff --git a/wfm.c b/wfm.c
index 516116f..a181eb1 100644
--- a/wfm.c
+++ b/wfm.c
@@ -119,11 +119,6 @@ void access_check(char *access_string) {
char type[4]={0};
char token_inp[64]={0};
- memset(ipaddr, 0, sizeof(ipaddr));
- memset(user, 0, sizeof(user));
- memset(pass, 0, sizeof(pass));
- memset(type, 0, sizeof(type));
-
if(sscanf(access_string, "access-ip=%2s:%30s", type, ipaddr)==2) {
if(ipaddr[0]=='*') {
@@ -155,6 +150,7 @@ void access_check(char *access_string) {
access_level=PERM_RW;
access_as_user=1;
strncpy(loggedinuser, user, sizeof(loggedinuser));
+ cgiAllowUploadFiles=1;
}
}
}
diff --git a/wfm.h b/wfm.h
index b9afc64..55fefaf 100644
--- a/wfm.h
+++ b/wfm.h
@@ -1,4 +1,4 @@
-#define VERSION "1.1.1"
+#define VERSION "1.1.2"
#define copyright "<!-- WFM Version " VERSION ", Mountain View, CA, " __DATE__ " [" __TIME__ "] -->\n<!-- Copyright (c) 1994-2016 by Antoni Sawicki -->\n"
#define CSS_STYLE \