Admin can read user file from bash, despite permissions
I have a power user file that has go-rwx. However, the administrator account can less the contents from a bash command line. This is both logging onto Windows 2000 as admin, as well as ssh'ing in (loopback) from the power user log-in session. The administrator can also mv the file to a different name, but it can't create a new file in the same folder e.g. by cp. CACLS shows an extensive set of permissions for the power user owner, but only READ_CONTROL, FILE_READ_EA, FILE_READ_ATTRIBUTES for LaptopName\None and Everyone. I've come across nothing on the web (yet) about a special privilege that allows administrators the level of access that it seems to have. In fact, if I just open up a DOS shell as Administrator, I cannot more the said file. So it seems to be specific to Cygwin rather than Windows. I've read up on ntsec in the Cygwin user guide, but nothing seems to explain the admin access to the file. However, it is new material to me, so I might be missing it. If the explanation is there, could someone point to the particular paragraph, and perhaps elaborate on how that explains the access I observe? If the explanation isn't there, what is the explanation? Thanks. -- 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/
Re: Admin can read user file from bash, despite permissions
Brian Dessent wrote: Gmane User wrote: CACLS shows an extensive set of permissions for the power user owner, but only READ_CONTROL, FILE_READ_EA, FILE_READ_ATTRIBUTES for LaptopName\None and Everyone. I've come across nothing on the web (yet) about a special privilege that allows administrators the level of access that it seems to have. In fact, if I just open up a DOS shell as Administrator, I cannot more the said file. So it seems to be specific to Cygwin rather than Windows. Um: http://cygwin.com/ml/cygwin/2008-04/msg00218.html This is the relevant part: Cygwin uses this to simulate the unix semantics of root (i.e. total access to anything regardless of permissions) Thanks for reiterating, 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/
Re: Admin can read user file from bash, despite permissions
Corinna Vinschen wrote: On Apr 10 04:19, Gmane User wrote: I have a power user file that has go-rwx. However, the administrator account can less the contents from a bash command line. This is both logging onto Windows 2000 as admin, as well as ssh'ing in (loopback) from the power user log-in session. The administrator can also mv the file to a different name, but it can't create a new file in the same folder e.g. by cp. CACLS shows an extensive set of permissions for the power user owner, but only READ_CONTROL, FILE_READ_EA, FILE_READ_ATTRIBUTES for LaptopName\None and Everyone. I've come across nothing on the web (yet) about a special privilege that allows administrators the level of access that it seems to have. In fact, if I just open up a DOS shell as Administrator, I cannot more the said file. So it seems to be specific to Cygwin rather than Windows. [...] what is the explanation? The secret word for tonight is Privileges. See http://msdn2.microsoft.com/en-us/library/bb530716(vs.85).aspx Administrators have the SE_BACKUP_NAME privilege by default. Cygwin opens the files with the FILE_FLAG_BACKUP_SEMANTICS flag set, see http://msdn2.microsoft.com/en-us/library/aa363858.aspx So, all accounts with the backup privilege (usually admins and backup operators) can open all files. That's the same as with the root user on UNIX. It does not work with the standard Windows tools, because these tools don't open files with FILE_FLAG_BACKUP_SEMANTICS. Sort of an obfuscation, if you ask me. cp doesn't work because the current release of Cygwin doesn't use the FILE_FLAG_BACKUP_SEMANTICS flag in every necessary place so far. Thank you, Corinna. That was very informative. BTW, I found this site to be invaluable for those ramping up: http://www.pluralsight.com/wiki/default.aspx/Keith.GuideBook/WhatIsAPrivilege.html Cheers! -- 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/
Re: Admin can read user file from bash, despite permissions
Gmane User wrote: Brian Dessent wrote: Gmane User wrote: CACLS shows an extensive set of permissions for the power user owner, but only READ_CONTROL, FILE_READ_EA, FILE_READ_ATTRIBUTES for LaptopName\None and Everyone. I've come across nothing on the web (yet) about a special privilege that allows administrators the level of access that it seems to have. In fact, if I just open up a DOS shell as Administrator, I cannot more the said file. So it seems to be specific to Cygwin rather than Windows. Um: http://cygwin.com/ml/cygwin/2008-04/msg00218.html This is the relevant part: Cygwin uses this to simulate the unix semantics of root (i.e. total access to anything regardless of permissions) Thanks for reiterating, Brian. Oh, I should have mentioned that Diskeeper probably uses the privilege since it managed to defrag the files that the built-in defragger, JkDefrag, and Ultra Defragmenter could not. -- 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/
Re: A FAQ regarding defrag and permissions of nonadmin files?
Brian Dessent wrote: Gmane User wrote: Let's make sure we're comparing the same situation. I've used bash to explicitly change permissions to go-rwx for most of my files. This is To be pedantic, you used chmod (or some other utility); bash is just a shell, it does not set permissions. on a nonadmin account. This is what chokes the defragger. Do you have the same circumstance? Yes, I just ran the series of commands in the previous mail as a non-administrator user, creating a file in 2 fragments. I then switched to a user in the administrators group and ran OO defrag (though the user that launches the job shouldn't matter as OO runs decoupled as a service anyway) and the file was defragmented. I didn't see the line where you switched users. Note that Win32 has a backup API which allows any user with the 'backup' privilege in their token to open any file, regardless of its ACL. Cygwin uses this to simulate the unix semantics of root (i.e. total access to anything regardless of permissions) and so for example the file I created with mode 600 as a regular user was completely readable from Cygwin when logged in as a user in the administrators group, even though the permissions/ACL deny it. I suspect that OO and most other defrag programs use this same technique. I haven't run across a description of the backup privilege, but then again, I only dug into NTFS permisssions with any seriousness today. If Ultra Defragmenter does the job, I'll save the deeper digging for another day. Here are my observations on the leadup to Ultra Defragmenter. JkDefrag's boot-time defrag is merely a scheduled task. It must be scheduled outside of safe mode, else the task scheduling service isn't running and it isn't scheduled properly. It doesn't run at all. Even after booting up outside of safe mode, the tasks exists, but doesn't launch upon booting. So it must be deleted after a normal boot, then scheduled again. JkDefrag's boot-time defrag didn't work as I expected. It doesn't arrest the boot process while it runs the defrag. So the boot process proceeds as normal, with the exception of being very slow because of the defrag process that was launched during boot-up. This means that Symantec AV is running during the defrag, as are the full suite of tools that are launched during a normal boot ie. many more than in safe mode. I don't want to fool around with the AV because it is set the way it is according to the policy of the place where I work. So I tried again to boot in safe mode to see if the now-properly-scheduled defrag will run. It didn't. I then installed Ultra Defragmenter. Good news is that it seems to stop the boot process while it does its thing. There are no progress indicators that change during this period. After 20 minutes, the boot process continues. I logged in and tried to find the report that is supposedly generated. It was nowhere to be found, even though the report settings have reports enabled (from the GUI). Since the report settings specify HTML output, I searched the hard disk for an HTML file dated within the last day, but found nothing. A google and usenet search does not turn up mention (or even a question) of the path for the html report. The Fragmented button doesn't do anything, either. Would you know if the boot-time defrag occurs before Symantec AV launches? (Note that the AV doesn't show up as a process in safe-mode). Where would the report be located? Thanks! -- 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/
Re: A FAQ regarding defrag and permissions of nonadmin files?
Brian Dessent wrote: Okay, so JkDefrag's boot time defrag does not appear to be a real boot-time (offline) defrag. Anything dealing with the task scheduler is way too late in the game, Win32 is already running at that point. I wonder why anyone want to do that under a permissions-limited account. I doubt that the boot-time defrag generates a report. It's not intended to be a full service defrag, it's only for system files that are normally locked (offline defragmentation.) When you schedule the boot time defrag you have to specifically include a list of patterns and the default only includes things like the hives and pagefile. ...snip... I'm not sure what you mean by no progress indicators, as every time I've used it (and any other offline defrag for that matter, such as Sysinternals' pagedfrg), it displays some text saying what it's about to do, with a 3 second opportunity to press a key to abort, followed by textual percent meters of analysis and defrag stages, just like CHKDSK. I must have missed that 3 seconds. But at the bottom, there is a line of dashes that never changed for the duration of the activity. I believe it was prefixed with a label having to do with analysis. I am trying again with specificatin of * in the file inclusion list. About the log file, you're right. You need another analyze after normal boot. It generates c:/FRAGLIST.HTM, which can be saved as text. Turning off the switch to produce HTML doesn't generate a text file, so I guess it's HTML or nothing. Fingers crossed with * in the file inclusion list. -- 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/
Re: A FAQ regarding defrag and permissions of nonadmin files?
Dave Korn wrote: Andrew DeFaria wrote on 08 April 2008 16:51: Gmane User wrote: About the log file, you're right. You need another analyze after normal boot. It generates c:/FRAGLIST.HTM, which can be saved as text. Turning off the switch to produce HTML doesn't generate a text file, so I guess it's HTML or nothing. Actually HTML is text. It's surely not binary! Every character in an HTML file is printable, for example. That's very interesting, but surely a bit off-topic - I thought this mailing list was meant to be all about defragmentation software, not text-vs-binary file formats? Or in other words, could this thread please be TITTTL'd? cheers, DaveK Arg. Andrew. My thread TITTTL'd! :( I thought this was cygwin related because all the affected files are mostly involved with my use of Cygwin. And normal Windows users don't go about finangling file permissions in the manner that unix users do. Hence (I thought) they won't often encounter similar issues with defrag related to permissions. However, no one else has chimed in about similar problems, so perhaps the problem goes beyond cygwin and unix file permissions on a Windows box. I will try to further to resolve it in a windows/defrag forum. Just as a wrap-up, however, can a few people please say whether they actually set their nonadmin files to go-rwx, and are actually able to defrag their whole disk without stubborn user files? I don't even know whether I'm an exception in this practice of setting file permissions, aside from the defrag problem. My experiment with boot-time defrag has not solved the defrag problem, even after specifying * for the files to defrag. Thanks. -- 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/
A FAQ regarding defrag and permissions of nonadmin files?
Today was a revolutionary day. Ever since I started using cygwin years ago, I just assumed that defrag was doing whatever it does best, and that it was normal to have a whole whack of user application files un-defragged. This list of fragged files got enormous over the years, and almost all the files were related in some way to cygwin, either in the c:/cygwin tree or had been manipulated from bash. Having to replace the drive with 4200 RPM didn't help, and all the googling and usenetting in the world didn't reveal the cause for those stubborn files. I could feel the lifetime draining out of the overworked hard drive. My life force was draining along with it, as I sat catatonically watching the LED blink and listening to the disk chatter. Occasionally, I'd wake up with a start, only to find that I had done so prematurely, as more waiting was in order. I was all set to do something drastic, like buy commercial defraggers, or purchase Ghost and a new hard disk so as to clone the current hard disk into a defragged incarnation. All this for a slow 30GB drive on a laptop that's a better part of 10 years old, whose housing and processor fans were probably near death (probably because of dust buildup, causing them to kick in even when XWin took up a few percent of CPU to blink gvim's cursor). Since the venerable laptop only had USB1, the bandwidth requirements of the cloning solution would also require purchase of some kind of card bus adapter. (Unless the drive could fit into the bay currently occupied by the CD burner) Well. Before launching into something so foolish, I was going to try a free defragger. If the system got toasted, that would be the guy upstairs signalling that it was time for a new laptop -- preferrable to spending some unknown number of days with a new drive, reinstalling Windows 2000 and recustomizing the environment to the way it was before. So much the truer if it was the disk controller that went. The defragger I used was JkDefrag. And there was the explanation, right in the online documentation. The files to be defragged need to be accessible by admin. I never suspected that something as system-wide as defragging would be dependent on a specific account. Setting all files to go+rwx allows all the files to defrag. This arrangement clashes directly with the unix practice of having all nonadmin user file permissions default to u+rw,go-rwx. A unix user (not necessarily an admin, as I've never been) who wanders into the weird and wonderful world of Windows would think he/she found salvation in cygwin (and would mostly be right). He/she (let's just say It) would innocently and obliviously bring its Unix ways with it, and never be able to defrag. I am baffled by why this caveat isn't documented in any defrag or cygwin posting/page that I've come across. In any case, I'm quickly ramping up on the weird, wondrous world of NTFS permissions to allow admin access to my files without granting it to group and others. Currently doing it through the the Windows GUI, as the Cygwin documentation gets quite deep. I suspect, however, that it might be necessary to go the way of cygwin to hierarchically set things as required, though that will reveal itself soon enough. In any case, considering the aforementioned default ways of unix users, and the absence of documentation of caveats for defragging...perhaps this can be made a FAQ? -- 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/
Re: A FAQ regarding defrag and permissions of nonadmin files?
Brian Dessent wrote: Gmane User wrote: The defragger I used was JkDefrag. And there was the explanation, right in the online documentation. The files to be defragged need to be accessible by admin. I never suspected that something as system-wide as defragging would be dependent on a specific account. Setting all files to go+rwx allows all the files to defrag. This arrangement clashes directly with the unix practice of having all nonadmin user file permissions default to u+rw,go-rwx. A unix user (not necessarily an admin, as I've never been) who wanders into the weird and wonderful world of Windows would think he/she found salvation in cygwin (and would mostly be right). He/she (let's just say It) would innocently and obliviously bring its Unix ways with it, and never be able to defrag. I am baffled by why this caveat isn't documented in any defrag or cygwin posting/page that I've come across. This is just patently false. While it may be true that a defrag program that runs in userspace needs access to a file to defrag it, that does not in any mean that some special admin user needs access to it. And besides, most defraggers install as a service anyway, so they run as the system. ...snip quite illustrative example for brevity... The file has been defragmented and there was no need for any chmod go+rwx. For the record I took a look at JkDefrag's source at some point in the past and it made me shudder how badly coded it was. I suggest UltraDefrag which is open source and free and it installs a native driver to do the defragmentation so there is none of this worrying about who owns a file or what ACLs it has. Since it has a native interface it can even run at bootup before files such as pagefile.sys are locked. I'm defragging the whole disk, so I need the defragger to be able to access all files from whatever account it runs under. Bear with me if I mention something inaccurate, as I've just started reading up on the concepts today. Corrections are welcome. About defragging as a service, http://support.microsoft.com/kb/120929 says that the System account has no more permissions than an admin account. About defragging on boot-up, JkDefrag does this too, but still needs an account to run under. Is it possible for a defrag (or a process) to run not under any account? That is, does Ultra Defragmenter actually do this? Ultra Defragmenter would have been my first choice, except that I ran into this caveat: http://groups.google.ca/group/alt.comp.freeware/browse_frm/thread/377f0ea5602cc584/855cc4e01f835029. I described in my original post the barriers to ghosting in my obsolete system, so I'm reticent to experiment with developmental defraggers until they built up a bit of a track record. This decision has more to do with safety than how well the algorithm may be coded up. -- 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/
Re: A FAQ regarding defrag and permissions of nonadmin files?
Brian Dessent wrote: Gmane User wrote: I'm defragging the whole disk, so I need the defragger to be able to access all files from whatever account it runs under. I've never had any problem doing that without having to specifically loosen any ACLs. Let's make sure we're comparing the same situation. I've used bash to explicitly change permissions to go-rwx for most of my files. This is on a nonadmin account. This is what chokes the defragger. Do you have the same circumstance? About defragging as a service, http://support.microsoft.com/kb/120929 says that the System account has no more permissions than an admin account. I use OO Defrag, it runs as a service as NT AUTHORITY\SYSTEM, and it defrags all my Cygwin files just fine without needing to set any special permissions. It has been the same way with every other defrag program I've used too. About defragging on boot-up, JkDefrag does this too, but still needs an account to run under. Is it possible for a defrag (or a process) to run not under any account? That is, does Ultra Defragmenter actually do this? Ultra Defragmenter would have been my first choice, except that I ran into this caveat: At the point where UltraDefrag runs only the kernel and drivers have loaded, the Win32 subsystem and the SAM do not even exist yet -- this is the whole point of doing it that early in the process, so that things like the registry hives are not yet open and locked. So I think this runs in the absence of any user context. And even when doing a normal defrag, UltraDefrag does the actual processing in kernel mode as a driver and at that level there are no access restrictions whatsoever. Hmm. That raises questions in my feeble mind. I wonder why JkDefrag requires the specification of a user account for the boot-up defrag. Anyway, I will try Ultra Defragementer. Thank you for the reassurance and explanation below. I have my fingers crossed. Actually, I'll try a boot-time defrag with JkDefrag first. But Ultra is next, if the same problems arise. http://groups.google.ca/group/alt.comp.freeware/browse_frm/thread/377f0ea5602cc584/855cc4e01f835029. I described in my original post the barriers to ghosting in my obsolete system, so I'm reticent to experiment with developmental defraggers until they built up a bit of a track record. This decision has more to do with safety than how well the algorithm may be coded up. Keep in mind that all of these things are using the same code for the heavy lifting of actual defragmentation. That is implemented in the NTFS.SYS filesystem kernel driver; none of the tools actually touch the raw disk, they just send an IOCTL to the filesystem telling it to move a file extent from A to B. The only thing that differs is the high level algorithm that decides what goes where, but none of them do the actual moving. The risk of data loss therefore is more or less constant and does not depend on which tool is being used, as I see it. -- 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/
Re: Home directory
Warren Young wrote: Gmain User wrote: Thanks, Brian. I was actually asking in the context of not updating cygwin right away. Whether or not one could access up-to-date accumulation of release notes, possibly on the web. Cygwin doesn't have monolithic releases. Every individual package is on its own release schedule. It's meaningless to talk about release notes at a higher level than the package level, in the current scheme. What you say makes perfect sense. The specific package I was referring to was coreutils. Unfortunately, the quoting containing the relevant thread details had to be trimmed because of the limit on quoting when posting through gmane, which was the case in some of my posts. Don't get me wrong, gmane is great, it's just a circumstance that needs to be pointed out as a factor contributing to this confusion. -- 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/
Re: Home directory
Eric Blake wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Gmain User on 10/1/2007 10:04 AM: Is there somewhere online where the release notes can be perused so that I can avoid updating cygwin right away? I usually find that an update is followed by a period of anomalous behaviour. [Phooey. Hit send too soon.] Yes - it is called the release announcements: http://cygwin.com/ml/cygwin-announce/ I did indeed check that before posting to ask about where release notes can be found. In fact, they can be found peicemeal at http://tinyurl.com/2dxno3, but it makes it hard to quickly scan for changes to mv. Many software systems have cumulative release notes with each new release...would the release notes can be findable in such a form online? -- 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/
Re: Home directory
Brian Dessent wrote: Gmane User wrote: If I were make c:/cygwin/home/UserName my home directory, what is the best way? Ssh only considers /etc/passwd, so it seems best to manually set it there, though I'd have to manually fix it each time I recreate it. It still seems to be the best way, but opinions are welcome on good practice. Well you already said it -- sshd only considers the entry in passwd so that's pretty much the only option if you plan to connect remotely. However, you should use a POSIX path like /home/UserName not c:/whatever. Indeed. I guess that's it. On the other hand, it occurred to me that it might be worthwhile to uninstall cygwin, then reinstall it on a secondary IDE drive (not drive c:), along with the cygwin user file/folder tree. It has a lot more space, so I can forget the network drive altogether. I was initially trying to avoid the secondary drive because I fully expect suprises and a brand new learning experiences due to the unconventional location. But I can always give it a go. The only issue at hand is time. -- 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/
Home directory
ACcording to http://cygwin.com/faq/faq.setup.html#faq.setup.home, the cygwin home directory is determined by the checking the following, in the order listed: 1. Windows HOME environment variable 2. /etc/passwd 3. HOMEDRIVE and HOMEPATH variables in the Windows environment 4. / I recently got a new domain account, and the cygwin home directory is a network drive, instead of c:/cygwin/home/UserName. I am currently trying to research the causes, though I don't have access to the machine in question at the moment. I assume that the path to the home directory was embedded in /etc/passwd, which I created using mkpasswd -d. I am debating on manually changing this in /etc/passwd back to c:/cygwin/home/UserName, since I might ssh into the machine, in which case the network drive will likely not be accessible. As well, working off a network drive by default makes one more vulnerable to network problems. The only thing which might make the network drive attractive is the limited space on the local drive. If I were make c:/cygwin/home/UserName my home directory, what is the best way? Ssh only considers /etc/passwd, so it seems best to manually set it there, though I'd have to manually fix it each time I recreate it. It still seems to be the best way, but opinions are welcome on good practice. Thanks. -- 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/
Re: error when starting X-Win
Larry Hall (Cygwin X) wrote: Gmane User wrote: snip Which made me think wouldn't it be nice if mounting didn't have to be done for each user account?. I install cygwin on whatever machine (of several) that I happen to work on, so such a global fix would make life easier. And there is a solution. With a bit of refresher from the unix shell newsgroup, I was prompted into realizing that startxwin.sh launches XWin in the background, which allows the PID to be captured with $!. So if one really wanted to, startxwin could use wait with XWin's PID to wait for XWin to finish, after which it deletes /tmp/.X11-unix. No need to maintain user-specific /tmp mounts. One could probably create a start-menu shortcut that invokes startxwin.sh with the run command, similar to the way it is used in startxwin.bat. If memory serves me correctly, this was talked about before and perhaps even implemented. If the latter is actually true, then it got lost at some point (perhaps about the time that the Cygwin-X maintainer was lost ;-) ). Yeah, well, it's probably not the end-all-be-all solution. It occured to me that if the startxwin.sh script got interrupted somehow e.g. due to forced shutdown, power outage, logoff, or kill, then it never runs the command that erases /tmp.X11-unix. Are you the new maintainer? -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: error when starting X-Win
Larry Hall (Cygwin X) wrote: Gmane User wrote: Martin Bartak wrote: Hello, How to delete /tmp/.X11-unix/X0 automatically when closing X-session or, how to prevent its emergence when starting X-sesion or, how to make it re-writable by 'non-Administrator' user? I've got Cygwin 1.5.23-2 (full installation) on WinXP with two user accounts. I use 'startx' command to invoke X-Win with default parameters or options. When starting X-Win, a file named 'X0' is placed into /tmp/.X11-unix/ and it probably locks the X-server for current user (?) This file persists after exiting from X-Win and also after exiting from Cygwin. No problem if I start Cygwin and X-Win again as the same user, but when I login as another user (different from Administrator) X-Win cannot be started unless the previous X0 file is deleted. I have sshd installed, so I ssh into the account that owns /tmp/.X11 and remove it. Better yet, I simply have the same account starting Xwin all the time. For example, if user1 is the Xwin account and I am logged in as user2, I can ssh into user1 to start Xwin. Or simply do Start-run, then use the runas command to run startxwin.bat as user1 (full program path required). The user2 login session hasn't been interrupted; you just need to export DISPLAY=:0.0 and then start launching X applications. The standard way this has been handled in the past is to set up a mount point for '/tmp/' to a unique location. In a default Windows installation, the following should work (untested): mount -b -u $TEMP /tmp This keeps things unique for each user anyway. That's quite cool. I decorated it a bit to keep it all within my cygwin file space. Specifically, in my all-purpose ~/Temp directory: mkdir -p ~/Temp/tmp mount -b -u c:/cygwin/home/${USER}/Temp/tmp /tmp Thanks! -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: error when starting X-Win
Larry Hall (Cygwin X) wrote: Chris Sutcliffe wrote: The standard way this has been handled in the past is to set up a mount point for '/tmp/' to a unique location. In a default Windows installation, the following should work (untested): mount -b -u $TEMP /tmp This keeps things unique for each user anyway. That's quite cool. I decorated it a bit to keep it all within my cygwin file space. Specifically, in my all-purpose ~/Temp directory: mkdir -p ~/Temp/tmp mount -b -u c:/cygwin/home/${USER}/Temp/tmp /tmp When I try to execute the mount, I get: $ mount -b -u $TEMP /tmp mount: /tmp: Invalid argument Is there something I'm missing? No, not really. It's shame on me for not trying the syntax I was offering first. If you're doing this from inside a Cygwin shell, use: mount -b -u $(cygpath -ma $TEMP) /tmp Shame shame shame :) Actually, I ran into a wrinkle. My /c/cygwin/home/user is soft- linked to another location on the local hard drive. This seems to foil the attempt to mount c:/cygwin/home/user/Temp/tmp. I had forgotten about that file path redirection. After some bumbling to discover it, I found that your mounting method works if the real path is used. Which made me think wouldn't it be nice if mounting didn't have to be done for each user account?. I install cygwin on whatever machine (of several) that I happen to work on, so such a global fix would make life easier. And there is a solution. With a bit of refresher from the unix shell newsgroup, I was prompted into realizing that startxwin.sh launches XWin in the background, which allows the PID to be captured with $!. So if one really wanted to, startxwin could use wait with XWin's PID to wait for XWin to finish, after which it deletes /tmp/.X11-unix. No need to maintain user-specific /tmp mounts. One could probably create a start-menu shortcut that invokes startxwin.sh with the run command, similar to the way it is used in startxwin.bat. On a separate but related note, I found that launching XWin from an ssh session doesn't result in XWin or xterm showing up on the computer screen, even though the processes are running. Depending on whether I use the sh or bat startup script, xterm might not even be able to connect to the X server. Cygstart is also unable to open up applications on the screen when launched from an ssh session. It is possible that no such similar effects would plague the shortcut that invokes the above modification of startxwin.sh. It remains to be tested, and the hour is late and tomorrow (technically today) is an early day, so I put it on my list of things that would be nice to try some time. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: error when starting X-Win
Martin Bartak wrote: Hello, How to delete /tmp/.X11-unix/X0 automatically when closing X-session or, how to prevent its emergence when starting X-sesion or, how to make it re-writable by 'non-Administrator' user? I've got Cygwin 1.5.23-2 (full installation) on WinXP with two user accounts. I use 'startx' command to invoke X-Win with default parameters or options. When starting X-Win, a file named 'X0' is placed into /tmp/.X11-unix/ and it probably locks the X-server for current user (?) This file persists after exiting from X-Win and also after exiting from Cygwin. No problem if I start Cygwin and X-Win again as the same user, but when I login as another user (different from Administrator) X-Win cannot be started unless the previous X0 file is deleted. I have sshd installed, so I ssh into the account that owns /tmp/.X11 and remove it. Better yet, I simply have the same account starting Xwin all the time. For example, if user1 is the Xwin account and I am logged in as user2, I can ssh into user1 to start Xwin. Or simply do Start-run, then use the runas command to run startxwin.bat as user1 (full program path required). The user2 login session hasn't been interrupted; you just need to export DISPLAY=:0.0 and then start launching X applications. A problem occurs if user2 doesn't have authentication info to login as user1 or run applications as user1. Maybe there is a way to modify startxwin.bat or startxwin.sh. Have the script wait for the Xwin command to finish, and then have it remove /tmp/.X11. That way, whoever launches Xwin via startxwin.{bat,sh} also removes /tmp/.X11 upon completion. I've only looked at startxwin.bat script for any nontrivial amount of time, and I know that you can have script wait for Xwin to complete by modifying the %RUN% command that launches it. %RUN% is fancy invocation of the run command, and getting help on that shows that the -wait switch will cause the script to pause until launched applications ends before continuing. There is a problem I haven't figured out -- how to have startxwin.bat wait for Xwin to finish, yet still proceed to launch xterm *before* it starts to wait. I'm sure those who are wizards in scripting, signals, and things who can figure it out, but that is a foggy area for me at best. I have my eyes peeled for the chimings-in of such experienced people, in case they respond. Meanwhile, you can comment out the xterm line and launch it from another bash shell e.g. opened from the Start Menu (not elegant, I know). -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: Clean way to auto-read ~/.Xresources
Gmane User wrote: I install cygwin as admin, and want to change the X resources for one of the user accounts. Hence I don't want to change the global file /etc/X11/app-defaults/XTerm for different xterm font bindings. Instead, I put xrdb -merge %HOME%/.Xresources Correction. %HOME% doesn't seem to work on Windows XP, though it works on my Win2K box. And I forgot %RUN% above. I have the following new and improved xrdb invokation immediately following the launch of XWin in startxwin.bat, and preceding the launch of xterm: %RUN% xrdb -wait -merge ~/.Xresources Fortunately, the squiggle gets passed to bash for interpretation. Oddly enough, even though -wait follows xrdb, it is actually a switch for the run command, which is bundled up in %RUN%. It ensures that xrdb is finished before the startxwin proceeds to the line that launches xterm. If I was keener, I'd replace the xrdb line with an invocation to a bash script that first tests for the presence of ~/.Xresources (I'm not familiar with M$ scripting). As it is, however, it causes no problems when ~/.Xresources is absent. in startxwin.bat, after Xwin is launched. Being aversive to changing global files, I wonder if there is a way for the user to decide where to put Xresource specifications to be automatically read? I notice that /etc/X11/xinit/xinitrc causes ~/.Xresources to be read, but xinitrc doesn't get sourced regardless of whether I start X with startwin.bat or startxwin.sh. I prefer to use startxwin.bat. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Clean way to auto-read ~/.Xresources
I install cygwin as admin, and want to change the X resources for one of the user accounts. Hence I don't want to change the global file /etc/X11/app-defaults/XTerm for different xterm font bindings. Instead, I put xrdb -merge %HOME%/.Xresources in startxwin.bat, after Xwin is launched. Being aversive to changing global files, I wonder if there is a way for the user to decide where to put Xresource specifications to be automatically read? I notice that /etc/X11/xinit/xinitrc causes ~/.Xresources to be read, but xinitrc doesn't get sourced regardless of whether I start X with startwin.bat or startxwin.sh. I prefer to use startxwin.bat. Thanks! -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: cscope -d can't find trailer offset if path contains space
Frodak wrote: - Original Message From: Gmane User To: cygwin Sent: Friday, January 12, 2007 1:16:32 AM Subject: Re: cscope -d can't find trailer offset if path contains space By the way, Dave, if you're going to be poking prodding mlscope, I was wondering if you might have time to look at a problem with its interface with vim. Mlscope works find from the command line, but simply hangs when I do a symbol search from within vim. Vim works fine with non-ml-cscope, however. I believe I read in the cygwin archives that it had to do with the format of the records returned by the mlscope search. Thanks if you can spare the time to look at it. Otherwise, thanks for the thought. Refer to the following tip: http://www.vim.org/tips/tip.php?tip_id=1362 Thanks, Frodak. I'll keep that in my back pocket for the time being, as I already have non-ml-cscope running. I recall that figuring out patches and compiling gvim on solaris nonadmin account. From different patching methods, compatibility, and the various options for building gvim, I get the impression that such a exploratory/learning step is undertaken when one has a sizable chunk of time (though it will probably more smoothly in the cygwin environment). But thanks for pointing out that option. -- 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/
Re: cscope -d can't find trailer offset if path contains space
By the way, Dave, if you're going to be poking prodding mlscope, I was wondering if you might have time to look at a problem with its interface with vim. Mlscope works find from the command line, but simply hangs when I do a symbol search from within vim. Vim works fine with non-ml-cscope, however. I believe I read in the cygwin archives that it had to do with the format of the records returned by the mlscope search. Thanks if you can spare the time to look at it. Otherwise, thanks for the thought. Fred Ma wrote: Thanks. Here's some further info: http://groups.google.ca/group/comp.editors/msg/7ffc56871c614f4b Dave Diane wrote: Sorry for the delay - let me take a look at this in more detail. Given the sleuthing you've done I'll probably have to go back to the cscope owner at Bell-Labs. Will keep you posted. Dave [mlcscope maintainer for cygwin] Fred Ma wrote: Bug fix request submitted for cscope via sourceforge: This problem arose when using vim, but also appears when using cscope -d. I get the error cannot read trailer offset from file cscope.out. I browsed build.c to find that it is caused when reading in a single number with fscanf. To see what could be confusing fscanf, I found the context of the trailer offset from http://www1.bell-labs.com/project/wwexptools/cscope/cscope.html, which shows that the number to be read occupies a single line along with other space-delimited data, including the specification of the current directory. The space delimiting will get messed up if the current directory contains spaces, which is often the case in Windows and Cygwin (though it can also be the case in *nix). P.S.: It also happens with mlcscope. -- 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/
Re: Exclude cygwin folder from malware scans?
Fred Ma wrote: After some surfing, I haven't found any evidence of malware targetting cygwin. I'm considering excluding the massive file tree from scans (AV, SpyBot, AdAware). I'd be interested in more experienced opinions about this. Thanks. Thanks for your response. In summary, the likelihood of malware targeting cygwin explicitly is low, but there are occassional precedents for continuing to scan the sizable cygwin directory tree. I guess I'll be disciplined and do a 3-day rotational schedule, launching each of the 3 malware scanners at the end of the day. Thanks, all. Fred -- 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/
Re: whole-word matches searches of mailing list archive packages
Gmane User wrote: Brian Dessent wrote: Fred Ma wrote: I was searching for whether the current cygwin has the stat command. This is for future reference, since I am unable to update my old cygwin installation at the moment. I eventually found that stat resides in coreutils, but I was wondering if there is a way to specify whole-word matches when searching either the mailing list archive or while performing a Setup Package Search. The reason is that some words are very common as partial words, so searches tend to come up with many unrelated hits. Thanks. The search is a regular expression. If you are searching for a binary of a particular name, use /foo\.exe which will anchor the match so that it can only match a command by that name, i.e. /some/path/to/foo.exe. See man pcre for more information. Thanks, Brian. man pcrepattern cleared this up, and I found that I could do a package search for (say) \bstat\.exe\b. It doesn't seem to work on a search of the mailing list archive, though. A search for stat.exe, stat\.exe, and stat.exe seems to find pages containing stat and exe rather than stat.exe. But I appreciate the pointer to PCRE for the package search. I forgot to mention that I found the advanced search panel for the mailing list archive. The above problem still exists, though the whole-word matching is solved. Fred -- 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/
Re: whole-word matches searches of mailing list archive packages
Brian Dessent wrote: Fred Ma wrote: I was searching for whether the current cygwin has the stat command. This is for future reference, since I am unable to update my old cygwin installation at the moment. I eventually found that stat resides in coreutils, but I was wondering if there is a way to specify whole-word matches when searching either the mailing list archive or while performing a Setup Package Search. The reason is that some words are very common as partial words, so searches tend to come up with many unrelated hits. Thanks. The search is a regular expression. If you are searching for a binary of a particular name, use /foo\.exe which will anchor the match so that it can only match a command by that name, i.e. /some/path/to/foo.exe. See man pcre for more information. Thanks, Brian. man pcrepattern cleared this up, and I found that I could do a package search for (say) \bstat\.exe\b. It doesn't seem to work on a search of the mailing list archive, though. A search for stat.exe, stat\.exe, and stat.exe seems to find pages containing stat and exe rather than stat.exe. But I appreciate the pointer to PCRE for the package search. Fred -- 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/