Proper permissions for my SVN repository directory tree on Mac? - xcode

I restored my Mac form a Time Machine backup, and now I can't check files into my svn repo.
I have tried svnadmin recover, but it fails:
svnadmin: Can't open file 'WriteAssist/db/write-lock': Permission denied
The directory is owned by the "admin" user that I set up for bootstrapping the machine. My current user is "andersprivat".
Should I just chown the entire tree? Doing a chmod 777 would presumably work, but seems like a big security hole.

In the end svnadmin recover appeared to do nothing at all for me.
I ended up having to chmod -R 777 all the files to be allowed to check in at all, then manually handling all in-flight issues. Did not leave me loving svn any more than I already did. When it works it's great, but getting it up when it has stumbled is a b*tch.

Related

How to solve '.git/index.lock': No such file or directory' error?

Summary
I recently lost the ability to make any changes using Git on my Windows system. After a few days of not using my PC I come back to a non functional git so I have no idea what caused this issue.
Examples:
git add or git checkout => fatal: Unable to create 'dummy-repo/.git/index.lock': No such file or directory
git clone => fatal: could not create work tree dir 'DummyRepo': No such file or directory
As a side note, this problem occured after trying to start my Flutter application, which could not retrieve the packages because of an OS error where access was denied. I'm thinking this is either because of some write permissions being messed up or a certain process locking a file.
What I've tried so far:
Closing all files and rebooting PC
Uninstalling and reinstalling Git
Run Git Bash as an administrator
Changed system write permission to my user account for all files
Any help is appreciated!
On Windows, this may happen if you enabled the "Ransomware protection" in Setting > Windows security > Virus & threat protection.
You need to add an exclusion for git.exe, or move the project outside a protected folder.
I've solved it myself by changing the location of my project to C:\ instead of a way longer path. This was never a problem before but it works so I'm happy.
I did 2 things:
I found that there was a file named 'index' in '.git/' directory. I made a copy of it, and renamed the copy as 'index.lock'.
Under 'Ransomware protection', I temporarily switched off 'Controlled folder access'.
Problem solved.
After I am done, I switched 'Controlled folder access' back on.
Try creating that file in your .git directory, you can use these commands in Git Bash or linux/mac
cd .git
touch index.lock
On Windows CMD
cd .git
type nul > index.lock

Permission denied when starting .bashrc on ubuntu on windows

I wanted to add a path to my .bashrc file on Ubuntu on Windows.
Since then, I get always:
/home/gian1312/.bashrc: Permission denied
I deleted all my changes. It did not help.
Then I opened the .profile file to add the path there. --> Now I get:
/home/gian1312/.profile permission denied
I deleted all my changes. All edits were made by Notepad++ in Windows.
I am looking for a solution for several days. Probably a reinstallation would help but as long as I do not know the reason I do not want to risk to face the same problem.
Best Regards and thanks a lot
Gian
The error simply says that permission denied. Since the question is not completely clear, the following things can be tried:
1) Check the permission of the file ".bashrc" and ".profile" and make sure it is 0644
2) Check the upper level directory permission (here the folder /home/gian1312) and make sure it is 0755.
3) If the first two are fine, then you need to check the permission of the "path" which you are trying to add and it should have enough permissions to be readable by the user "gian1312"
Editing the answer as per the below comment:
To change the permissions, please run the below commands:
chmod 0755 /home/gian1312
chmod 0644 /home/gian1312/.bashrc
chmod 0644 /home/gian1312/.profile

git "fatal: .git/index: index file open failed: Permission denied"

So, I have been working on a project and have been using git to push to github, and then suddenly today after I have been working for a little while I went to git add and got fatal: .git/index: index file open failed: Permission denied
I can't think of anything I have done recently on my computer that would cause this. Although I woke up today noticing my computer had rebooted overnight, and I noticed some different settings were not how I normally leave them. For instance quiet mode was turned off, and I always have that on. Thought it was kind of weird but ran a virus scan and didn't notice anything so I shrugged it off thinking it may be something on window's end.
Should I be nervous something is playing with my permissions? After a few minutes of googling I haven't found out too much on this error. Kinda baffled because I haven't personally changed any permissions and it everything seemed fine yesterday.
Looking for some help, if there is anything else I need to include to solve this error I'll gladly provide it if asked. Nobody else uses this computer. It is a Windows 10 build, git version 2.6.3.windows.1.
edit: Here's the output
11:21:34.673917 trace.c:319 setup: git_dir: .git
11:21:34.674417 trace.c:320 setup: git_common_dir: .git
11:21:34.674417 trace.c:321 setup: worktree: D:/Downloads/AnotherTabExample
11:21:34.674417 trace.c:322 setup: cwd: D:/Downloads/AnotherTabExample
11:21:34.674417 trace.c:323 setup: prefix: (null)
11:21:34.674417 git.c:348 trace: built-in: git 'add' '.'
fatal: .git/index: index file open failed: Permission denied
Mark: If you have this error in Android studio, just restart your android studio and this error will be solved. I guess that This is because of some 'cache' or 'bug' of intellij idea.
From the verbose output, it appears that the permissions of the .git/index while might have gotten corrupted.
Confirm that this is the case by doing a ls -al .git/index followed by a chmod 644 .git/index to fix it. Then try running the git add command again.
Update
It turned out to be a (Windows) permissions issue. What worked was simply creating a copy from within msysgit of the original folder and using that (i.e. cp -rvf original original-bkup).
A reset of the permissions on the original folder should have worked, but didn't.

owncloud cannot access directory

I am running Raspbian version 7 on my raspberry pi. I am running owncloud on this. I have mounted an external drive under /media/Owncloud. This is where I have owncloud store all the files. I cannot access this directory. When I try cd /media/Owncloud it gives me the following error:
-bash: cd: /media/Owncloud/: Permission denied
How can I access this directory?
OwnCloud and external hard drives are tricky and you have a permission issue. For some reason, trying to make a link to an external hard drive has issues, so you need to try mounting your external hard drive.
External hard drive - Apply the proper group and read permissions:
chown -R www-data:www-data /media/user/your_hard_drive/owncloud_data/
chmod -R 777 /media/user/your_hard_drive/owncloud_data/
Local hard drive - Apply the proper group and read permissions:
mkdir /var/www/owncloud/data
chown -R www-data:www-data /var/www/owncloud/data
chmod -R 777 /var/www/owncloud/data
Make the mount of local hard drive to external hard drive
mount --bind /media/user/your_hard_drive/owncloud_data/ /var/www/owncloud/data/
Source:
https://manandkeyboard.wordpress.com/2014/09/15/owncloud-and-an-external-hard-drive/
If you just want to cd into the directory, change to root with sudo -i.
In order to access /media/Owncloud, you need to set the proper permissions. Run the command sudo chmod 755 /media/Owncloud(for more security relative to permission 777).
You also may need to allow to webserver to access the directory. In order to do that, run sudo chown -R www-data:www-data /media/Owncloud
Sources:
My own experience and frusteration in running into the exact same problem
http://www.instructables.com/id/Raspberry-Pi-Owncloud-dropbox-clone/?ALLSTEPS A great albeit somewhat outdated guide to set up owncloud on a Raspberry Pi.
The issue is with wrong permissions.
If the webserver runs as user www-data, the mounted folder must be somehow accessible to that user
either that user must be owner of mounted folder and its contents, and have the "user" permissions, or
the the folder must be accessible to the group the webserver user is in (usually www-data).
To see the current permissions use the ls -l command.
To change the owner use chown command,
to change the permissions for the user-owner, and group-owner, use the chmod command,
or just use Midnight commander (mc) or some GUI to do that.
If you are mounting the external volume through /etc/fstab check the options in there. I would not recommend using the volume with some dynamic mounting (like the file managers do (gvfs-fuse)) if is a key folder for a webserver with ownCloud and you need to have it auto-mounted on boot, as some specific user that the webserver is run as.
I have an experience with having the ownCloud data folder on /srv/data (also ownCloud 7.0 on Ubuntu Server 14.04 VPS), the permissions are 770 and the owner is www-data:www-data, and in the ownCloud config file, I use the line
'datadirectory' => '/srv/data',
I would not recommend using 777 permissions, as it is not a good security practice in general.

Magento Permissions

I have just moved my Magento store from cPanel to DirectAdmin (Centos).
My problem is now with permissions. Previously on cPanel all folders were set to 755 and files 644. This worked great.
However on DirectAdmin the only way I seem to be able to get everything to work (including the downloader) is by setting all folders to 777. Is this safe to do so?
Also what should the User and Group ownership be set to?
Thanks!
Followed this and everything seems to be working well:
http://blog.nexcess.net/2010/12/06/securing-magento-file-directory-permissions/
chmod may not be your problem. Who is the owner of the files on new server? Set the ownership via chown to www-data (ubuntu) or whatever they should be on centos. They way you can find this out is by setting all to 777 then look at the some newly created file, from var/log or var/session and see who is the owner/group. Reset back to varien's recommended chmod settings and do the chown user:group on all files.
Its not good to have 777 on all your folders as it makes it publicly accessible and changeable. Some can be 777, more so 755, and most cases 644
Get set the folders to the right permissions the easiest way is to use the Magento cleanup tool here:
http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions
Scroll down a bit on that page to download the Magento Cleanup Tool
You can also reference the Magento installation cheat sheet Step 2 - Set file permissions:
http://www.magentocommerce.com/knowledge-base/entry/magento-installation-cheat-sheet#step2
So I would set everything back to 644, and then run the cleanup tool.
Magento Permission can be set by running a file in the installation.For that you need to download the magento cleaup tool.
Download Magento Cleanup Tool

Resources