/
LIB3/
LIB3/D/ADMIN/
LIB3/D/ADMIN/OBJ/
LIB3/D/ADMIN/ROOM/W/
LIB3/D/HOME/
LIB3/D/HOME/CITY/ARENA/
LIB3/D/HOME/CITY/ITEMS/
LIB3/D/HOME/CITY/POSTOFFI/
LIB3/DOC/
LIB3/GLOBAL/SPECIAL/
LIB3/GLOBAL/VIRTUAL/
LIB3/NET/
LIB3/NET/CONFIG/
LIB3/NET/DAEMON/CHARS/
LIB3/NET/GOPHER/
LIB3/NET/INHERIT/
LIB3/NET/OBJ/
LIB3/NET/SAVE/
LIB3/NET/VIRTUAL/
LIB3/OBJ/B_DAY/
LIB3/OBJ/HANDLERS/TERM_TYP/
LIB3/PLAYERS/B/
LIB3/PLAYERS/N/
LIB3/ROOM/
LIB3/SAVE/
LIB3/SAVE/BOARDS/
LIB3/SAVE/ENVIRON/
LIB3/SAVE/POST/
LIB3/STD/COMMANDS/SHADOWS/
LIB3/STD/CREATOR/
LIB3/STD/DOM/
LIB3/STD/EFFECTS/
LIB3/STD/EFFECTS/HEALING/
LIB3/STD/EFFECTS/OTHER/
LIB3/STD/EFFECTS/POISONS/
LIB3/STD/ENVIRON/
LIB3/STD/GUILDS/
LIB3/STD/LIQUIDS/
LIB3/STD/ROOM/
LIB3/STD/TRIGGER/SHADOW/
LIB3/W/
LIB3/W/BANNOR/
LIB3/W/NEWSTYLE/
/* /secure/master/valid_read.c */
/*
 * Read permisions for all of the objects in the game.
 * This IS fun.
 */
int     valid_read( string path, mixed euid, string func )
{
    string *bing;
    string  master;

    if( objectp( euid ) )
	euid = geteuid( euid );

#ifdef 0
    if( query_lord( euid ) || high_programmer( euid ) )
	return 1;
#endif

    if( high_programmer( euid ) != 0 )
	return 1;
    bing = explode( path, "/" );
    if( bing )
	bing = bing - ({ "", "." });
    else
	return 1;
    if( !sizeof( bing ) )
	return 1;

    if( euid == "tmp" )
    {
	return bing[ 0 ] == "tmp";
    }

    if( query_lord( euid ) )
    {
	/* let lords read anything execpt /save/post */
	if( sizeof( bing ) > 1 )
	{
	    if( (bing[ 0 ] == "save") && (bing[ 1 ] == "post") )
		return 0;
	    else
		return 1;
	}
	return 1;
    }

    if( check_permission( euid, bing, READ_MASK ) )
	return 1;
    switch( bing[ 0 ] )
    {
	case "players":
	    return( sizeof( bing ) < 3 ) || check_permission( euid, bing, READ_MASK );
	case "ims":
	    return( euid == "ims" ) || check_permission( euid, bing, READ_MASK );
	case "d":
	case "w":
	    if( sizeof( bing ) >= 2 )
	    {
		if( (bing[ 0 ] == "w" ? bing[ 1 ] : capitalize( bing[ 1 ] )) == euid )
		    return 1;
/* /w/bingle/secure/ check added by Newstyle, 08/03/94 */
		if( sizeof( bing ) >= 3 )
		    if( bing[ 2 ] == "secure" )
			return bing[ 1 ] == euid;
		master = bing[ 0 ] + "/" + bing[ 1 ] + "/master";
		if( !find_object( master ) && !checked_master[ master ]
/* File_size check added by Newstyle, 22/12/93. Merry Xmas. */
			&& (file_size( master + ".c" ) == -1 || catch( master->dead_frogs() )) )
		{
		    checked_master[ master ] = 1;
		    return 1;
		}
		if( checked_master[ master ] )
		    return 1;
		return( int ) master->valid_read( bing, euid, func );
	    }
	    return 1;
	case "save":
	    if( sizeof( bing ) >= 2 && bing[ 1 ] == "post" )
	    {
		return( euid == "mailer" );
	    }
	    return( euid == "Room" );
    }
    return 1;
}				/* valid_read() */