privileges

IOError: 13, 'Permission denied' when writing to /etc/hosts via Python

ε祈祈猫儿з 提交于 2019-12-12 07:16:15
问题 I have a Python app that I'm working on that needs to access the hosts file to append a few lines. Everything worked on my test file, but when I told the program to actually modify my hosts file in /etc/hosts I get IOError 13. From what I understand, my app doesn't have root privileges. My question is, how can I circumnavigate this issue? Is there a way to prompt the user for their password? Would the process be any different if I was running the app on a Windows machine? Here's the code in

Question regarding PHP possibilites (users, admin/mod)

为君一笑 提交于 2019-12-12 06:51:18
问题 First of all, I'm kinda new to web programming and programming in general. HTML/CSS + Javascript are as far as I've gone over the last few years. Now, for the purpose of my work, I need to learn PHP. What I'm most interested about is user registration + users' privileges. My task is to create a web application that is, let's say, a simpler version of a blog. I'd like to know is it possible to build such an application from scratch and add users with different privileges. And, if so, what is

How to running application under root privilege?

こ雲淡風輕ζ 提交于 2019-12-12 00:41:54
问题 Please tell me a way grant for my application to modify /Library/Fonts folder as add new and remove font file. Thanks in advance. 回答1: You can split your application into two parts: service(daemon) and UI and install them via installer in the way so your service will have root privileges You can run some command from your app using AuthorizationExecuteWithPrivileges() but it is deprecated. Still it works You can run some command via NSAppleScript using "do shell script \"some script\" with

permission error when populating a table in PostGreSQL copying from a csv file

瘦欲@ 提交于 2019-12-11 23:38:12
问题 I know this issue has already been raised by others, but even trying previous suggestions I still get this error... When I try to populate a table copying from a csv file, I get a permission error. COPY Eurasia FROM '/Users/Oritteropus/Desktop/eurasia1.csv' CSV HEADER; ERROR: could not open file "/Users/Oritteropus/Desktop/eurasia1.csv" for reading: Permission denied SQL state: 42501 As previously suggested in these cases, I changed the permission of the file (chmod 711 eurasia1.csv or chmod

Unable to mount files in Vagrant

╄→尐↘猪︶ㄣ 提交于 2019-12-11 20:52:09
问题 Error description I'm unable to mount files in Vagrant or Docker, so it seems like it's an issue caused by some kind of a permission error. My OS is Ubuntu 18.04 LTS (Bionic Beaver) , I'm not running any access control modules like SELinux as far as I'm aware. The Docker-related discussion of the error is found in another question: Unable to mount files in Docker Troubleshooting Vagrant As a result I'm unable to mount files into Vagrant boxes (even though I have vboxsf): Vagrant was unable to

Cursor in Mysql has other rights than user?

无人久伴 提交于 2019-12-11 14:32:37
问题 i have two databases, db1 and db2. User man1 had all privileges to db1 but only executing provileges for all functions and procedures in db2. Calling function db2.getValue from db1 is successful and returns correct values, also if call for db2.getValue is nested in a stored procedure. Now i create a stored Procedure proc1 and within this procedure i use a cursor to fetch values (_val1, _val2,--) from a table in db1 and call db2.getValue(_val1). Now somthing really strange happens: The first

Revoke privileges from user in mySQL

冷暖自知 提交于 2019-12-11 13:56:13
问题 For every new user we create in mySQL using the statement CREATE USER newuser@localhost IDENTIFIED BY 'password'; "SHOW GRANTS" is showing only "USAGE ON *.* " privilege. But the user is able to select,insert,.. on "test" and "information_schema" databases and I'm unable to revoke these privileges on "test" using the revoke statement given below. REVOKE ALL ON test.* FROM newuser@localhost; ERROR 1141 (42000) : There is no such grant defined for user 'guest' on host 'localhost' I just don't

Start Command Prompt (CMD) from java as Administrator

牧云@^-^@ 提交于 2019-12-11 12:23:34
问题 I am working on a java project. This project need admin privileges to execute some process in the system. For this is there any way to give admin privileges while starting the project? Is there any way to start command prompt with admin privileges from java? 回答1: Disclaimer: I assume you are asking this specifically for the Windows platform There are two ways I'd recommend: Use the runas program This is the easiest way and since you actually want a console window the password prompt doesn't

Make Directory Part Dynamic In Call To BFILENAME function In Oracle 10g

一曲冷凌霜 提交于 2019-12-11 10:49:44
问题 I am trying to open an existing physical file from file system in a procedure in Oracle 10g. The bfilename function requires a directory and path. I want to pass on the directory such as "c:\abc" directly to the procedure, i.e. I don't want to pass a directory object. The reason is, the directory can change, and I don't know how to create or replace directory inside a procedure (the command always returns error saying that variable is not allowed). I also am not sure about how it works in a

Using celery in a django app to run script with root priviliges?

穿精又带淫゛_ 提交于 2019-12-11 10:43:51
问题 I need to run some commands on my ubuntu box where my django project resides that requires root privileges, from within my django project. I'm using celery to fire off an asynch process, this process in turn calls shell commands that requires root privileges to succeed. How can I do this without risking creating huge security holes? PS! The shell commands I need to call are smbpasswd, edit /etc/samba/smb.conf and restart the samba service. 来源: https://stackoverflow.com/questions/3767841/using