Ejemplo n.º 1
0
object compile_object(string path, string code ...) {
   argcheck(path, 1, "string");

   if (!KERNEL() && !SYSTEM() ) {
#ifdef SECURITY_COMPILER_RW
      if (!valid_write(path)) {
         error("Permission denied.");
      }
#endif

      if (code && sizeof(code)) {
         if (!valid_write(path)) {
	    error("Permission denied");
         }
      } else {
         if (!valid_read(path)) {
	     error("Permission denied");
         }
      }
   }

   if (strlen(path) > 2) {
      if (path[strlen(path) - 2] == '.' && path[strlen(path) - 1] == 'c')
	 path = path[..strlen(path) - 3];
   }
   if (find_object(COMPILER_D)) {
      path = COMPILER_D->allow_object(path);
   }
   if (code && sizeof(code)) {
      return driver->compile_object(path, code...);
   } else {
      return driver->compile_object(path);
   }
}
Ejemplo n.º 2
0
nomask varargs int set( string label, mixed value, int access_level ) {
        if( !ob_data ) init_ob();
        if( !label ) return 0;
     while( label[0] == '/' && strlen(label) > 1 )
	label = label[1..<1];
#ifdef SECURE
#if 0
        if( !valid_write( label, previous_object() ) ) return 0;
#else
        if (origin() != ORIGIN_LOCAL &&
              !valid_write(label, previous_object()))
            return 0;
#endif
#endif /* SECURE */
        _set( ob_data, strsrch(label,"/")!=-1?explode(label,"/"):({label}), value );