the terms of the BSD Licence as follows:
Copyright (C) 2005 Miklos Szeredi. All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
free(llopts);
if (f->se == NULL)
goto out_free;
-
+
ch = fuse_kern_chan_new(fd);
if (ch == NULL)
goto out_free_session;
-
+
fuse_session_add_chan(f->se, ch);
f->ctr = 0;
case FUSE_INIT:
do_init(req, (struct fuse_init_in_out *) inarg);
break;
-
+
case FUSE_LOOKUP:
do_lookup(req, in->nodeid, (char *) inarg);
break;
}
-struct fuse_session *fuse_lowlevel_new(const char *opts,
+struct fuse_session *fuse_lowlevel_new(const char *opts,
const struct fuse_lowlevel_ops *op,
size_t op_size, void *userdata)
{
struct procdata *pd = (struct procdata *) fuse_chan_data(ch);
assert(size >= sizeof(cmd));
-
+
cmd = fuse_read_cmd(pd->f);
if (cmd == NULL)
return 0;
-
+
*(struct fuse_cmd **) buf = cmd;
-
+
return sizeof(cmd);
}
struct fuse_session_ops op;
void *data;
-
+
volatile int exited;
struct fuse_chan *ch;
int fd;
size_t bufsize;
-
+
void *data;
};
return se->exited;
}
-struct fuse_chan *fuse_chan_new(struct fuse_chan_ops *op, int fd,
+struct fuse_chan *fuse_chan_new(struct fuse_chan_ops *op, int fd,
size_t bufsize, void *data)
{
struct fuse_chan *ch = (struct fuse_chan *) malloc(sizeof(*ch));
res = create_file(testfile, testdata2, testdata2len);
if (res == -1)
return -1;
-
+
currlen = testdata2len;
}
-
+
fd = open(testfile, flags, mode);
if ((flags & O_CREAT) && (flags & O_EXCL) && exist) {
if (fd != -1) {
if (flags & O_TRUNC)
currlen = 0;
-
+
err += check_type(testfile, S_IFREG);
if (exist)
err += check_mode(testfile, 0644);
else
- err += check_mode(testfile, mode);
+ err += check_mode(testfile, mode);
err += check_nlink(testfile, 1);
err += check_size(testfile, currlen);
if (exist && !(flags & O_TRUNC) && (mode & 0400))
currlen = datalen;
err += check_size(testfile, currlen);
-
+
if (mode & 0400) {
err += check_data(testfile, data, 0, datalen);
if (exist && !(flags & O_TRUNC) && testdata2len > datalen)
PERROR("chmod");
return -1;
}
-
+
res = check_mode(testfile, mode);
if (res == -1)
return -1;
}
basepath = argv[1];
assert(strlen(basepath) < 512);
-
+
sprintf(testfile, "%s/testfile", basepath);
sprintf(testfile2, "%s/testfile2", basepath);
sprintf(testdir, "%s/testdir", basepath);
err += test_open_acc(O_RDONLY, 0000, EACCES);
err += test_open_acc(O_WRONLY, 0000, EACCES);
err += test_open_acc(O_RDWR, 0000, EACCES);
-
+
unlink(testfile);
unlink(testfile2);
rmdir(testdir);
strcmp(p + 5, user) == 0)
removed = 1;
/* /etc/mtab is a link pointing to /proc/mounts: */
- else if ((p = strstr(entp->mnt_opts, "user_id=")) &&
+ else if ((p = strstr(entp->mnt_opts, "user_id=")) &&
(p == entp->mnt_opts || *(p-1) == ',') &&
strncmp(p + 8, uidstr, uidlen) == 0 &&
(*(p+8+uidlen) == ',' || *(p+8+uidlen) == '\0'))