nightmaremail

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 7e89111010ad51dedb0038a052d4991f06e24944
parent f7b6124770eb34b2e8ff835928cf30e8f6e8d976
Author: Rolf Eike Beer <eike@sf-mail.de>
Date:   Fri,  8 May 2020 16:45:58 +0200

change function signatures to C89 style that were touched in last commit

Diffstat:
Mhier.c | 6++----
Minstcheck.c | 47+++++++----------------------------------------
Mprot.c | 4++--
3 files changed, 11 insertions(+), 46 deletions(-)

diff --git a/hier.c b/hier.c @@ -8,10 +8,8 @@ char buf[100 + FMT_ULONG]; -void dsplit(base,uid,mode) -char *base; /* must be under 100 bytes */ -uid_t uid; -int mode; +void dsplit(char *base, /* must be under 100 bytes */ + uid_t uid, int mode) { char *x; unsigned long i; diff --git a/instcheck.c b/instcheck.c @@ -12,15 +12,8 @@ extern void hier(); #define FATAL "instcheck: fatal: " #define WARNING "instcheck: warning: " -void perm(prefix1,prefix2,prefix3,file,type,uid,gid,mode) -char *prefix1; -char *prefix2; -char *prefix3; -char *file; -int type; -uid_t uid; -gid_t gid; -int mode; +void perm(char *prefix1, char *prefix2, char *prefix3, char *file, int type, + uid_t uid, gid_t gid, int mode) { struct stat st; @@ -44,46 +37,26 @@ int mode; strerr_warn6(WARNING,prefix1,prefix2,prefix3,file," has wrong type",0); } -void h(home,uid,gid,mode) -char *home; -uid_t uid; -gid_t gid; -int mode; +void h(char *home, uid_t uid, gid_t gid, int mode) { perm("","","",home,S_IFDIR,uid,gid,mode); } -void d(home,subdir,uid,gid,mode) -char *home; -char *subdir; -uid_t uid; -gid_t gid; -int mode; +void d(char *home, char *subdir, uid_t uid, gid_t gid, int mode) { if (chdir(home) == -1) strerr_die4sys(111,FATAL,"unable to switch to ",home,": "); perm("",home,"/",subdir,S_IFDIR,uid,gid,mode); } -void p(home,fifo,uid,gid,mode) -char *home; -char *fifo; -uid_t uid; -gid_t gid; -int mode; +void p(char *home, char *fifo, uid_t uid, gid_t gid, int mode) { if (chdir(home) == -1) strerr_die4sys(111,FATAL,"unable to switch to ",home,": "); perm("",home,"/",fifo,S_IFIFO,uid,gid,mode); } -void c(home,subdir,file,uid,gid,mode) -char *home; -char *subdir; -char *file; -uid_t uid; -gid_t gid; -int mode; +void c(char *home, char *subdir, char *file, uid_t uid, gid_t gid, int mode) { if (chdir(home) == -1) strerr_die4sys(111,FATAL,"unable to switch to ",home,": "); @@ -96,13 +69,7 @@ int mode; perm(".../",subdir,"/",file,S_IFREG,uid,gid,mode); } -void z(home,file,len,uid,gid,mode) -char *home; -char *file; -int len; -uid_t uid; -gid_t gid; -int mode; +void z(char *home, char *file, int len, uid_t uid, gid_t gid, int mode) { if (chdir(home) == -1) strerr_die4sys(111,FATAL,"unable to switch to ",home,": "); diff --git a/prot.c b/prot.c @@ -3,13 +3,13 @@ #include <grp.h> #include "prot.h" -int prot_gid(gid) gid_t gid; +int prot_gid(gid_t gid) { if (setgroups(1,&gid) == -1) return -1; return setgid(gid); /* _should_ be redundant, but on some systems it isn't */ } -int prot_uid(uid) uid_t uid; +int prot_uid(uid_t uid) { return setuid(uid); }