privileges

Obtaining admin privileges to delete files using rm from a Cocoa app

强颜欢笑 提交于 2019-11-28 19:50:42
I am making a small app that deletes log files. I am using an NSTask instance which runs rm and srm (secure rm) to delete files. I want to be able to delete files in: /Library/Logs ~/Library/Logs The issue is that the user account does not have permissions to access some files in the system library folder, such as the Adobe logs subfolder and others. For example, only the "system" user (group?) has r/w permissions for the Adobe logs folder and its contents, and the current user doesn't even have an entry in the permissions shown in the Get Info window for the folder. What I want to be able to

What MongoDB user privileges do I need to add a user to a new/another mongo database?

两盒软妹~` 提交于 2019-11-28 18:07:10
问题 I have enabled authentication in the MongoDB config file after adding one admin user with the following privileges: userAdmin and userAdminAnyDatabase . Now I connect with this user to the db where this admin user is defined (otherwise I get exception: login failed ). After I have successfully connected I want to add the a new user to a new database. For that I am trying: use another db.addUser(...) but I get an error: Wed Dec 11 17:45:18.277 couldn't add user: not authorized for insert on

Detect if running with administrator privileges under Windows XP

99封情书 提交于 2019-11-28 17:19:33
I am trying to work out how to detect whether a user is running with admin rights under Windows XP. This is fairly easy to do in Vista/Win7 thanks to the whoami command. Here's a snippet in Ruby for how to do it under Vista: Note, the following link now incorporates the solution suggested by muteW http://gist.github.com/65931 The trouble is, whoami doesn't come with Windows XP and so the above linked method will always return false on WinXP, even if we're running as an administrator. So, does anyone know of a way to detect whether we're running as an admin under Windows XP using Ruby, command

ORA-01950: no privileges on tablespace 'USERS' [closed]

僤鯓⒐⒋嵵緔 提交于 2019-11-28 16:17:26
I'm getting this error: ORA-01950: no privileges on tablespace 'USERS' I have a default tablespace and I'm able to create tables, however, they do not show at the objects tab in Toad. I cannot insert anything into tables I create. You cannot insert data because you have a quota of 0 on the tablespace. To fix this, run ALTER USER <user> quota unlimited on <tablespace name>; or ALTER USER <user> quota 100M on <tablespace name>; as a DBA user (depending on how much space you need / want to grant). 来源: https://stackoverflow.com/questions/21671008/ora-01950-no-privileges-on-tablespace-users

RealUID, Saved UID, Effective UID. What's going on?

柔情痞子 提交于 2019-11-28 15:23:31
This is a set-root-uid program $ls -l -rwsr-sr-x 1 root root 7406 2011-12-13 22:37 ./x* The source code: int main(void) { printf( " UID GID \n" "Real %d Real %d \n" "Effective %d Effective %d \n", getuid (), getgid (), geteuid(), getegid() ); seteuid(600); printf( " UID GID \n" "Real %d Real %d \n" "Effective %d Effective %d \n", getuid (), getgid (), geteuid(), getegid() ); setuid(1000); printf( " UID GID \n" "Real %d Real %d \n" "Effective %d Effective %d \n", getuid (), getgid (), geteuid(), getegid() ); setuid(0); // HOW DOES THIS SUCCEED IN SETTING THE EUID BACK TO 0 printf( " UID GID \n"

C++ MSI Package Administative Privileges

◇◆丶佛笑我妖孽 提交于 2019-11-28 14:49:06
Here is the issue that I am having, I have a C++ application that runs by writing data to .txt files and I want to create an MSI Package for the application. When I build and run my app all is fine but when I run my MSI Setup File the created application does get granted the correct privileges to function. I can't find a way to allow the app to write to the .txt files needed even if I include them in the package and set them as system files. If I "Run as administrator" all is well but that isn't really plausible as I need it to function while "Running as User". Is there anyway to prompt the

How does a program ask for administrator privileges?

Deadly 提交于 2019-11-28 12:48:17
I am working on a small application in VB.NET. The program needs administrator privilege for doing some tasks. Is there a way to ask for administrator privileges during the execution if the program? What is the general way of changing the user account under which the application is running? There are a number of methods depending on your needs. Some details are given in the application developer requirements for UAC . Include a UAC manifest that causes your program to require administrator privileges at startup. Use one of the suggested methods for invoking an elevation to run out of process.

create db and user mysql and set privileges php [closed]

我只是一个虾纸丫 提交于 2019-11-28 11:13:55
Is there a way to create a new MySQL database, a new MySQL user and give the new user privileges on the new database all using PHP? You could do something like this: mysql_connect('localhost','user',password); mysql_query("CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';"); mysql_query("GRANT ALL ON db1.* TO 'username'@'localhost'"); mysql_query("CREATE DATABASE newdatabase"); mysql_close(); You may look at the MySQL documentation on GRANT and CREATE USER Yes, as all these actions can be performed by regular SQL queries. However, I'd refrain from running PHP scripts with database

Programmatically getting UID and GID from username in Unix?

落爺英雄遲暮 提交于 2019-11-28 10:54:16
I'm trying to use setuid() and setgid() to set the respective id's of a program to drop privileges down from root, but to use them I need to know the uid and gid of the user I want to change to. Is there a system call to do this? I don't want to hardcode it or parse from /etc/passwd . Also I'd like to do this programmatically rather than using: id -u USERNAME Any help would be greatly appreciated Have a look at the getpwnam() and getgrnam() functions. You want to use the getpw* family of system calls, generally in pwd.h . It's essentially a C-level interface to the information in /etc/passwd.

How to get all privileges back to the root user in MySQL?

北慕城南 提交于 2019-11-28 09:57:07
I am using MySQL. My root user doesn't have all privileges. How can I get all privileges back to the root user? How to do it step by step? This worked for me on Ubuntu: Stop MySQL server: /etc/init.d/mysql stop Start MySQL from the commandline: /usr/sbin/mysqld In another terminal enter mysql and issue: grant all privileges on *.* to 'root'@'%' with grant option; You may also want to add grant all privileges on *.* to 'root'@'localhost' with grant option; and optionally use a password as well. flush privileges; and then exit your MySQL prompt and then kill the mysqld server running in the