December 17, 200718 yr ok, so i've come across this one issue with how vista media center works with thumbnails.... for each image/video it creates a thumbnail and stores it in each folder as ehthumbs_vista.db file. This makes thumbnails while browsing images/videos through VMC very fast. Now, I enabled read-only access to my picture's share, and the thumbnail view in VMC came to a crawl, even though the folder i'm viewing the pictures for already has an ehthumbs_vista.db file. I again enabled write access to the pictures share, and everything was normal again. So, VMC needs write access to ehthumbs_vista.db even though the file already exists with all the thumbnails...if it doesn't have write access, it doesn't seem to fetch the thumbnails from it and keeps recreating them every time. Now, is there a way to grant read only access to all files BUT ehthumbs_vista.db? Is there a way I can accomplish this? I do not want to grant write access as i do not want anyone accidentally deleting anything. edit: and by 1 file, i just dont mean ONE file, i mean every file named ehthumbs_vista.db.... Thanks.
December 20, 200718 yr ok, so i've come across this one issue with how vista media center works with thumbnails.... for each image/video it creates a thumbnail and stores it in each folder as ehthumbs_vista.db file. This makes thumbnails while browsing images/videos through VMC very fast. Now, I enabled read-only access to my picture's share, and the thumbnail view in VMC came to a crawl, even though the folder i'm viewing the pictures for already has an ehthumbs_vista.db file. I again enabled write access to the pictures share, and everything was normal again. So, VMC needs write access to ehthumbs_vista.db even though the file already exists with all the thumbnails...if it doesn't have write access, it doesn't seem to fetch the thumbnails from it and keeps recreating them every time. Now, is there a way to grant read only access to all files BUT ehthumbs_vista.db? Is there a way I can accomplish this? I do not want to grant write access as i do not want anyone accidentally deleting anything. edit: and by 1 file, i just dont mean ONE file, i mean every file named ehthumbs_vista.db.... Thanks. You can back into this functionality with some fairly straightforward unix: * Give all users read/write access via unraid * Set file permissions for your key files (movies, music) as read-only My unix is way-rusty and I don't have access to a unix box as I write this, but something like, "chmod 444 -R *.iso", would set global read for your iso files recursively through the file structure. If the unraid capability already sets file permissions, perhaps set everyone to read-only and then do a "chmod 777 -R ehthumbs_vista.db" which would set global read-write for the thumbs files. I haven't tested that either of the above would work so I don't suggest anyone try them until someone confirms it will work. Comments? Cheers, Bill
December 20, 200718 yr Dont you mean chmod to 666, not 777. 777 will set the execute bit. Which reminds me, the file and dir mask in the samba config that the unraid managment app writes is fubar. Got to post about that.
December 20, 200718 yr I wrote 777 intentionally, but you are right, setting those files to execute doesn't help anything and could be a problem. I am really interested in hearing anyone's input about the approach. The specific permission mask is something we can work out. Bill
December 21, 200718 yr The "create mask" and "directory mask" directives in smb.shares are set to 711. The problem is that these are not the same as a umask, they are the actual permissions being set. So it is setting execute bits on all files, and only root can read anything. Generally, the directory mask should be 755 and the create mask should be 644. Ideally, these should be a configuration option in the management interface. I currently stop samba, rewrite the smb.shares, and restart samba with a script.
December 21, 200718 yr In UNIX, to remove a file, it does not need to be writable, but the directory it is in needs to be writable. (basically, you are deleting the dirrectory entry that points to the blocks holding the data of the file when you are deleting a file. Therefore you need write permission on the directory.) So, even after making all the ISO images read-only, it might still be possible to delete them if the folder (directory) they are in is writable. If you make the directories read-only you can still edit and update any existing file in the directory. This might work for you if the users of your server can't open up the file in an editor for writing. If they can, oops. Or, if they can "Save as" and name a writable file, again oops... contents replaced. Making the directory read-only may not work if the thumbs db is deleted and re-created each time. If it is truly deleted/re-created then write permission must exist on the directory. A possibility that might work is this... and a script might be created to do the tedious work. make a folder named images/ISO and put all your ISO images in it. Make it read-only, and hidden on the LAN. now your images/Videos folder is empty. We can fill it with symbolic links to the ISO images. (these are somewhat like the "shortcut" files on Windows) You can remove a shortcut, but it will not delete the actual file it points to. The script would be something like this for i in /mnt/disk1/images/ISO/*.[iI][sS][oO] do ln -s $i /mnt/disk1/Videos/`basename $i` done Once you run the script you will only have links to the actual files in your /mnt/disk1/Videos directory and the ISO images themselves in /mnt/disk1/ISO directory. Now, you can leave the /mnt/disk1/Videos folder writable. Worst anyone can do is delete the link to the actual file. The thumbnail file can be created as normal, and best thing is, the links themselves take barely any space, only a few bytes each. Unfortunately you cannot do this on the /mnt/user shares... Tom did not implement or look for links in his user file system (I tried) so you will have to create the links in one of the /mnt/disk shares. Joe L.
December 22, 200718 yr Author thanks for all your replies, i'll get around to it this weekend and test it out the linking sounds promising, but also sounds like a lot of work, in the sense that it wont automatically create the link and i'd to rerun the go script everytime i change something now, you said i can make the folder read only (but still allow read/write access from the unraid web interface right) they will NOT be able to delete any file/folder within the directory even if the file/directory has read/write access, but will still be able to WRITE to any existing file? But then i won't have write access to create any new files from within the file explorer, even if i'm logged in as root? so lets say i have a folder on disk1 disk1>pictures>family>my birthday 2007 if i make the main "pictures" folder read only, nothing inside the folder will be able to be deleted, even if everything below the picture's folder has read/write access. and as said above, i'll still have write access to any existing file, just won't be able to delete or create a new file. this seems like a viable solution to me, as if i want to add new items, i can just telnet and enable write to that folder, create/copy the new files over, enable read only access. currently if i enable read only access for a user share, i can't write to an existing file, says i do not have permission, it won't do the same if i enable read only access on the folder thru chmod will it? Also, with the above method, how will all of this affect user shares if "pictures" is spanned across multiple drives and i'm accessing them thru the user share...i'm guessimng the pictures in the folder w/ the readonly set wont allow delete.
December 27, 200718 yr Not sure how to solve this. Probably vista tries to open the db file 'read/write', and when that fails, it regenerates the thumbnails on the fly, which is slooow. Stay tuned...
January 13, 200818 yr Author Not sure how to solve this. Probably vista tries to open the db file 'read/write', and when that fails, it regenerates the thumbnails on the fly, which is slooow. Stay tuned... any update on this yet? i'd love to set my picture folder to read only, it's wayy to easy to delete a picture/picture folder from VMC
Archived
This topic is now archived and is closed to further replies.