Check-in [79c3658a52]
Overview
SHA1:79c3658a529758f32c1e14b771d386e89fdf849e
Date: 2015-03-20 03:13:13
User: rkeene
Comment:Updated to allow users to specify permissions on files by their SHA1 in addition to filename
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2015-03-20
15:19
[11de1e2cff] AppFS 1.6 (user: rkeene, tags: trunk, 1.6)
03:13
[79c3658a52] Updated to allow users to specify permissions on files by their SHA1 in addition to filename (user: rkeene, tags: trunk)
01:50
[01c5bfc689] Updated to set umask on startup (user: rkeene, tags: trunk)
Changes

Modified appfsd.tcl from [9ba44d8408] to [9d766a9055].

38
39
40
41
42
43
44
45
46
47
48




49
50
51
52
53
54
55
...
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823

	# User-replaceable function get the home directory of the current user
	proc get_homedir {} {
		return [::appfsd::get_homedir]
	}

	# User-replacable function to update permissions
	proc change_perms {file perms} {
		if {[info exists ::appfs::user::add_perms($file)]} {
			append perms $::appfs::user::add_perms($file)
		}





		return $perms
	}
}

namespace eval ::appfs {
	variable cachedir "/tmp/appfs-cache"
................................................................................
						set directory [join [lrange $work 0 end-1] "/"]
						set file [lindex $work end]

						if {$directory == "" && $file == ""} {
							array set retval [list type directory]
						}

						::appfs::db eval {SELECT type, time, source, size, perms FROM files WHERE package_sha1 = $pathinfo(package_sha1) AND file_directory = $directory AND file_name = $file;} retval {}

						# Allow an administrator to supply additional permissions to remote files
						if {[info exists retval(perms)]} {
							# Lower case this in case an upper-cased value was put in
							# the database before we started lowercasing them
							set retval(perms) [string tolower $retval(perms)]

							set retval(perms) [::appfs::user::change_perms $path $retval(perms)]
						}

						if {[info exists retval(type)] && $retval(type) == "directory"} {
							set retval(childcount) [llength [getchildren $path]]
						}

						unset -nocomplain retval(*)







|



>
>
>
>







 







|







|







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
...
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827

	# User-replaceable function get the home directory of the current user
	proc get_homedir {} {
		return [::appfsd::get_homedir]
	}

	# User-replacable function to update permissions
	proc change_perms {file sha1 perms} {
		if {[info exists ::appfs::user::add_perms($file)]} {
			append perms $::appfs::user::add_perms($file)
		}

		if {[info exists ::appfs::user::add_perms($sha1)]} {
			append perms $::appfs::user::add_perms($sha1)
		}

		return $perms
	}
}

namespace eval ::appfs {
	variable cachedir "/tmp/appfs-cache"
................................................................................
						set directory [join [lrange $work 0 end-1] "/"]
						set file [lindex $work end]

						if {$directory == "" && $file == ""} {
							array set retval [list type directory]
						}

						::appfs::db eval {SELECT type, time, source, size, perms, file_sha1 FROM files WHERE package_sha1 = $pathinfo(package_sha1) AND file_directory = $directory AND file_name = $file;} retval {}

						# Allow an administrator to supply additional permissions to remote files
						if {[info exists retval(perms)]} {
							# Lower case this in case an upper-cased value was put in
							# the database before we started lowercasing them
							set retval(perms) [string tolower $retval(perms)]

							set retval(perms) [::appfs::user::change_perms $path $retval(file_sha1) $retval(perms)]
						}

						if {[info exists retval(type)] && $retval(type) == "directory"} {
							set retval(childcount) [llength [getchildren $path]]
						}

						unset -nocomplain retval(*)