This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: File permissions and VSS failure


"Joseph C. Nemeth" wrote:

> I use tar to package a set of files on Unix boxes (multiple flavors), and
> 'download' them to my NTFS WinXP Pro box under Cygwin, where I maintain
> them using Windows-style tools, including Microsoft Visual Source Safe.
> Then, I 'upload' them back to the Linux box, where they get compiled and
> executed.
> 
> When I 'download' files from Unix, the permissions somehow get messed up,
> and VSS balks with an error 'Access to file 'whatever' denied." The MS Help
> claims this is permissions or a file-locking problem. It turns out, it's a
> permissions problem, but it's deep in the bowels of the software.

So, it sounds like you need to just do "CYGWIN=nontsec tar x ..."
followed by "attrib +R c:\path /s".  nontsec prevents Cygwin from
setting the ACLs and attrib sets the read-only bit.

> file permissions. Getting into the NTFS ACL calls is the usual slog through
> the Microsoft maze of horrors, and is not for the faint of heart: see
> closing notes.

Or just use getfacl/setfacl, cacls, or xcacls.  There's no need to write
code to do this.

> However, you can then go through
> with a simple Windows program that calls the POSIX library _chmod() to make
> the file Read-Only: it won't affect the ACLs, but it will set the Read-Only
> bit and keep VSS happy.

No need to invent anything here either, that program has existed since
the dawn of MSDOS era as 'attrib'.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]