file-permissions

Win32 file permission sharing violation while deleting a temporary file

I have an application where I am trying to implement a "safe file overwrite" by: Creating a file (A) Filling A with data Copying A to its final destination (B) via SHFileOperation Deleting A using DeleteFile However in step 4 DeleteFile always returns ERROR_SHARING_VIOLATION. The entire process takes milliseconds, so I can't imagine...

Apache & PHP folder permissions

Hi, Our PHP scripts create dynamic folders and files and we are having a permission issue. The folders were initially create using our ftpuser. EG: Album (created by ftpuser) all subfolders and files in them have to be dynamically created. The apache user is the user when a new folder is created and then it cannot write anything to that...

File handling with non-administrative user.

I've been testing my application to see how well it works when run by a non-administrative user, and I have found problems with file handling. I am getting an UnauthorizedAccessException when trying to overwrite a file, if the file was created by and adminstrative user. When writing out the file I first create the file as a .tmp file, ...

"Access to the path ... is denied" (.NET C#)

Hi! I've been saving a small XML data file to an external drive, no probs. But then I tried to use the ApplicationData folder and others, even C:\ but no luck. I'm getting an error like "Access to the path "C:\" denied". Just to confirm, the file is created and read fine with the current code, to an external drive. I guess this is some...

Migrate folder user permissions in a windows file server migration

Before all i'm not a windows administrator so that perhaps this question is totally nosense. We are going to migrate our windows file server to another machine, the people who is going to do the job know how to replicate the folders and files (copy/paste perhaps?) but they don't know how to migrate the file and folder user permissions. ...

uploading images

Hi, I got this error when I'm uploading the image into the folder: Warning: fopen(images1/image.jpg) [function.fopen]: failed to open stream: Permission denied. i gave read/write permissions. but its not working.How to rectify this error? Anyone can help me please? Regards, padma. ...

How to use Ant tar task and preserve file permissions?

Of course it can be done using exec task, but my question is: Is it possible to do it with tar task? ...

File permissions do not inherit directory permissions

I have a program that's creating a secure directory for user output. This is working correctly, but the files I create in it (or copy to it) are ending up with only administrator access. DirectoryInfo outputDirectory = baseOutputDirectory.CreateSubdirectory(outputDirectoryName, GetDirectorySecurity(searchHits.R...

How to protect downloadable files in a remote directory from non-premium users (in php?)

Im building a "premium" section of my site and Im in a need to give download access to files in a remote directly (on a different server), to users with special privileges (accounts stored in mysql db). My site is coded in php/mysql so a php solution would be great. ...

Access to the path '\\Image0\Abc' is denied.

var directory = new DirectoryInfo( "\image0\Abc" ); if (!directory.Exists) { directory.Create(); } when I user above asp.net code which unc path, I found the following problem. How can I solve? Access to the path '\Image0\Abc' is denied. Regards, atk ...

python fileinput changes permission

In my python code, I use the fileinput module for inplace replacing: import fileinput for line in fileinput.FileInput("permission.txt",inplace=1): line = line.strip() if not 'def' in line: print line else: line=line.replace(line,'zzz') print line fileinput.close() However, once it is done, permis...

modify file content

I'm installing a lighttpd server on a remote machine using a bash script. After installation, I need to configure the port for the server. The system says I don't have permission to modify the file /etc/lighttpd/lighttpd.conf even though I do sudo echo "server.bind=2000" >> /etc/lighttpd/lighttpd.conf How shall I modify this? ...

How to get permission to edit the file apache2.conf? [Ubuntu]

Hello there, I'm a beginner Ruby on Rails Programmer and I'm trying to install Apache2 + Passenger(That's for Rails Deployment).. and at the end of the installation process, Passenger gave me a few lines to add to the file apache2.conf at /etc/apache2/ but I can't override this file.. I have no permission =( I've also uploaded an image s...

Detect underlying cause for java.io.FileNotFoundException

FileNotFoundException is thrown on all sorts of occasions - not necessarily only when the file name is invalid, but also when e. g. permissions do not allow a file to be created or read: java.io.FileNotFoundException: \\server\share\directory\test.csv (Anmeldung fehlgeschlagen: unbekannter Benutzername oder falsches Kennwort) at jav...

How do I change the permissions that MySQL uses to create database directories and files?

I have a self-installed MySQL service running on my OS X Snow Leopard machine, compiled using the automated installer from mysql.com. The problem I'm having is that I want to sync my database files, from the "data" directory, using Dropbox. All directories and files created within that folder are being assigned to the user "_mysql" and ...

svnadmin create ignoring sticky group bit on directory

I am using Subversion with Apache and want a normal user (i.e. non-root) to be able to create new repositories. I thought this would be easy enough to do using a parent directory with group www-data and the group sticky bit set. Unfortunately "svnadmin create ..." leaves only its db directory with the sticky group not set. How can I get...

java security manager

grant { permission java.io.FilePermission "C:\\class\\*", "read, write"; permission java.lang.RuntimePermission "createClassLoader"; }; My policy.txt java.security.AccessControlException: access denied (java.io.FilePermission c:\class read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java...

Set directory permissions with inheritance during application installation?

I found a thread on the Microsoft Forums where the answer tells how to set directory permissions using the LockPermission table. I tried it, but it doesn't seem to set the inheritance for any of the subdirectories. I need to be able to set the permissions for a particular folder that I create and have those permissions be inherited by al...

How to unit test file permissions in NUnit ?

I'm trying to unit test file read operations. In this scenario I also need make sure that, if a particular user don't have read access he should get an exception... But somehow I'm unable to get it working, can anyone suggest something? PS: I'm using Rhino mock and NUnit ...

initiating a program that has more user privilages in restricted user

Hi All! I have users with limited access granted to one of my hard drives. Those users are not given the permittion to delete the files in that drive. but I have a application that should allow those users to delete files in the above mentioned drive. 1) How can I do this? 2) When a low priviliaged user loged to my application, can I ...