1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | #include <fcntl.h> |
24 | |
25 | #include "usermux.h" |
26 |
|
27 | |
28 | |
29 | |
30 | void |
31 | netfs_node_norefs (struct node *node) |
32 | { |
33 | if (node->nn->name) |
34 | |
35 | |
36 | node->nn->name->node = 0; |
37 | if (node->nn->trans_len > 0) |
38 | free (node->nn->trans); |
39 | free (node->nn); |
40 | free (node); |
41 | } |
42 |
|
43 | |
44 | |
45 | |
46 | error_t |
47 | netfs_attempt_create_file (struct iouser *user, struct node *dir, |
48 | char *name, mode_t mode, struct node **node) |
49 | { |
50 | *node = 0; |
51 | pthread_mutex_unlock (&dir->lock); |
52 | return EOPNOTSUPP((0x10 << 26) | ((45) & 0x3fff)); |
53 | } |
54 | |
55 | |
56 | |
57 | |
58 | error_t |
59 | netfs_check_open_permissions (struct iouser *user, struct node *node, |
60 | int flags, int newnode) |
61 | { |
62 | error_t err = 0; |
63 | if (flags & O_READ0x0001) |
64 | err = fshelp_access (&node->nn_stat, S_IREAD00400, user); |
65 | if (!err && (flags & O_WRITE0x0002)) |
66 | err = fshelp_access (&node->nn_stat, S_IWRITE00200, user); |
67 | if (!err && (flags & O_EXEC0x0004)) |
68 | err = fshelp_access (&node->nn_stat, S_IEXEC00100, user); |
69 | return err; |
70 | } |
71 | |
72 | |
73 | |
74 | error_t |
75 | netfs_attempt_utimes (struct iouser *cred, struct node *node, |
76 | struct timespec *atime, struct timespec *mtime) |
77 | { |
78 | error_t err = fshelp_isowner (&node->nn_stat, cred); |
79 | int flags = TOUCH_CTIME0x4; |
80 | |
81 | if (! err) |
82 | { |
83 | if (mtime) |
84 | node->nn_stat.st_mtim = *mtime; |
85 | else |
86 | flags |= TOUCH_MTIME0x2; |
87 | |
88 | if (atime) |
89 | node->nn_stat.st_atim = *atime; |
90 | else |
91 | flags |= TOUCH_ATIME0x1; |
| Value stored to 'flags' is never read |
92 | |
93 | fshelp_touch (&node->nn_stat, TOUCH_CTIME0x4, usermux_maptime); |
94 | } |
95 | return err; |
96 | } |
97 | |
98 | |
99 | |
100 | error_t |
101 | netfs_report_access (struct iouser *cred, struct node *node, int *types) |
102 | { |
103 | *types = 0; |
104 | if (fshelp_access (&node->nn_stat, S_IREAD00400, cred) == 0) |
105 | *types |= O_READ0x0001; |
106 | if (fshelp_access (&node->nn_stat, S_IWRITE00200, cred) == 0) |
107 | *types |= O_WRITE0x0002; |
108 | if (fshelp_access (&node->nn_stat, S_IEXEC00100, cred) == 0) |
109 | *types |= O_EXEC0x0004; |
110 | return 0; |
111 | } |
112 | |
113 | |
114 | |
115 | |
116 | |
117 | error_t |
118 | netfs_validate_stat (struct node *node, struct iouser *cred) |
119 | { |
120 | return 0; |
121 | } |
122 | |
123 | |
124 | |
125 | error_t |
126 | netfs_attempt_sync (struct iouser *cred, struct node *node, int wait) |
127 | { |
128 | return 0; |
129 | } |