permissions

Cgi-bin scripts get run without a user?

Deadly 提交于 2020-01-15 03:12:09
问题 I'm running a binary that requires a license key to reside in the user's home directory. I'm making a cgi script that calls upon this binary and everything is happy when I execute the script from the command line using sudo -u www-data binary. However, when I run the cgi script from the web, the binary can't find the license key. The apache error log states: License key "(null)/.key" not found., referer: Does this mean that cgi scripts are executed without any user attached for security

iOS9 FileManager File permissions change

社会主义新天地 提交于 2020-01-15 01:48:17
问题 After switching my application to iOS9 I started to get errors that the files I was writing were not readable. Here is how I create the files let fileManager = NSFileManager.defaultManager() let directory = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] let path = "\(directory)/file.txt" let attributes: [String:AnyObject] = [NSFilePosixPermissions: NSNumber(short: 666)] let success = fileManager.createFileAtPath(path, contents: nil, attributes: attributes)

PHP mkdir issue!

别说谁变了你拦得住时间么 提交于 2020-01-14 22:46:30
问题 I trying to create some dirs like this: @mkdir("photos/$cat/$sku", 0777, true) it creates the first directory with 0777 permissions, but when it creates the second is uses 000 as it's perms, so it fails to create the third. A workaround this please? Thanks, Richard. 回答1: This solved the issue: $a = @mkdir("photos/$cat/", 0777); @chmod("photos/$cat/", 0777); $b = @mkdir("photos/$cat/$sku/", 0777); @chmod("photos/$cat/$sku/", 0777); but why can't use recursive on mkdir? 回答2: I did this and it

PHP mkdir issue!

主宰稳场 提交于 2020-01-14 22:45:52
问题 I trying to create some dirs like this: @mkdir("photos/$cat/$sku", 0777, true) it creates the first directory with 0777 permissions, but when it creates the second is uses 000 as it's perms, so it fails to create the third. A workaround this please? Thanks, Richard. 回答1: This solved the issue: $a = @mkdir("photos/$cat/", 0777); @chmod("photos/$cat/", 0777); $b = @mkdir("photos/$cat/$sku/", 0777); @chmod("photos/$cat/$sku/", 0777); but why can't use recursive on mkdir? 回答2: I did this and it

Read-only file system

南楼画角 提交于 2020-01-14 18:59:03
问题 I'm trying to store a png file in the internal memory of the phone, but I am having some difficulties. I'm using this code: private void storeImage(Bitmap image, String nombre) { try { File file = new File(name + ".png"); file.createNewFile(); FileOutputStream fos = new FileOutputStream(file); image.compress(Bitmap.CompressFormat.PNG, 100, fos); fos.close(); } catch (FileNotFoundException e) { Log.d(TAG, "File not found: " + e.getMessage()); } catch (IOException e) { Log.d(TAG, "Error

Read-only file system

a 夏天 提交于 2020-01-14 18:57:51
问题 I'm trying to store a png file in the internal memory of the phone, but I am having some difficulties. I'm using this code: private void storeImage(Bitmap image, String nombre) { try { File file = new File(name + ".png"); file.createNewFile(); FileOutputStream fos = new FileOutputStream(file); image.compress(Bitmap.CompressFormat.PNG, 100, fos); fos.close(); } catch (FileNotFoundException e) { Log.d(TAG, "File not found: " + e.getMessage()); } catch (IOException e) { Log.d(TAG, "Error

Read-only file system

…衆ロ難τιáo~ 提交于 2020-01-14 18:56:21
问题 I'm trying to store a png file in the internal memory of the phone, but I am having some difficulties. I'm using this code: private void storeImage(Bitmap image, String nombre) { try { File file = new File(name + ".png"); file.createNewFile(); FileOutputStream fos = new FileOutputStream(file); image.compress(Bitmap.CompressFormat.PNG, 100, fos); fos.close(); } catch (FileNotFoundException e) { Log.d(TAG, "File not found: " + e.getMessage()); } catch (IOException e) { Log.d(TAG, "Error

What permissions do I need to enable for Docker volumes to work?

江枫思渺然 提交于 2020-01-14 17:15:15
问题 Let's say I have a Docker container that holds some data. I want this data to persist - if the container is stopped, removed, upgraded etc. I still want the data to be in an accessible location on the host OS filesystem. Currently, my solution is to create a directory /srv/service-name on my host (I use Ubuntu 14.10) and then run my service with the -v /srv/service-name:/path/inside/container argument. By trial and error I found out that sometimes the container is unable to write to this,

What permissions do I need to enable for Docker volumes to work?

纵饮孤独 提交于 2020-01-14 17:13:28
问题 Let's say I have a Docker container that holds some data. I want this data to persist - if the container is stopped, removed, upgraded etc. I still want the data to be in an accessible location on the host OS filesystem. Currently, my solution is to create a directory /srv/service-name on my host (I use Ubuntu 14.10) and then run my service with the -v /srv/service-name:/path/inside/container argument. By trial and error I found out that sometimes the container is unable to write to this,

What permissions do I need to enable for Docker volumes to work?

自作多情 提交于 2020-01-14 17:12:52
问题 Let's say I have a Docker container that holds some data. I want this data to persist - if the container is stopped, removed, upgraded etc. I still want the data to be in an accessible location on the host OS filesystem. Currently, my solution is to create a directory /srv/service-name on my host (I use Ubuntu 14.10) and then run my service with the -v /srv/service-name:/path/inside/container argument. By trial and error I found out that sometimes the container is unable to write to this,