privileges

Get AppData\Local folder for logged user

十年热恋 提交于 2019-12-07 07:18:20
问题 I'm currently using: Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) To retrieve current user's AppData\Local path. The program requires elevated privileges and running it under standard user session throws a prompt requiring administrator's login credentials. Logging as an administrator (different user) apparently changes active user for the program. The returned folder path is thus administrator's and not the one the standard user uses. Expected result: C:\Users

losing capabilities after setuid()

丶灬走出姿态 提交于 2019-12-07 04:50:08
问题 Trying to set cap_setgid , cap_setuid , cap_setpcap . #include <sys/types.h> #include <sys/capability.h> int main() { cap_t caps; caps = cap_get_proc(); cap_value_t cap_list[2]; cap_list[0] = CAP_SETUID; cap_list[1] = CAP_SETGID; cap_set_flag(caps, CAP_EFFECTIVE, 2, cap_list, CAP_SET); cap_set_flag(caps, CAP_INHERITABLE, 2, cap_list, CAP_SET); cap_set_proc(caps); cap_free(caps); setgid(65534); setuid(65534); cap_get_proc(); setgid(0); setuid(0); return 0; } Execution is going under root user.

Struts 2 session management and dynamically displaying jsps

强颜欢笑 提交于 2019-12-07 04:12:23
I am writing an app using Struts 2 framework. It has a login page with username, password and usertype (ex. Administrator, supervisor, analyst etc.) I want to do two things: Session management - logging out, timed logout etc. Display different pages to different users based on the user type. Any help on either/both is highly appreciated. for the first part struts2 already provides out of the box session management all you have to do is to use session aware and let struts2 handle the rest of the work for you.doing login and log out are your own preferred way to implement them, though you can

Is it possible to install into Program Files with limited privileges?

余生颓废 提交于 2019-12-07 02:27:00
问题 I have an application that will be deployed as MSI package (authored in WiX). I am deciding whether to specify elevated or limited privileges as required for the installer. The application does not include anything requiring elevated privileges besides the default install location, which is under Program Files. Now the problem: If I specify elevated privileges , then the user is prompted by UAC for administrator password during the installation. This is not required and prevents non-admin

Install Clang as User (no Root Privileges)?

房东的猫 提交于 2019-12-07 00:25:12
问题 I have access to a shell account at University as a user but with no root privileges. The server is running Ubuntu 8.04 - Hardy. I wish to use Clang as my C compiler for next semester's Unix programming course. GCC is installed but not Clang, and the University's IT dept has, as expected, declined to install Clang on the system. Is it possible to run Clang from my home directory as user? Presumably I would need to compile from source. I need it to compile only C. I don't need C++ or Obj C for

C# WinForm application - How to save connection string (SQLite)

有些话、适合烂在心里 提交于 2019-12-06 21:50:38
I have a winform app in .NET 4.0 with database (SQLite). I need to add an option for user to be able to change the path to the file containing the database - in short, to change the connection string. I used app.config to save connection string like this: <connectionStrings> <add name="connectionString" connectionString="Data Source=D:\myDatabase.db; FailIfMissing=True; Version=3"/> </connectionStrings> Is there a way to allow user to modify app.config file (it is located in Program Files folder)? I do not want to run the app as an administrator, is there a way to give administrator rights to

run cmd with os.system as Administrator

天大地大妈咪最大 提交于 2019-12-06 15:31:22
I am trying to run date command with cmd, but I required to be an Administrator in order to do so. The command is: os.system("date 09/09/1999") Is it possible to run the command with admin privileges without the need to import new libraries? 来源: https://stackoverflow.com/questions/18356353/run-cmd-with-os-system-as-administrator

why does my application work differently when running as administrator?

ⅰ亾dé卋堺 提交于 2019-12-06 11:36:34
问题 I have a small Delphi application that writes a key to the LOCAL_MACHINE registry. When I run it on Windows 7 professional with user that has administrator privileges it fails to write the value, but when I right click and choose "Run as administrator" it does work. The code is: var reg : TRegistry; begin Result := false; reg := TRegistry.Create; reg.RootKey := HKEY_LOCAL_MACHINE; if (reg.OpenKey('Software\YepYep', TRUE)) then Begin try reg.WriteString('ProductKey', Trim(ProductKey)); Result

Running monit as a restricted user and making it watch a process that needs root privileges

旧街凉风 提交于 2019-12-06 10:33:08
问题 I have a specific script written in Ruby that needs root privileges. Most of the other processes don't need that and so were easy to setup in Monit. Not this one. The server needs to listen at 386, and this port is only available for root. I won't get into the details of why, because 1) I'm not a low-level kind of guy, 2) It worked fine so far when using sudo. The monit configuration file is simple and looks like this: set logfile syslog facility LOG_daemon # Default facility is LOG_USER set

How to register interop .net asssembly per user Without Administrator Privileges using InstallShield

孤者浪人 提交于 2019-12-06 10:10:44
问题 I am working on a task not to prompt a normal user a popup(UAC) for approval to install windows Addin application while registering a .net assembly during installation using instalshield. On windows xp, its working fine but during installation on vista and windows 7, a popup comes up for approval. As per the requirement, it shouldnt come. Is there any way to bypass this pop up on vista and windows 7 if UAC is on and registered the assembly per user without administrator privileges? Kindly