change ownership and access of file
| 140 | |
| 141 | // change ownership and access of file |
| 142 | void changeFileRights(const char* pathname, const mode_t mode) |
| 143 | { |
| 144 | uid_t uid = geteuid() == 0 ? get_user_id(FIREBIRD) : -1; |
| 145 | gid_t gid = get_user_group_id(FIREBIRD); |
| 146 | while (chown(pathname, uid, gid) < 0 && SYSCALL_INTERRUPTED(errno)) |
| 147 | ; |
| 148 | |
| 149 | while (chmod(pathname, mode) < 0 && SYSCALL_INTERRUPTED(errno)) |
| 150 | ; |
| 151 | } |
| 152 | |
| 153 | inline int openFile(const char* pathname, int flags, mode_t mode = 0666) |
| 154 | { |
no test coverage detected