Example #1
0
int creat(const char *pathname, mode_t mode) {
	if(!real_creat)
		real_creat = dlsym(RTLD_NEXT, "creat");

	int ret = real_creat(pathname, mode);
	logdir(pathname, ret);
	return ret;
}
Example #2
0
int creat(const char *pathname, mode_t mode) {
    static int (*real_creat)(const char*, mode_t) = NULL;
    if (!real_creat) real_creat = dlsym(RTLD_NEXT, "creat");

    if (!allowed(pathname, O_CREAT)) {
        return -1;
    }

    return real_creat(pathname, mode);
}
Example #3
0
File: jail.c Project: guoyu07/jff
int creat(const char *pathname, mode_t mode)
{
    DBG("pathname=%s, mode=%d\n", pathname, mode);

    if (check_perm(pathname, RESTRICTED_ALLOW_OPEN_WRITE_ENV,
                   &patterns_open_write))
        return -1;

    return real_creat(pathname, mode);
}