permissions

Setting file permissions in Objective-C

北战南征 提交于 2019-12-31 03:44:05
问题 I managed to get my hands on a nifty ftp object. It is very low level and easy to adapt. I'm using it to transfer files from one Mac to another via FTP. Now, the issue I'm having is that when the file, that is transfered, reaches its destination, the other Mac, the access permissions is set , at random intervals, to "Everyone" : "No Access". So sometimes, whatever I do with the files fails randomly because my application can't access the files. Is there a way I can change the file's access

Capifony setfacl permissions: “Operation not permitted”

非 Y 不嫁゛ 提交于 2019-12-31 02:08:37
问题 I have a user didongo (user & group didongo ), and the nginx server (user & group www-data ). I've setup Capifony to login as didongo user: the first time I deploy setfacl command works ok (while the logs folder is empty). But after the web application, served by nginx, has generated some logs (prod.log) the very next deploy fails, with an setfacl error. I'm sure I'm doing a noob error with the permissions between the user and the web server, but I don't see what error. I see that didongo

Requesting multiple Bluetooth permissions in Android Marshmallow

纵饮孤独 提交于 2019-12-31 01:52:13
问题 I'm developing an app with connectivity which connects to a Bluetooth device with SDK 23 as compile with. I'm having problems with requesting multiple permissions for Bluetooth. This is what I have done so far: @Override public void onStart() { super.onStart(); if (D) Log.e(TAG, "++ ON START ++"); if (ContextCompat.checkSelfPermission(MyBlueToothClientActivity.this, Manifest.permission.BLUETOOTH) != PackageManager.PERMISSION_GRANTED) { } else { ActivityCompat.requestPermissions

Changing system file permission

两盒软妹~` 提交于 2019-12-31 01:48:34
问题 I've really tried everything: NetHackFileHelpers How to get File Permission Mode programmatically in Java Change file permission in application Mount R/W system in android application to edit Read Only files Now, suppose I've remounted as root, and therefore RW permission on file system (Android version 2.3.7): Process process = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(process.getOutputStream()); os.writeBytes("chmod -c 0777 /system/etc/customization

Failed to update database “*.mdf” because read only EntityFramework

雨燕双飞 提交于 2019-12-30 12:39:23
问题 I have a C# .NET Framework 4.0 desktop application with Entity Framework as DAL. When a try to save a data into DBContext on anybodies machine but mine, I recieved an exception Failed to update database "*.mdf" read only I keep my DB near .exe file, in folder "DAL/AppData". How can I allow write access on other machines? Can I do it programmatically? I've read that I can place DB into AppRoaming Folder, but this is not my variant. Thanks in advance. 回答1: I keep my DB near .exe file, in folder

Rails object based permission/authorization engine?

♀尐吖头ヾ 提交于 2019-12-30 12:23:06
问题 I want to add "Sharing documents" feature to my app, like in google documents service. As i see: User can: can list/view/create/edit/delete own documents share own document to everyone - its a public document share own document to another user with read-only access share own document to another user with read-write access view list of own documents and users to whom he gave permission to read and write view list of foreign documents view/edit foreign document with read/write permissions

Setting named pipe security in a Domain

房东的猫 提交于 2019-12-30 12:21:39
问题 I have a server that I'm setting up over a named pipe. It works fine for administrators of the domain, but when I test the client on a normal user, it gives the exception "Access to path is denied". So here is what I'm trying to set the permissions to give access to all authenticated users in the domain. What am I doing wrong here? Server: NamedPipeServerStream pipeServer = new NamedPipeServerStream("message-generator", PipeDirection.InOut, pipeThreads, PipeTransmissionMode.Message,

How can I have a PHP script run a shell script as root?

扶醉桌前 提交于 2019-12-30 11:14:16
问题 Running Fedora 9/10, Apache 2, PHP 5... Can I run a shell script as root, from a PHP script using exec()? Do I just give Apache root priveleges, and then add "sudo" in front of them command? Specifically, I'm trying to start and stop a background script. Currently I have a shell script that just runs the app, start.sh: #!/bin/bash /path/to/my/app/appname And a script that kills the app, stop.sh: #!/bin/bash killall appname Would I just do: <?php exec("sudo start.sh"); ?> Thanks in advance.

Permission for an image from Gallery is lost after re-launch

若如初见. 提交于 2019-12-30 10:58:51
问题 My app lets the user view some selected images from the Gallery or other locations. I request for the Uri's of images through: Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("image/*"); startActivityForResult(photoPickerIntent, PickerFragment.PICK_PHOTO); And then get the Uri's in onActivityResult (int requestCode, int resultCode, Intent data) and have access to those images to put them in my app's views via: Uri imageUri= data.getData(); When the app

c copy file permissions from another file

£可爱£侵袭症+ 提交于 2019-12-30 10:36:35
问题 What's the simplest way to copy the unix file permissions of a file and set them to another file? Is there a way to store a file's permissions to a variable and then use that variable to set those permissions to another file? 回答1: Sure. Use stat() and chmod() (may need root). #include <sys/stat.h> struct stat st; stat("/foo/bar.txt", &st); chmod("/baz/quirk.jpg", st.st_mode); 来源: https://stackoverflow.com/questions/16680302/c-copy-file-permissions-from-another-file