Interchange

CVS log for interchange/lib/Vend/File.pm

[BACK] Up to [Local Repository] / interchange / lib / Vend

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 2.28.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 10 05:55:09 2008 UTC (8 weeks, 2 days ago) by jon
Branches: STABLE_5_6-branch
CVS tags: REL_5_6_1, DEB_5_6_1_2
Diff to: previous 2.28: preferred, colored; next MAIN 2.29: preferred, colored
Changes since revision 2.28: +3 -8 lines
Correct logic flaw that applied UTF-8 handling in some cases where it shouldn't have.

Fixed by David Christensen <david@endpoint.com>.

Revision 2.29: download - view: text, markup, annotated - select for diffs
Mon Nov 10 05:52:57 2008 UTC (8 weeks, 2 days ago) by jon
Branches: MAIN
CVS tags: REL_5_7_1, HEAD
Diff to: previous 2.28: preferred, colored
Changes since revision 2.28: +3 -8 lines
Correct logic flaw that applied UTF-8 handling in some cases where it shouldn't have.

Fixed by David Christensen <david@endpoint.com>.

Revision 2.28: download - view: text, markup, annotated - select for diffs
Tue Mar 25 17:13:21 2008 UTC (9 months, 2 weeks ago) by jon
Branches: MAIN
CVS tags: STABLE_5_6-root, REL_5_5_3, REL_5_5_2
Branch point for: STABLE_5_6-branch
Diff to: previous 2.27: preferred, colored
Changes since revision 2.27: +3 -3 lines
Various minor UTF-8 changes.

Correct attribution of &Vend::CharSet::display_chars (which is from
perluniintro manpage).

Enable localization of an error string.

Match content type more tightly in 2 spots ("text" is only trustworthy
in the MIME major type, not minor, and even that may be a stretch).

Simplify request method matching in a few places for readability and a
(trivial) performance benefit.

Use conventional $c lexical instead of $g for catalog hashref.

Fix tab/space differences to match context.

Update copyrights of files changed in 2008.

Revision 2.27: download - view: text, markup, annotated - select for diffs
Tue Mar 25 10:17:18 2008 UTC (9 months, 2 weeks ago) by kwalsh
Branches: MAIN
Diff to: previous 2.26: preferred, colored
Changes since revision 2.26: +14 -2 lines
    * Committing Sonny Cook's UTF-8 patches, along with a fix for the
      PreFork issue caused by the patches.  Thanks, Sonny!

    * From Sonny's original article on interchange-core:

	There are two variables that will need to be added to your
	catalog.cfg:  MV_HTTP_CHARSET and MV_UTF8.  They should be set
	like so:

	    Variable MV_HTTP_CHARSET UTF-8
	    Variable MV_UTF8         1

	The MV_UTF8 variable tells the system that we are using UTF-8
	for stuff internally when that needs to be specified.  Perl mostly
	does the right thing wrt UTF-8, but when we need to explicitly
	specify for one of a handful of reasons, this variable lets us
	configure that.

	The MV_HTTP_CHARSET specifies which character set that the web
	pages are going to be encoded with.  UTF-8 is the only value that
	has been tested at the moment, although it probably generalises
	to whatever you would like to use.

	Communication with the database introduces three database
	directives.  These are required to ensure that data is properly
	communicated with the database:

	    PG_ENABLE_UTF8
	    MYSQL_ENABLE_UTF8
	    GDBM_ENABLE_UTF8

	These can be set on a table by table basis or with DatabaseDefault.
	You will probably want to set the one for the sql database you are
	using and one for GDBM, like so:

	    DatabaseDefault PG_ENABLE_UTF8 1
	    DatabaseDefault GDBM_ENABLE_UTF8 1

	You will need to make sure that your database is encoded in UTF-8
	and that all of your data is encoded that way as well.

	Enabling UTF-8 should not cause any problems if your data is all in
	US-ASCII, but might cause problems if other encodings are involved.

    * Note: This commit is missing the latest safeuntrap/reval/safetrap
      code, which should be added ASAP.  In the meantime, the following
      works in the interchange.cfg file (with Perl 5.8.8):

	SafeUntrap  rand require caller dofile print

Revision 2.26: download - view: text, markup, annotated - select for diffs
Thu Jan 24 22:11:13 2008 UTC (11 months, 2 weeks ago) by kwalsh
Branches: MAIN
Diff to: previous 2.25: preferred, colored
Changes since revision 2.25: +3 -6 lines
    * Allow [include] et. al. to scan the local TemplateDir as well as the
      global version.  I don't see any security issues.  As most users will
      reference the file directly, the extra directory scan overhead should
      not effect a lot of setups.

Revision 2.25: download - view: text, markup, annotated - select for diffs
Thu Aug 9 13:40:53 2007 UTC (17 months ago) by pajamian
Branches: MAIN
CVS tags: REL_5_5_1, DEB_5_5_1_1_1, DEB_5_5_1
Diff to: previous 2.24: preferred, colored
Changes since revision 2.24: +3 -3 lines
* Updated copyright headers to 2007 (closes bug #102)

* Added GPL and copyright headers to a few files that were missing them.

Revision 2.21.2.1: download - view: text, markup, annotated - select for diffs
Fri Mar 30 12:15:27 2007 UTC (21 months, 1 week ago) by pajamian
Branches: STABLE_5_4-branch
CVS tags: REL_5_4_3
Diff to: previous 2.21: preferred, colored; next MAIN 2.22: preferred, colored
Changes since revision 2.21: +4 -4 lines
New Free Software Foundation Address in headers of various files

Revision 2.24: download - view: text, markup, annotated - select for diffs
Fri Mar 30 11:39:45 2007 UTC (21 months, 1 week ago) by pajamian
Branches: MAIN
Diff to: previous 2.23: preferred, colored
Changes since revision 2.23: +4 -4 lines
New Free Software Foundation Address in headers of various files

Revision 2.23: download - view: text, markup, annotated - select for diffs
Tue Jan 30 19:23:28 2007 UTC (23 months, 1 week ago) by jon
Branches: MAIN
Diff to: previous 2.22: preferred, colored
Changes since revision 2.22: +13 -2 lines
Add make_absolute_file routine. Kind of important since my commit of
Require PerlInclude yesterday depends on it.

Revision 2.22: download - view: text, markup, annotated - select for diffs
Wed Apr 5 14:42:19 2006 UTC (2 years, 9 months ago) by mheins
Branches: MAIN
Diff to: previous 2.21: preferred, colored
Changes since revision 2.21: +3 -3 lines
* Add lockout to list of SpecialSub routines allowed.

* If user-configured lockout routine returns true, it replaces the
  current routine completely. If it returns false, the normal one
  is run as well.

* Move the logging out of Vend::Dispatch to the do_lockout routine, so
  that you can avoid the log entry if your user-configured routine handles
  the lockout.

* Make the number of seconds for robot reset adjustable from its
  current hardcoded 30:

  	Limit   lockout_reset_seconds

  Maybe that should be robot_reset_seconds, I don't know.

* Change use of $Vend::Cfg->{Limit}{member} to $::Limit->{member}. As
  Limit is used in iterative routines like chain_cost, this should
  improve performance.

Revision 2.21: download - view: text, markup, annotated - select for diffs
Tue Nov 8 18:14:45 2005 UTC (3 years, 2 months ago) by jon
Branches: MAIN
CVS tags: STABLE_5_4-root, REL_5_4_2, REL_5_4_1, REL_5_4_0, REL_5_3_3, REL_5_3_2
Branch point for: STABLE_5_4-branch
Diff to: previous 2.20: preferred, colored
Changes since revision 2.20: +3 -3 lines
Big copyright and version number update to prepare for 5.3.2 release.

Revision 2.20: download - view: text, markup, annotated - select for diffs
Sun May 1 15:41:26 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
CVS tags: DEB_5_3_0_20051028_1, DEB_5_3_0_20051004_1
Diff to: previous 2.19: preferred, colored
Changes since revision 2.19: +3 -2 lines
* Remove dependency on UserTag having File::Copy use

Revision 2.19: download - view: text, markup, annotated - select for diffs
Sun May 1 15:38:24 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.18: preferred, colored
Changes since revision 2.18: +3 -2 lines
* Remove dependency on a usertag containing "use File::Path".

Revision 2.18: download - view: text, markup, annotated - select for diffs
Sat Apr 30 15:09:58 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.17: preferred, colored
Changes since revision 2.17: +3 -3 lines
* We had been running without warnings so long, we had gotten a bit sloppy
  in our code in some places.

  Because we do lots of uninitialized hash member stuff with arrays
  of fields and $opt, it is basically unreasonable for us to run with
  the "use of uninitialized variable" warnings. Because we do a fair
  amount of numerical comparisons on empty string values, it seemed
  unreasonable to run with "string value in numeric gt" enabled.

  Also, because Safe, HTML::Entities, and some other modules have
  these checks enabled, page code is bound to have warnings issued
  no matter what you do.

  It seems better to run with some warnings enabled so that we can
  catch bad code practice.

  So I have made the code run without warnings prior to and after
  interpolate_html(), and turned off warnings by default in the
  page code.

  If it is desirable to turn on warnings for pages, you can use
  [pragma perl_warnings_in_page] and see warnings for that page
  (or by default if you put in catalog.cfg).

* In general these changes are:

	 no warnings qw(uninitialized numeric);

  in most pages.

* Add $::Pragma->{perl_warnings_in_page}.

* Remove defined checks when simple set tests will do.

* Streamline some code.

Revision 2.17: download - view: text, markup, annotated - select for diffs
Wed Apr 27 19:26:39 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.16: preferred, colored
Changes since revision 2.16: +3 -3 lines
* Prevent warning on uninitialized variable.

Revision 2.16: download - view: text, markup, annotated - select for diffs
Sun Apr 10 13:36:34 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.15: preferred, colored
Changes since revision 2.15: +3 -3 lines
* Close minor hole where admin could request /usr/local/interchange/etc/../../../*
  for read.

Revision 2.15: download - view: text, markup, annotated - select for diffs
Sun Mar 6 04:14:08 2005 UTC (3 years, 10 months ago) by mheins
Branches: MAIN
Diff to: previous 2.14: preferred, colored
Changes since revision 2.14: +12 -3 lines

* Add "permanent more" feature so that you can create pageable searches
  that are shared between people and are cacheable by search engines.

* To activate, put in search URL/form:

	pm=1  or  mv_more_permanent=1

* To activate in [query ...], use pm=1.

* Changes hashing to two levels so that it will handle larger sets of
  searches.

* Depends on consistent spacing of queries, caches query for
  mv_cache_key that determines location. The change of a single
  bit of whitespace will change the key!

* When your data changes, a saved search could be wrong when referenced
  from a bookmark/saved link and no initializing search has been done.

* WARNING: Could generate very large file sets, watch your inodes!

Revision 2.14: download - view: text, markup, annotated - select for diffs
Wed Dec 3 17:04:26 2003 UTC (5 years, 1 month ago) by jon
Branches: MAIN
CVS tags: STABLE_5_2-root, STABLE_5_2-branch, STABLE_5_0-root, STABLE_5_0-branch, REL_5_2_1, REL_5_2_0, REL_5_1_1, REL_5_1_0, REL_5_0_2, REL_5_0_1, REL_5_0_0_RC2, REL_5_0_0_RC1, REL_5_0_0, DEB_5_2_1_1, DEB_5_0_0_2
Diff to: previous 2.13: preferred, colored
Changes since revision 2.13: +3 -3 lines
Make error message more specific.

Revision 2.13: download - view: text, markup, annotated - select for diffs
Mon Nov 24 21:09:00 2003 UTC (5 years, 1 month ago) by racke
Branches: MAIN
Diff to: previous 2.12: preferred, colored
Changes since revision 2.12: +3 -3 lines
Limit data part of Vend::File:writefile error message to 120 characters in
order to avoid disk abuse, resolve scalar references.

Revision 2.12: download - view: text, markup, annotated - select for diffs
Thu Nov 13 15:12:49 2003 UTC (5 years, 1 month ago) by racke
Branches: MAIN
Diff to: previous 2.11: preferred, colored
Changes since revision 2.11: +6 -3 lines
somehow mkpath stops the eval without leaving something in $@
in case of permissions problems - i suspect it's caused by the
croak invocation
verified with Perl 5.6.1

Revision 2.11: download - view: text, markup, annotated - select for diffs
Wed Jun 25 16:38:17 2003 UTC (5 years, 6 months ago) by mheins
Branches: MAIN
CVS tags: REL_4_9_9, DEB_4_9_8_20031014_1, DEB_4_9_8_20031010_1, DEB_4_9_8_20030911_1, DEB_4_9_8_20030706_1
Diff to: previous 2.10: preferred, colored
Changes since revision 2.10: +2 -18 lines
Various minor cleanup, prevents warnings on startup.

  * Remove extra meta_record routine and change references to
    UI::Primitive::meta_record to Vend::Table::Editor::meta_record.

  * Delete {Source} value from $Vend::Cfg to save memory.

  * Remove unused stub Vend::Data::dbref.

  * Change Vend::Util::dbref to be a simple pointer to
    Vend::Data::database_exists_ref. Remove extra "my $loc".

  * Remove improperly exported parse_locale routine from Vend::Util.
    (Another parse_locale in Vend::Config, and all calls in the code
     contain package reference.)

  * Update dont_warn() routine to only include need variables/handles.

  * Remove "prime" of sort routine in Vend::Search no longer necessary
    now that Perl 5.005 is not supported.

Revision 2.10: download - view: text, markup, annotated - select for diffs
Wed Jun 18 17:34:44 2003 UTC (5 years, 6 months ago) by jon
Branches: MAIN
CVS tags: REL_4_9_8, DEB_4_9_8_2
Diff to: previous 2.9: preferred, colored
Changes since revision 2.9: +4 -3 lines
The great copyright, email address, URL, and version update.

Revision 2.9: download - view: text, markup, annotated - select for diffs
Mon May 5 22:29:27 2003 UTC (5 years, 8 months ago) by racke
Branches: MAIN
Diff to: previous 2.8: preferred, colored
Changes since revision 2.8: +22 -6 lines
new function Vend::File::log_file_violation to avoid code duplication

Revision 2.8: download - view: text, markup, annotated - select for diffs
Thu Apr 10 14:16:02 2003 UTC (5 years, 9 months ago) by mheins
Branches: MAIN
Diff to: previous 2.7: preferred, colored
Changes since revision 2.7: +8 -3 lines

 * Allow read access for Vend::admin to $Global::RunDir. This allows
   reading the PID file and default location of access log.

Revision 2.7: download - view: text, markup, annotated - select for diffs
Sat Apr 5 08:43:05 2003 UTC (5 years, 9 months ago) by danb
Branches: MAIN
Diff to: previous 2.6: preferred, colored
Changes since revision 2.6: +4 -4 lines
 * Namespacing fix.

Revision 2.6: download - view: text, markup, annotated - select for diffs
Sat Apr 5 01:58:48 2003 UTC (5 years, 9 months ago) by mheins
Branches: MAIN
Diff to: previous 2.5: preferred, colored
Changes since revision 2.5: +15 -11 lines
Real changes for previous comment

Revision 2.5: download - view: text, markup, annotated - select for diffs
Sat Apr 5 01:58:02 2003 UTC (5 years, 9 months ago) by mheins
Branches: MAIN
Diff to: previous 2.4: preferred, colored
Changes since revision 2.4: +16 -18 lines

* Change calling target for subroutines to:

	$status = $sub->($actual_file, $FileControlPath, $write, @caller);

  This allows acl routines to check both the actual file being requested
  and the path being checked.

  So the original example is now:

	FileControl include/junk  <<EOR
	sub {
		my ($fn, $checkpath, $write, @caller) = @_;
		$fn =~ /foo/;
	}
	EOR

* Change these:

	>   # Check for $Scratch->{dealer} NOT set
	>   FileControl foo/bar ic_scratch_deny:dealer
	>
    >   # Check for $Session->{secure} NOT set
    >   FileControl foo/bar ic_session_deny:secure
    >

  To:

      # Check for $Scratch->{dealer} NOT set
      FileControl foo/bar ic_scratch:!dealer

      # Check for $Session->{secure} NOT set
      FileControl foo/bar ic_session:!secure

  Add:

      # Check for $Scratch->{dealer} eq "foo"
      FileControl foo/bar ic_scratch:dealer:foo

      # Check for $Scratch->{dealer} ne "foo"
      FileControl foo/bar ic_scratch:!dealer:foo

      # Check for $Session->{secure} eq "foo"
      FileControl foo/bar ic_session:secure:foo

      # Check for $Session->{secure} ne "foo"
      FileControl foo/bar ic_session:!secure:foo

* Add ability to pass permission for a directory from userdb.

    FileControl foo/bar/path ic_userdb

  Permission for either "foo/bar/path" or "foo/bar/path/filename" will
  allow access. If "foo/bar/path/filename" is set but not "r", then it will
  be denied even if "foo/bar/path" is allowed. In other words, a depth-first
  search is done both on the individual atom and the file itself.

  BUG:

      {
        'foo/bar/deep'              => 'rw',
        'foo/bar/deep/deeper'       => 'n',
        }

   will allow access to foo/bar/deep/deeper/somefile with

    FileControl  foo/bar/deep  ic_userdb

   In other words, all entries matching the parent path are
   not searched in the target ACL.

Revision 2.4: download - view: text, markup, annotated - select for diffs
Fri Apr 4 04:51:06 2003 UTC (5 years, 9 months ago) by mheins
Branches: MAIN
Diff to: previous 2.3: preferred, colored
Changes since revision 2.3: +85 -3 lines

* Add some intrinsic FileControl checks.

	# Is a catalog superuser
    FileControl foo/bar ic_super

	# Is a catalog admin
	FileControl foo/bar ic_admin

	# Is logged in at all
	FileControl foo/bar ic_logged

	# Is logged in at userdb table of "userdb"
	FileControl foo/bar ic_logged:userdb

	# Is logged in at userdb table of "affiliate"
	FileControl foo/bar ic_logged:affiliate

	# Run check on userdb file_acl
	FileControl foo/bar ic_userdb

	# Run check on userdb file_acl
	FileControl foo/bar ic_userdb:file_acl

	# Run check on userdb db_acl
	FileControl foo/bar ic_userdb:db_acl

	# Check for $Scratch->{dealer} set
    FileControl foo/bar ic_scratch:dealer

	# Check for $Scratch->{dealer} NOT set
    FileControl foo/bar ic_scratch_deny:dealer

	# Check for $Session->{secure} set
    FileControl foo/bar ic_session:secure

	# Check for $Session->{secure} NOT set
    FileControl foo/bar ic_session_deny:secure

  These don't override the NoAbsolute checks.

Revision 2.3: download - view: text, markup, annotated - select for diffs
Wed Apr 2 19:08:29 2003 UTC (5 years, 9 months ago) by mheins
Branches: MAIN
Diff to: previous 2.2: preferred, colored
Changes since revision 2.2: +41 -4 lines
* Created $Vend::File::errstr which is set to get the error message,
  otherwise defaults to the standard one.

* Add both global- and catalog-level FileControl directive that allows
  mapping subroutines (or named pre-existing subroutines) to a path.
  Does a depth-first search starting with the file name.

* In either interchange.cfg (takes priority) or catalog.cfg put:

	FileControl include/junk  <<EOR
	sub {
		my ($fn, $write, @caller) = @_;

		## Allow write to files containing "foo"
		if($write) {
			return $fn =~ /foo/;
		}

		## Allow read if file doesn't contain "bar"
		return $fn !~ /bar/;
	}
	EOR

* In either interchange.cfg (takes priority) or catalog.cfg put:

	FileControl  include/junk  some_sub

  This uses either Sub or GlobalSub

* Only in interchange.cfg, you can put a mapped routine name:

	FileControl  include/junk  Vend::SomeModule::file_control

* If no FileControl is not set, the checks are not done for performance
  reasons.

* TODO: Add standard UserDB methods.

Revision 2.2: download - view: text, markup, annotated - select for diffs
Wed Apr 2 03:06:18 2003 UTC (5 years, 9 months ago) by ramoore
Branches: MAIN
Diff to: previous 2.1: preferred, colored
Changes since revision 2.1: +14 -3 lines
Ugly workarourd for flock bug in Perl 5.8.0

Revision 2.1: download - view: text, markup, annotated - select for diffs
Tue Apr 1 04:12:32 2003 UTC (5 years, 9 months ago) by mheins
Branches: MAIN

* Add new Vend::File module with minimal functions.

* Relocate following routines (and their subsidiaries) from Vend::Util:

	canonpath
	catdir
	catfile
	exists_filename
	file_modification_time
	file_name_is_absolute
	get_filename
	lockfile
	path
	readfile
	readfile_db
	set_lock_type
	unlockfile
	writefile

  Added stubs so that package-based calls to those routines will not
  break software.

* Added CatalogUser directive that allows setting in interchange.cfg
  of allowed username that is used for access to absolute-path names.

  	CatalogUser  foundation  joe
  	CatalogUser  reports     jane

  This sets the user for allowed_file() for further read/write checks
  based on username.

* Created allowed_file() routine and replaced all current inline checks
  for NoAbsolute with call to that routine. It behaves as:

  NoAbsolute is No: all files are accessible, always

  Allowed for read/write:
  	Path name is relative with no ..
  	Path name is absolute but in the catalog directory
  	Path name is absolute but in a TemplateDir

  Allowed for read:
	CatalogUser set to a valid username and file is readable by that user
	CatalogUser set to a valid username and file is readable by a group
	 containing that user

  Allowed for write:
	CatalogUser set to a valid username and file is writable by that user
	CatalogUser set to a valid username and file is writable by a group
	 containing that user

* Changed display_special_page so that special page entries with ../
  will not break things.

* TODO:

	-- Code read for open() calls.
	-- Code read for chmod() calls.
	-- Code read for unlink() calls.

* Passes all regression tests; takes an order on foundation; runs UI including
  file navigator.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

Interchange CVSweb <info@icdevgroup.org>