A question about fileaccess.cfg.

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 098.

Moderator: POL Developer

Post Reply
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

A question about fileaccess.cfg.

Post by Yukiko »

I have written an eScript program that scans through the entire POL file structure, loads itemdesc.cfg files and performs various functions on each file and then outputs a new renamed version of the file in a special directory named "info". So to do this I need to tell POL to allow my program to have access to be able to read and write files globally. My program resides in the "commands" package in the "test" command level directory. I was able to accomplish this but I had to set the "Package" property to the wildcard (*) character. Here is what my fileaccess.cfg looks like:

Code: Select all

# $Id: fileaccess.cfg 872 2006-10-10 02:00:34Z austinheilman $
#
# Purpose:
# Specifies what packages have file read/write/append access.
#
# Structure:
#
# FileAccess
# {
#   [Package (string package name, or *)]...
#   [Directory (string directory name, or *)]...
#   [Extension (string file extension name, or *)]...
#   [AllowRead (0/1 {default 0})]
#   [AllowWrite (0/1 {default 0})]
#   [AllowAppend (0/1 {default 0})]
#   [AllowRemote (0/1 {default 0})]
# }
#
#Explanation:
# '*' above means it applies to all packages.
# AllowRemote means the package has access to other files, not just files in its package directory.
# Package matches the string name in a pkg.cfg. You can define multiple Package properties.
# Directory not implimented yet
# Extension examples are '.cfg', '.htm', etc. You can define multiple Extension properties.
# This config is reloadable on-demand. Use ReloadConfiguration() (polsys.em) or SIGHUP under linux.
##

// Everything may log stuff
FileAccess LogFiles
{
	Package		*
	Extension	.log
	AllowRead	1
	AllowRemote	1
	AllowWrite	1
	AllowAppend	1
}

// Everything can READ a config file.
FileAccess ReadConfigFiles
{
	Package		*
	Extension	.cfg
	AllowRead	1
	AllowRemote	1
	AllowWrite	0
	AllowAppend	0
}

// MOTD package has access to read its motd.txt file.
FileAccess MOTD
{
	Package		motd
	Extension	.txt
	AllowRead	1
}

// Help package can read any .txt file inside of it.
FileAccess Help
{
	Package		Help
	Extension	.txt
	AllowRead	1
}

// commands package has access to read and write to files defined below.
FileAccess commands
{
	Package		*
	Extension	.txt
	Extension	.cfg
	AllowRead	1
	AllowRemote	1
	AllowWrite	1
	AllowAppend	1
}

If I change the "Package" value for the commands file access to "commands" rather than "*" my program cannot write the files to the "info" directory. The odd thing is it can create the "info" directory though. If I set the "Package" value to "*" everything works as it should. I want to have a secure server and not give universal read/write access to every package. Any ideas why I can't restrict this to just the programs in the "commands" package?
Post Reply