diff options
Diffstat (limited to 'install.c')
| -rw-r--r-- | install.c | 37 |
1 files changed, 6 insertions, 31 deletions
| @@ -1,5 +1,6 @@ | |||
| 1 | #include <sys/stat.h> | 1 | #include <sys/stat.h> |
| 2 | #include <unistd.h> | 2 | #include <unistd.h> |
| 3 | #include "install.h" | ||
| 3 | #include "substdio.h" | 4 | #include "substdio.h" |
| 4 | #include "strerr.h" | 5 | #include "strerr.h" |
| 5 | #include "error.h" | 6 | #include "error.h" |
| @@ -13,11 +14,7 @@ extern void hier(); | |||
| 13 | 14 | ||
| 14 | int fdsourcedir = -1; | 15 | int fdsourcedir = -1; |
| 15 | 16 | ||
| 16 | void h(home,uid,gid,mode) | 17 | void h(const char *home, uid_t uid, gid_t gid, mode_t mode) |
| 17 | char *home; | ||
| 18 | int uid; | ||
| 19 | int gid; | ||
| 20 | int mode; | ||
| 21 | { | 18 | { |
| 22 | if (mkdir(home,0700) == -1) | 19 | if (mkdir(home,0700) == -1) |
| 23 | if (errno != error_exist) | 20 | if (errno != error_exist) |
| @@ -28,12 +25,7 @@ int mode; | |||
| 28 | strerr_die4sys(111,FATAL,"unable to chmod ",home,": "); | 25 | strerr_die4sys(111,FATAL,"unable to chmod ",home,": "); |
| 29 | } | 26 | } |
| 30 | 27 | ||
| 31 | void d(home,subdir,uid,gid,mode) | 28 | void d(const char *home, const char *subdir, uid_t uid, gid_t gid, mode_t mode) |
| 32 | char *home; | ||
| 33 | char *subdir; | ||
| 34 | int uid; | ||
| 35 | int gid; | ||
| 36 | int mode; | ||
| 37 | { | 29 | { |
| 38 | if (chdir(home) == -1) | 30 | if (chdir(home) == -1) |
| 39 | strerr_die4sys(111,FATAL,"unable to switch to ",home,": "); | 31 | strerr_die4sys(111,FATAL,"unable to switch to ",home,": "); |
| @@ -46,12 +38,7 @@ int mode; | |||
| 46 | strerr_die6sys(111,FATAL,"unable to chmod ",home,"/",subdir,": "); | 38 | strerr_die6sys(111,FATAL,"unable to chmod ",home,"/",subdir,": "); |
| 47 | } | 39 | } |
| 48 | 40 | ||
| 49 | void p(home,fifo,uid,gid,mode) | 41 | void p(const char *home, const char *fifo, uid_t uid, gid_t gid, mode_t mode) |
| 50 | char *home; | ||
| 51 | char *fifo; | ||
| 52 | int uid; | ||
| 53 | int gid; | ||
| 54 | int mode; | ||
| 55 | { | 42 | { |
| 56 | if (chdir(home) == -1) | 43 | if (chdir(home) == -1) |
| 57 | strerr_die4sys(111,FATAL,"unable to switch to ",home,": "); | 44 | strerr_die4sys(111,FATAL,"unable to switch to ",home,": "); |
| @@ -69,13 +56,7 @@ char outbuf[SUBSTDIO_OUTSIZE]; | |||
| 69 | substdio ssin; | 56 | substdio ssin; |
| 70 | substdio ssout; | 57 | substdio ssout; |
| 71 | 58 | ||
| 72 | void c(home,subdir,file,uid,gid,mode) | 59 | void c(const char *home, const char *subdir, const char *file, uid_t uid, gid_t gid, mode_t mode) |
| 73 | char *home; | ||
| 74 | char *subdir; | ||
| 75 | char *file; | ||
| 76 | int uid; | ||
| 77 | int gid; | ||
| 78 | int mode; | ||
| 79 | { | 60 | { |
| 80 | int fdin; | 61 | int fdin; |
| 81 | int fdout; | 62 | int fdout; |
| @@ -119,13 +100,7 @@ int mode; | |||
| 119 | strerr_die6sys(111,FATAL,"unable to chmod .../",subdir,"/",file,": "); | 100 | strerr_die6sys(111,FATAL,"unable to chmod .../",subdir,"/",file,": "); |
| 120 | } | 101 | } |
| 121 | 102 | ||
| 122 | void z(home,file,len,uid,gid,mode) | 103 | void z(const char *home, const char *file, size_t len, uid_t uid, gid_t gid, mode_t mode) |
| 123 | char *home; | ||
| 124 | char *file; | ||
| 125 | int len; | ||
| 126 | int uid; | ||
| 127 | int gid; | ||
| 128 | int mode; | ||
| 129 | { | 104 | { |
| 130 | int fdout; | 105 | int fdout; |
| 131 | 106 | ||
