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     38   
    39     39   	# User-replaceable function get the home directory of the current user
    40     40   	proc get_homedir {} {
    41     41   		return [::appfsd::get_homedir]
    42     42   	}
    43     43   
    44     44   	# User-replacable function to update permissions
    45         -	proc change_perms {file perms} {
           45  +	proc change_perms {file sha1 perms} {
    46     46   		if {[info exists ::appfs::user::add_perms($file)]} {
    47     47   			append perms $::appfs::user::add_perms($file)
    48     48   		}
           49  +
           50  +		if {[info exists ::appfs::user::add_perms($sha1)]} {
           51  +			append perms $::appfs::user::add_perms($sha1)
           52  +		}
    49     53   
    50     54   		return $perms
    51     55   	}
    52     56   }
    53     57   
    54     58   namespace eval ::appfs {
    55     59   	variable cachedir "/tmp/appfs-cache"
................................................................................
   801    805   						set directory [join [lrange $work 0 end-1] "/"]
   802    806   						set file [lindex $work end]
   803    807   
   804    808   						if {$directory == "" && $file == ""} {
   805    809   							array set retval [list type directory]
   806    810   						}
   807    811   
   808         -						::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 {}
          812  +						::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 {}
   809    813   
   810    814   						# Allow an administrator to supply additional permissions to remote files
   811    815   						if {[info exists retval(perms)]} {
   812    816   							# Lower case this in case an upper-cased value was put in
   813    817   							# the database before we started lowercasing them
   814    818   							set retval(perms) [string tolower $retval(perms)]
   815    819   
   816         -							set retval(perms) [::appfs::user::change_perms $path $retval(perms)]
          820  +							set retval(perms) [::appfs::user::change_perms $path $retval(file_sha1) $retval(perms)]
   817    821   						}
   818    822   
   819    823   						if {[info exists retval(type)] && $retval(type) == "directory"} {
   820    824   							set retval(childcount) [llength [getchildren $path]]
   821    825   						}
   822    826   
   823    827   						unset -nocomplain retval(*)