473,585 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mkdir - do not inherit permissions

53 New Member
Hi,

I'm working on windows here..
i have a script that makes directories, subdirs (mkdir) and I afterwards set special permissions with xcacls trough a system call.

But when I took a closer look at the advanced security permissions, I saw that mkdir makes permission inheritance, when creating the subdirectories:

main dir is ok, but sub dir permissions:
Inherited From: permissions inherited by [main dir]

And I don't want that to happen.
Anyone knows how to do this?? Would using system(mkdir ...) avoid this? Or is there a perl solution (I would prefer)..?
Aug 13 '09 #1
2 4490
numberwhun
3,509 Recognized Expert Moderator Specialist
@ezechiel
That would be an issue with the windows mkdir command, since you are using the system() function. Have you tried using Perl's built in mkdir function? You can set permission through it, but I don't know if that will work since they are Unix type permissions. You can test it though and see. Otherwise, you might have to modify permissions, unless the windows mkdir command has options you can feed it.

Regards,

Jeff
Aug 13 '09 #2
ezechiel
53 New Member
Well, I tried with system(mkdir .. ) and with perl command mkdir..
Both have the same result.

But I found the solution and it is really simple in fact..
(why didn't I thought of it before.. sigh)

Just use xcacls and put the following parameter:
Expand|Select|Wrap|Line Numbers
  1. /I REMOVE
This will uncheck the "inherit from parent folder" checkbox and remove inherited access rights.

Hope this will be usefull to others too..
Aug 14 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1683
by: joelbyrd | last post by:
I'm trying to do a mkdir(), but I'm getting permission denied error, even though I've set the mode to 0777: mkdir($full_path, 0777). I also couldn't do a chmod successfully. The code is something like: mkdir("/home/httpd/vhosts/website.com/httpdocs/dev1/test_folder1", 0777); What's the problem?
5
9263
by: eoindeb | last post by:
I am trying to create a directory on Solaris using the mkdir() function. This works fine when I pass a string literal ("/etc/hosts") to mkdir, but if I try passing a directory pointer to mkdir, it returns a -1 error. The directory error works fine with fopen - does anyone know what I am doing wrong?? Here's a snippet of the code: int...
30
7677
by: MikeC | last post by:
Good People, I'm writing a backup utility that uses a chdir() to go into the source directory (in which the files reside that I want to back up), so I don't want to use chdir() to get into the target directory (where the backup copies will be kept, on another drive). I can successfully test whether the target directory exists or not using...
8
24511
by: vj | last post by:
How do I do the following unix command: mkdir -m770 test with the os.mkdir command. Using os.mkdir(mode=0770) ends with the incorrect permissions. Thanks, VJ
10
2931
Mague
by: Mague | last post by:
Hey, I am using a server of my friends, and i created a directory through php with exec("mkdir $dir") these are now imposible to get into and delete. (well not impsobile, impossible for a kid my age who doesnt no what they have done) It says permission denied i use smartftp and that covers everything i tihnk.has this happened to anyone before...
2
1452
banning
by: banning | last post by:
while($row = mysql_fetch_array($getID)){ $id=$row; $dir='../picture_library/floorplans/'.$id; mkdir($dir,0777); chmod($dir,0777); } ok this is really starting to kill me... i've bee on this for an hour now surfing the net trying to find a solution. I am using a test server that i run on my computer to build sites and then upload...
1
1890
by: B | last post by:
Hi, I am using mkdir to create a directory and upload files to it. Unfortunately the folder is accessible via the url to any user, which is creating problems. How can I manage permissions with mkdir so the folder is not availabe via the url path thanks :)
3
1691
by: fouadk | last post by:
hi everyone.... i am trying to create a folder in my home directory but that ain't working due to permission restriction my code looks like the following: <?php $path = "/home/fouad/testing"; if(mkdir($path,700,TRUE)) {print "success."; }else {print "failure.";} ?>
1
4452
Icecrack
by: Icecrack | last post by:
Good day/night, Im creating a script that creates a folder and moves files inside that folder, the only problem i'm having is when creating the folder if it does not exist, i have tried different methods, mainly come up with permissions denied. codes i have used:
0
7908
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7950
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5389
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.