source:
trunk/debathena/debathena/pyhesiodfs/debian/patches/no-hello.patch
@
23260
Revision 23260, 2.9 KB checked in by broder, 16 years ago (diff) |
---|
-
debathena-pyhesiodfs-0.0.r162
old new 69 69 70 70 fuse.fuse_python_api = (0, 2) 71 71 72 hello_path = '/README.txt'73 hello_str = """This is the pyhesiodfs FUSE autmounter. To access a Hesiod filsys, just access74 %(mountpoint)s/name.75 76 If you're using the Finder, try pressing Cmd+Shift+G and then entering77 %(mountpoint)s/name"""78 79 72 if not hasattr(fuse, 'Stat'): 80 73 fuse.Stat = object 81 74 … … 128 121 if path == '/': 129 122 st.st_mode = stat.S_IFDIR | 0777 130 123 st.st_nlink = 2 131 elif path == hello_path:132 st.st_mode = stat.S_IFREG | 0444133 st.st_nlink = 1134 st.st_size = len(hello_str)135 124 elif '/' not in path[1:]: 136 125 if path[1:] not in self.negcache and self.findLocker(path[1:]): 137 126 st.st_mode = stat.S_IFLNK | 0777 … … 178 167 return None 179 168 180 169 def getdir(self, path): 181 return [(i, 0) for i in (['.', '..' , hello_path[1:]] + self.getCachedLockers())]170 return [(i, 0) for i in (['.', '..'] + self.getCachedLockers())] 182 171 183 172 def readdir(self, path, offset): 184 173 for (r, zero) in self.getdir(path): … … 187 176 def readlink(self, path): 188 177 return self.findLocker(path[1:]) 189 178 190 def open(self, path, flags):191 if path != hello_path:192 return -errno.ENOENT193 accmode = os.O_RDONLY | os.O_WRONLY | os.O_RDWR194 if (flags & accmode) != os.O_RDONLY:195 return -errno.EACCES196 197 def read(self, path, size, offset):198 if path != hello_path:199 return -errno.ENOENT200 slen = len(hello_str)201 if offset < slen:202 if offset + size > slen:203 size = slen - offset204 buf = hello_str[offset:offset+size]205 else:206 buf = ''207 return buf208 209 179 def symlink(self, src, path): 210 if path == '/' or path == hello_path:180 if path == '/': 211 181 return -errno.EPERM 212 182 elif '/' not in path[1:]: 213 183 self.mounts[self._user()][path[1:]] = src … … 217 187 return -errno.EPERM 218 188 219 189 def unlink(self, path): 220 if path == '/' or path == hello_path:190 if path == '/': 221 191 return -errno.EPERM 222 192 elif '/' not in path[1:]: 223 193 del self.mounts[self._user()][path[1:]] … … 226 196 return -errno.EPERM 227 197 228 198 def main(): 229 global hello_str230 199 try: 231 200 usage = Fuse.fusage 232 201 server = PyHesiodFS(version="%prog " + fuse.__version__, … … 242 211 sys.argv.pop(1) 243 212 server = PyHesiodFS() 244 213 245 hello_str = hello_str % {'mountpoint': server.parse(errex=1).mountpoint}246 214 server.main() 247 215 248 216 if __name__ == '__main__':
Note: See TracBrowser
for help on using the repository browser.