diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-18 15:15:18 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-18 15:15:18 +0200 |
commit | 7b4d3ab22988d021d5f12b81aec746f7e486fa52 (patch) | |
tree | 651e78e316411a39baadadb1cfaca450e1351c7f /src/qmail-qmaint.c | |
parent | 25f74781424d5e13f0211c08cce8c2a1d60b9aec (diff) |
update to 4.3.09
Diffstat (limited to 'src/qmail-qmaint.c')
-rw-r--r-- | src/qmail-qmaint.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/qmail-qmaint.c b/src/qmail-qmaint.c index 02304e7..2539e78 100644 --- a/src/qmail-qmaint.c +++ b/src/qmail-qmaint.c @@ -19,7 +19,7 @@ #include "readsubdir.h" #include "logmsg.h" #include "exit.h" -#include "auto_qmail.h" +#include "auto_queue.h" #include "auto_split.h" #include "auto_uids.h" #include "datetime.h" @@ -128,9 +128,9 @@ int check_item(char *name,int uid,int gid,int perm,char type,int size) /*check for existence and proper credentials*/ - strnum[fmt_ulong(unum,uid)] = 0; - strnum[fmt_ulong(gnum,gid)] = 0; - strnum[fmt_ulong(pnum,perm)] = 0; + strnum[fmt_uint(unum,uid)] = 0; + strnum[fmt_uint(gnum,gid)] = 0; + strnum[fmt_uint(pnum,perm)] = 0; switch (type) { case 'd': /*directory*/ @@ -362,11 +362,9 @@ int cleanup_dkim() direntry *d; struct stat st; int deleted = 0; - unsigned long id; - if (chdir(auto_qmail) == -1) err_chdir(); - if (chdir("queue") == -1) err_chdir(); - if (chdir("dkim") == -1) return 0; + if (chdir(auto_queue) == -1) err_chdir(); + if (chdir("queue/dkim") == -1) return 0; if (!stralloc_copy(&dkim_dir,&queue_dir)) die_nomem(); if (!stralloc_cats(&dkim_dir,"dkim/")) die_nomem(); @@ -475,12 +473,11 @@ int fix_names() int check_dirs() { - /*check root existence*/ + /*check queue existence*/ if (!stralloc_copy(&check_dir,&queue_dir)) die_nomem(); if (!stralloc_0(&check_dir)) die_nomem(); if (check_item(check_dir.s,qmailq_uid,qmail_gid,0750,'d',0)) return -1; - /*check the bigtodo queue */ if (!stralloc_copy(&check_dir,&queue_dir)) die_nomem(); if (!stralloc_cats(&check_dir,"info")) die_nomem(); if (!stralloc_0(&check_dir)) die_nomem(); @@ -511,12 +508,14 @@ int check_dirs() if (check_item(check_dir.s,qmailq_uid,qmail_gid,0700,'d',0)) return -1; if (check_splits(check_dir.s,qmailq_uid,qmail_gid,0700,qmail_gid,0600)) return -1; + /*check the bigtodo queue */ if (!stralloc_copy(&check_dir,&queue_dir)) die_nomem(); if (!stralloc_cats(&check_dir,"todo")) die_nomem(); if (!stralloc_0(&check_dir)) die_nomem(); if (check_item(check_dir.s,qmailq_uid,qmail_gid,0750,'d',0)) return -1; if (check_splits(check_dir.s,qmailq_uid,qmail_gid,0750,-1,0644)) return -1; + /*check the dkim staging area */ if (!stralloc_copy(&check_dir,&queue_dir)) die_nomem(); if (!stralloc_cats(&check_dir,"dkim")) die_nomem(); if (!stralloc_0(&check_dir)) die_nomem(); @@ -537,7 +536,7 @@ int check_dirs() warn_files(check_dir.s); - /*lock has special files that must exist*/ + /* lock has special files that must exist */ if (!stralloc_copy(&check_dir,&queue_dir)) die_nomem(); if (!stralloc_cats(&check_dir,"lock")) die_nomem(); if (!stralloc_0(&check_dir)) die_nomem(); @@ -585,8 +584,9 @@ int delete_msg(unsigned long id) struct stat st; int bounce = 1; - if (chdir(auto_qmail) == -1) err_chdir(); + if (chdir(auto_queue) == -1) err_chdir(); if (chdir("queue") == -1) err_chdir(); + fnmake_init(); fnmake_mess(id); // regular message pre-processed @@ -641,10 +641,10 @@ int main(int argc, char **argv) logmsg(WHO,111,USAGE,"qmail-qmaint [-i] || [-d messid] || [-D]"); } - if (!stralloc_copys(&queue_dir,auto_qmail)) die_nomem(); + if (!stralloc_copys(&queue_dir,auto_queue)) die_nomem(); if (!stralloc_cats(&queue_dir,"/queue/")) die_nomem(); - logmsg(WHO,0,INFO,B("Checking s/qmail queue at: ",auto_qmail,"/queue/")); + logmsg(WHO,0,INFO,B("Checking s/qmail queue at: ",auto_queue,"/queue/")); /* get constants */ |