cacls weirdness - TechRepublic
General discussion
August 31, 2006 at 06:12 PM
jrcagle

cacls weirdness

by jrcagle . Updated 19 years, 10 months ago

Hi all,

I’m trying to solve a folders permissions problem for a school. The basic issue is that My Documents gets redirected in a Group Policy setting to personal folders on a server. That server’s D: partition is shared out as, say, MyServer. Because both instructor and student need to read the files, we unclicked the “grant the user exclusive rights to My Documents” checkbox in the folder redirection screen.

Problem: unchecking that box results in the user not getting *enough* permissions to do everything necessary.

Solution (I thought): run a Python script to invoke cacls and add the necessary permissions.

Python is installed on the client XP machines, but not on the server (Server 2003). No problem: I’ll just log in to a client as admin and run from there, using the UNC pathnames.

First attempt:

targetdir = ‘//MyServer/Class1’
for i in os.listdir(targetdir):
fullpath = targetdir + ‘/’ + i
s = ‘cacls “‘ + fullpath + ‘”‘
print s
os.system(s)

That attempt failed. Each command printed correctly :

cacls “//MyServer/class1/username1”
cacls “//MyServer/class1/username2”

but cacls only printed the help information, as if there were a syntax error in the command or as if I had only typed ‘cacls’ with no filename following.

I then reverted to attempting to use cacls manually from the client:

cacls “//MyServer/class1/username”

same deal: I get the help screen. Grr.

Over at the server, I type the local path:

cacls “D:/class1/username”

and get the desired result: acl info. I check; yes indeed, D: is shared out under the UNC path //MyServer. And anyway, the listdir() command worked correctly!

So: why would

cacls “//MyServer/class1/username”

be considered a syntax error? It’s not like cacls told me that the path was invalid or that the file wasn’t available. It just refused to understand that the string in quotes was a file name.

Help?!

Thanks,
Jeff Cagle

This discussion is locked

All Comments