/* Bypass Copyright (C) 1999-2001 Douglas Thain http://www.cs.wisc.edu/condor/bypass This program is released under a BSD License. See the file COPYING for details. */ /* This example is nearly identical to io.bypass, except that it contains logic by which one may control access to files outside of the current directory. */ int open( in string const char *path, int flags, [int mode] ) agent_action {{ return bypass_shadow_open((char*)path,flags,mode); }} shadow_action {{ if(strchr(path,'/')) { printf("DENIED: agent tried to open %s\n",path); errno = EPERM; return -1; } else { printf("NOTICE: agent opened %s\n",path); return open(path,flags,mode); } }}; int close( int fd ); ssize_t read( int fd, out opaque "length" void *data, size_t length ); ssize_t write( int fd, in opaque "length" const void *data, size_t length ); off_t lseek( int fd, off_t where, int whence ); int stat( in string const char *path, out struct stat *s ); int fstat( int fd, out struct stat *s ); int lstat( in string const char *path, out struct stat *s );