permissions

Is PHP allowed to modify .htaccess file in current folder?

左心房为你撑大大i 提交于 2020-01-01 06:18:08
问题 I have a PHP web app located on shared hosting . My goal is to modify .htaccess file from PHP code when the PHP page is running. I need that .htaccess to insert a couple of mod_rewrite lines into it. The problem is that on Windows+Apache I can dynamically modify .htaccess file but the same code on Linux reports a problem when I try to access this file in any way (copy or fopen): "failed to open stream: Permission denied" I have given .htaccess file 777 permissions - still no result. WHat

Which user permission does a service need to start/stop other services?

此生再无相见时 提交于 2020-01-01 05:56:45
问题 I've wrote a service that should start/stop other services. This is the code I'm using: ServiceController sc = new ServiceController("servicename"); if(sc.Status != ServiceControllerStatus.Running) { sc.Start(); } This is the callstack of the exception. (Sorry, but the message is localized in german, but that's not relevant for understanding my problem) System.InvalidOperationException: Der Dienst SCardSvr kann nicht auf dem Computer . geöffnet werden. ---> System.ComponentModel

Which user permission does a service need to start/stop other services?

≯℡__Kan透↙ 提交于 2020-01-01 05:56:08
问题 I've wrote a service that should start/stop other services. This is the code I'm using: ServiceController sc = new ServiceController("servicename"); if(sc.Status != ServiceControllerStatus.Running) { sc.Start(); } This is the callstack of the exception. (Sorry, but the message is localized in german, but that's not relevant for understanding my problem) System.InvalidOperationException: Der Dienst SCardSvr kann nicht auf dem Computer . geöffnet werden. ---> System.ComponentModel

Android Java : Turn screen Off

泪湿孤枕 提交于 2020-01-01 05:39:08
问题 I am making an application that turn the screen ON and OFF with the proximity sensor. The proximity code is finished, but i got trouble using the screen controls. I have read that I should use, PowerManager manager = (PowerManager) getSystemService(Context.POWER_SERVICE); manager.goToSleep(int amountOfTime); For that, I need to grant special permissions in order to make it works, but I haven't figured out how to do it. Also, I have read about changing screen brightness WindowManager

Android usb enumeration

混江龙づ霸主 提交于 2020-01-01 05:37:06
问题 I am writing an android USB host application for which I am trying to enumerate the devices connected with tablet. I follow the code in the android USB host documentation in the developer site. My code is as follows AndroidUSBActivity public class AndroidUSBActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); USBClass usb = new USBClass();

Visual Studio requires elevated permissions in Windows 7

元气小坏坏 提交于 2020-01-01 04:06:06
问题 I'm running Visual Studio 2008 on Windows 7. When I try to attach to a process, VS tells me to restart under different credentials (with elevated permissions). So I have to restart VS and run it as Administrator. Is there a way to set it up so VS always starts with Admin privileges? 回答1: shortcut Properties -> Compatibility tab -> set Run this program as an administrator checkmark. [ ] Shaji in comments posted How to Run a Program as an Administrator in Windows 7 article link. Most useful(as

How can I programmatically set permissions on my char device

断了今生、忘了曾经 提交于 2020-01-01 00:44:10
问题 I've recently inherited some code at work, this is old 2.4.X linux kernel drivers and I've been tasked with getting them working on a newer kernel 2.6 or greater. I'm running on OpenSUSE 12.1 with a 3.1.10 kernel. I've updated the original code from register_chrdev() to use class_create()/device_create() calls and I can see my devices show up in /dev correctly. My current issue is that the permissions for my device are being set to r/w for user only: crw------- 1 root root 244, 0 Aug 7 07:57

Creating SQL Server backup file (.bak) with c# to any location

别说谁变了你拦得住时间么 提交于 2019-12-31 10:35:08
问题 I'm trying to write simple application in C# which will allow me to backup, zip and send over ftp my SQL Server database. One problem I have encountered is that I'm not able to create the backup file (.bak) if I try to do it in different location than "C:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Backup" or "C:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Data" folder. I understand that this is a premission problem. Could someone point me to the resources or write here a short

Permission denied for build.sh file

女生的网名这么多〃 提交于 2019-12-31 08:44:04
问题 $ ./build.sh --quiet verify /home/travis/build.sh: line 59: ./build.sh: Permission denied. The command "./build.sh --quiet verify" exited with 126. 回答1: Looks like you need to check in the file build.sh with execution permissions. Please try the following from your own machine: git update-index --add --chmod=+x build.sh git commit -m 'Make build.sh executable' git push 回答2: You can grant the needed permission by adding this lines to the .travis.yml before_install: - chmod +x build.sh 回答3: Run

Creating new tmp folder for PHP to use?

好久不见. 提交于 2019-12-31 07:29:07
问题 I think I'm having problems using PHP sessions because I've got cPanel installed on the same server and I believe it has additional security in place that prevents write access to /tmp I can set a new folder, but am unsure what permissions / owners should this folder have. Also where should it ideally be located? 回答1: /tmp should always be accessible. You can of course create a new "tmp" folder somewhere near you application. Just make sure it does not reside within the web root. Give it read