MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / changeFileRights

Function changeFileRights

src/common/os/posix/os_utils.cpp:142–151  ·  view source on GitHub ↗

change ownership and access of file

Source from the content-addressed store, hash-verified

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 {

Callers 2

createLockDirectoryFunction · 0.85
openCreateSharedFileFunction · 0.85

Calls 2

get_user_idFunction · 0.70
get_user_group_idFunction · 0.70

Tested by

no test coverage detected