file-permissions

Does git store the read, write, execute permissions for files?

可紊 提交于 2019-11-29 05:55:02
I wanted to make some files in git read only. But I couldn't find any good documentation on doing this. Does git store the read, write, execute permissions for files? According to kernel.org git does not store all the permissions possible for files. Git is a content tracker, where content is de facto defined as "whatever is relevant to the state of a typical sourcecode tree". Basically, this is just files' data and "executable" attribute. So git stores only the content in the file and the execute bit. (This is probably a design choice. Probably driven partly by the fact that not all file

Does git store the read, write, execute permissions for files?

心已入冬 提交于 2019-11-29 05:53:17
I wanted to make some files in git read only. But I couldn't find any good documentation on doing this. Does git store the read, write, execute permissions for files? According to kernel.org git does not store all the permissions possible for files. Git is a content tracker, where content is de facto defined as "whatever is relevant to the state of a typical sourcecode tree". Basically, this is just files' data and "executable" attribute. So git stores only the content in the file and the execute bit. (This is probably a design choice. Probably driven partly by the fact that not all file

Copy a file with its original permissions

风格不统一 提交于 2019-11-29 04:36:53
When using the File.Copy() method the file is copied to its new directory however it loses its original permissions. Is there a way to copy a file so that it doesn't lose the permissions? Alex Mendez I believe you can do something like this: const string sourcePath = @"c:\test.txt"; const string destinationPath = @"c:\test2.txt" File.Copy(sourcePath, destinationPath); FileInfo sourceFileInfo = new FileInfo(sourcePath); FileInfo destinationFileInfo = new FileInfo(destinationPath); FileSecurity sourceFileSecurity = sourceFileInfo.GetAccessControl(); sourceFileSecurity.SetAccessRuleProtection

Can't install mongo-php-driver on OS X 10.11

心已入冬 提交于 2019-11-29 03:49:48
问题 I've read through all the similar Stack Overflow questions - nothing addresses my specific issue. I'm running OS X 10.11 (El Capitan). I've cloned the mongo-php-drive repo and these commands succeed: phpize ./configure make But sudo make install fails: (master) ~/tmp/mongo-php-driver $ sudo make install Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20121212/ cp: /usr/lib/php/extensions/no-debug-non-zts-20121212/#INST@39898#: Operation not permitted make: *** [install

PowerShell To Set Folder Permissions

橙三吉。 提交于 2019-11-29 01:02:54
I am trying to use the "default" options in applying folder permissions; by that, I mean that using the "Full Controll, Write, Read, etc" in the 'Properties' for a folder. The following script works to add the user in, but it applies "Special Permissions" - not the ones with the tick boxes for the ones visible in the properties menu of the folder: $Acl = Get-Acl "\\R9N2WRN\Share" $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule ("user","FullControl","Allow") $Acl.SetAccessRule($Ar) Set-Acl "\\R9N2WRN\Share" $Acl What am I doing wrong please? PeterK Specifying inheritance in

File permissions do not inherit directory permissions

北慕城南 提交于 2019-11-29 00:19:08
I have a program that's creating a secure directory for user output. This is working correctly, but the files I create in it (or copy to it) are ending up with only administrator access. DirectoryInfo outputDirectory = baseOutputDirectory.CreateSubdirectory(outputDirectoryName, GetDirectorySecurity(searchHits.Request.UserId)); ... private DirectorySecurity GetDirectorySecurity(string owner) { const string LOG_SOURCE = "GetDirectorySecurity"; DirectorySecurity ds = new DirectorySecurity(); System.Security.Principal.NTAccount ownerAccount = new System.Security.Principal.NTAccount(owner); ds

Having trouble writing to a file with PHP on Ubuntu

[亡魂溺海] 提交于 2019-11-28 23:53:13
I am running PHP 5.5.9 on Ubuntu 14.04. I'm having trouble writing to a file. I feel like this has to be a file permissions problem because I'm pretty sure the code is correct. The user that I'm logged in as has permissions to write in the folders that I am trying to write into, but I'm not sure if the localhost does. I'm not sure what the name of the localhost user is in order to use chmod . I tried using chmod 777 -R /var/www/html and the script is still is not able to write to my target folder, which has the path /var/www/html/Projects/MD_ScrapingTool/files . Here is my code: $file =

Is there a way for a Java app to gain root permissions?

Deadly 提交于 2019-11-28 23:21:57
When running Files.walk(Paths.get("/var/")).count() as an unprivileged user, the execution might throw an exception as there are folders inside /var/ that need root permission to be traversed. I am not looking for a way to execute a bash command as root (e.g. sudo find /var ), using Process , etc. I just want to make sure Files.walk(Paths.get("/var/")).count() does not throw an AccessDeniedException : Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0 at sun.reflect.NativeMethodAccessorImpl.invoke at sun.reflect

Test if a directory is writable by a given UID?

做~自己de王妃 提交于 2019-11-28 22:22:17
We can test if a directory is writable by the uid of the current process: if [ -w $directory ] ; then echo 'Eureka!' ; fi But can anyone suggest a way to test if a directory is writable by some other uid? My scenario is that I am administering a MySQL Server instance, and I want to change the location of the slow-query log file temporarily. I can do this by executing a MySQL command SET GLOBAL slow_query_log_file='$new_log_filename' and then disable & enable query logging to make mysqld start using that file. But I'd like my script to check that the uid of the mysqld process has permissions to

Permission denied when installing npm module

杀马特。学长 韩版系。学妹 提交于 2019-11-28 21:28:05
I'm getting a strange permission error when I try to install an npm module. I'm starting it with sudo so I'm sure I do have access, but for some reason it keeps complaining with an error: stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/joplin/node_modules/sqlite3/build' I've tried restarting my computer, and creating a directory /usr/lib/node_modules/joplin with chmod 777, but it still doesn't work. $ sudo npm install -g joplin /usr/bin/joplin -> /usr/lib/node_modules/joplin/main.js > sqlite3@3.1.9 install /usr/lib/node_modules/joplin/node_modules/sqlite3 > node-pre-gyp