mignonben
(Fresh Scripter)
2008-04-23 06:34 PM
COPY function : little bug

Hi guys,

Consider the following:

1) I don't have NTFS permissions on folder C:\Folder1\Subfolder1
COPY "C:\Folder1\" "C:\Folder2\" /C /S /R /S
=> C:\Folder2\Subfolder1 is created (shouldn't be)

2) I don't have NTFS permissions on folders C:\Folder1\Subfolder1 and C:\Folder1\Subfolder2
COPY "C:\Folder1\" "C:\Folder2\" /C /S /R /S
=> C:\Folder2\Subfolder1 is created (shouldn't be) but C:\Folder2\Subfolder2 is not (ok)

Looks like a bug, isn't it?

Benoit.


Mart
(KiX Supporter)
2008-04-23 06:58 PM
Re: COPY function : little bug

 Originally Posted By: mignonben
Hi guys,

Consider the following:

1) I don't have NTFS permissions on folder C:\Folder1\Subfolder1
COPY "C:\Folder1\" "C:\Folder2\" /C /S /R /S
=> C:\Folder2\Subfolder1 is created (shouldn't be)
....


Yes it should. If you only want the file then add *.* after c:\folder1\ and remove the /S option.


Witto
(MM club member)
2008-04-23 07:23 PM
Re: COPY function : little bug

Did not test this, but quick question:
Are you the owner of the folders?


mignonben
(Fresh Scripter)
2008-04-23 09:06 PM
Re: COPY function : little bug

Thanks for answering.
Owner or not, same result.

I noticed something else.

If you have the following tree :
C:\Folder1
├───SubFolder1
├───SubFolder2
│└───File1.txt
└───File2.txt

and you don't have NTFS permission to access the folder SubFolder1, then
COPY "C:\Folder1\" "C:\Folder2\" /C /S /R /S
creates an empty Subfolder1 and does not copy the other files and folders...

Of course, there is a workaround :
SHELL "XCOPY C:\Folder1 c:\Folder2\ /E /C /H /R /Y"


Gargoyle
(MM club member)
2008-04-23 09:49 PM
Re: COPY function : little bug

Access to the folder and rights to see the folder are two different things, if you can see it, then it can create it.

In the advanced properties of the folder deny the right to see it and test again.


mignonben
(Fresh Scripter)
2008-04-23 10:46 PM
Re: COPY function : little bug

Gargoyle, you are right on one point : access the folder and see it are two different things.
However, there is no NTFS permission to hide a folder or file... The only thing you can do on Microsoft file servers is to enable Access based enumaration on shares to hide folders and files you don't have permissions on.
The behaviour of Kixtart is strange : it cannot access a folder, and if I ask him to copy it, it creates an empty directory and aborts the copy, even with the /C argument.
I don't worry too much about it, because the workaround works perfectly.
Kixtart is great and I use it since several years. Just one detail...


Witto
(MM club member)
2008-04-23 11:26 PM
Re: COPY function : little bug

Copy "C:\0\Folder1\" "C:\0\Folder2\" /C /S /R /S
does not create any subfolder for me in Folder2
I use KiXtart 4.53
What version do you use?
? @KIX


mignonben
(Fresh Scripter)
2008-04-24 12:46 AM
Re: COPY function : little bug

Thanks for replying.

I use version 4.60, but I tried with 4.53 : same problem.

If you want to reproduce the "problem" :
1) create subfolders and files on your "C:\0\Folder1\" folder
2) Remove access (NTFS permissions) to one of them (Everyone deny all on "C:\0\Folder1\Subfolder1" for example)
3) Copy "C:\0\Folder1\" "C:\0\Folder2\" /C /S /R /S

You will see that "C:\0\Folder2\Subfolder1" is created (empty), and the copy is aborted after that creation.


Gargoyle
(MM club member)
2008-04-24 06:15 AM
Re: COPY function : little bug

 Quote:
However, there is no NTFS permission to hide a folder or file

Not true - If you access the advanced properties of a file / folder, you can edit the ACL to not allow the "list folder / read data". This will prevent you from seeing the folder.

If you can see the folder, then KiX can see the folder.


mignonben
(Fresh Scripter)
2008-04-24 07:06 AM
Re: COPY function : little bug

 Originally Posted By: Gargoyle
 Quote:
However, there is no NTFS permission to hide a folder or file

Not true - If you access the advanced properties of a file / folder, you can edit the ACL to not allow the "list folder / read data". This will prevent you from seeing the folder.

Not true - Removing the List permission for the folder prevents the user from gaining access to any file IN THE FOLDER. You cannot set NTFS permission to hide a file / folder and see other file / folder in the same folder, as Novell NetWare can do. If you are not convinced, make the test or read this : http://support.microsoft.com/kb/308419