Commit Graph

5761 Commits

Author SHA1 Message Date
Corinna Vinschen ecdee6e98a * dir.cc (opendir): Fix indentation.
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Move storing
	fhandler in file descriptor table to some point very late in function
	to avoid double free'ing.  Add comment to explain what happens.
	Add label free_mounts and don't forget to delete __DIR_mounts structure
	if NtOpenFile fails.
2006-03-03 20:19:26 +00:00
Corinna Vinschen 17c8ac3992 * regtool.cc (options): Add 'binary'.
(usage): Document 'load|unload|save' and '-b'.
	(find_key): Add 'options' parameter, add load/unload.
	(cmd_set): Add KT_BINARY case.
	(cmd_get): Add hex output in KT_BINARY case.
	(cmd_load): New function.
	(cmd_unload): New function.
	(set_privilege): New function.
	(cmd_save): New function.
	(commands): Add load, unload and save.
	(main): Add '-b'
	* utils.sgml (regtool): Document it.
2006-03-03 09:43:35 +00:00
Corinna Vinschen 7b8b467def * syscalls.cc (chroot): Disallow chroot into special directories.
Return EPERM instead.
2006-03-02 18:08:09 +00:00
Corinna Vinschen 471573dc77 * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check
cygdrive string length for those who have cygdrive mapped to "/".
2006-03-02 09:48:42 +00:00
Corinna Vinschen 352059d4b1 * sec_helper.cc (set_cygwin_privileges): Request SE_BACKUP_NAME
privileges.
2006-03-01 23:14:25 +00:00
Corinna Vinschen 24f0349c1e * fhandler_proc.cc (fhandler_proc::fstat): Always return fixed link
count of 1 for /proc directory instead of incorrect PROC_LINK_COUNT.
2006-03-01 22:56:12 +00:00
Corinna Vinschen c115f31ff2 * fhandler.h (enum dirent_states): Remove dirent_saw_cygdrive,
dirent_saw_dev and dirent_saw_proc.
	(fhandler_cygdrive::open): Declare.
	(fhandler_cygdrive::close): Declare.
	* fhandler_disk_file.cc (class __DIR_mounts): Move to beginning of file.
	(__DIR_mounts::check_mount): New parameter to indicate if inode number
	is needed in calling function or not. Add /proc and /cygdrive handling.
	(__DIR_mounts::check_missing_mount): Ditto.
	(path_conv::ndisk_links): Use __DIR_mounts class to create correct
	hardlink count for directories with mount points in them.
	(fhandler_disk_file::readdir_helper): Remove /dev, /proc and /cygdrive
	handling.
	(fhandler_cygdrive::open): New method.
	(fhandler_cygdrive::close): New method.
	(fhandler_cygdrive::fstat): Always return fixed inode number 2 and
	fixed link count of 1. Drop call to set_drives.
	(fhandler_cygdrive::opendir): Drop call to get_namehash.
	(fhandler_cygdrive::readdir): Handle "." entry to return fixed inode
	number 2.
2006-03-01 22:37:25 +00:00
Christopher Faylor 8d0f58ef37 * cygwin.din: Fix some erroneous SIGFE/NOSIGFE settings.
* cygthread.cc (cygthread::callfunc): Revert below change.  Make ev a manual
reset event again.  so that it will be reset by WaitFor*Object as appropriate.
(cygthread::stub): Ditto.
(cygthread::terminate_thread): Reset ev if it was found to have been set.
2006-03-01 21:31:24 +00:00
Christopher Faylor ee93375872 * analyze_sigfe: New script.
* dllfixdbg: Add copyright.
* gendef: Ditto.
* gendevices: Ditto.
* gentls_offsets: Ditto.
2006-03-01 20:20:22 +00:00
Christopher Faylor 3b1f276fca * cygthread.cc (cygthread::callfunc): Create ev as an auto-reset event so that
it will be reset by WaitFor*Object as appropriate.
(cygthread::stub): Ditto.
(cygthread::terminate_thread): Remove forced setting of thread termination.
2006-03-01 18:23:24 +00:00
Corinna Vinschen e817fd3c8b * include/sys/dirent.h (struct __DIR): Rename __d_unused to
__d_internal.
	* fhandler_disk_file.cc (struct __DIR_cache): Remove useless "typedef".
	(d_dirname): Remove useless "struct".
	(d_cachepos): Ditto.
	(d_cache): Ditto.
	(class __DIR_mounts): New class, implementing mount point tracking
	for readdir.
	(d_mounts): New macro for easy access to __DIR_mounts structure.
	(fhandler_disk_file::opendir): Allocate __DIR_mounts structure and
	let __d_internal element of dir point to it.
	(fhandler_disk_file::readdir_helper): Add mount points in the current
	directory, which don't have a real directory backing them.
	Don't generate an inode number for /dev.  Add comment, why.
	(fhandler_disk_file::readdir): Move filling fname to an earlier point.
	Check if current entry is a mount point and evaluate correct inode
	number for it.
	(fhandler_disk_file::readdir_9x): Ditto.
	(fhandler_disk_file::rewinddir): Set all mount points in this directory
	to "not found" so that they are listed again after calling rewinddir().
	(fhandler_disk_file::closedir): Deallocate __DIR_mounts structure.
	* path.cc (mount_info::get_mounts_here): New method to evaluate a list
	of mount points in a given parent directory.
	* shared_info.h (class mount_info): Declare get_mounts_here.
2006-03-01 13:47:49 +00:00
Corinna Vinschen b7d7223947 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use iscygdrive
instead of isspecial.
	* path.h (path_conv::iscygdrive): New method.
2006-02-28 20:26:52 +00:00
Christopher Faylor d405630e71 * exceptions.cc (_cygtls::interrupt_now): Remove "inside cygwin" check since
some cygwin functions are meant to be interrupted.
2006-02-28 20:02:16 +00:00
Corinna Vinschen 6fb7c8ae78 * cygwin.din: Export __isinff, __isinfd, __isnanf, __isnand.
* include/cygwin/version.h: Bump API minor number to 155.
2006-02-28 15:32:48 +00:00
Corinna Vinschen 5d93840135 * dir.cc (readdir_worker): Use slash as path separator when evaluating
namehash for paths below /proc.
	* fhandler_netdrive.cc (fhandler_netdrive::readdir): Use expensive
	inode number evaluation on share names.
2006-02-28 12:20:11 +00:00
Christopher Faylor 4f1558d132 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set d_cachepos
under NT or suffer memory corruption.
(fhandler_disk_file::readdir_helper): Avoid else with a return.  Just calculate
extension location once when doing symlink checks.
(fhandler_disk_file::readdir): Make debug output more useful.
(fhandler_disk_file::readdir_9x): Ditto.  Eliminate redundant variable.
2006-02-28 04:23:17 +00:00
Christopher Faylor 6a7a2f4bbe * include/sys/termios.h (cfsetispeed): Just define as a function rather than
resorting to a macro.
(cfsetospeed): Ditto.
2006-02-28 01:31:04 +00:00
Christopher Faylor f6f3b1ee46 * sigproc.cc: Fix a comment. 2006-02-28 01:28:28 +00:00
Christopher Faylor e41ff6093e * cygthread.cc (cygthread::release): Add a comment. 2006-02-28 01:27:41 +00:00
Corinna Vinschen 47a5b664e5 * fhandler_netdrive.cc (fhandler_netdrive::fstat): Create unambiguous
inode number.
	(fhandler_netdrive::readdir): Ditto.
2006-02-27 17:46:29 +00:00
Christopher Faylor ad37df4814 * sigproc.cc (sigheld): Define new variable.
(sig_dispatch_pending): Don't check sigq since that's racy.
(sig_send): Set sigheld flag if __SIGHOLD is specified, reset it if __SIGNOHOLD
is specified.  Ignore flush signals if we're holding signals.
2006-02-24 21:40:28 +00:00
Christopher Faylor 1b845df5ac * cygwin.din (_exit): Use signal front end.
(exit): Ditto.
2006-02-24 02:08:56 +00:00
Christopher Faylor 7fbfec2b64 * winsup.h (cygwin_hmodule): Declare.
* exceptions.cc (inside_kernel): Reverse return values to reflect function
name.  Return true if we're in cygwin1.dll or if we're executing in dll_entry.
(_cygtls::interrupt_now): Reflect reversal of inside_kernel return value.
* hookapi.cc (cygwin_hmodule): Remove declaration.
* init.cc (dll_entry): Use in_dllentry global to record that we are executing
in dllentry.
2006-02-23 19:21:21 +00:00
Corinna Vinschen 2eecb0478c * exceptions.cc (_cygtls::interrupt_now): Reorder conditional
to call inside_kernel only if this isn't locked.
2006-02-22 17:06:14 +00:00
Corinna Vinschen b65479ca2e * fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES to
access flags in case of query_read_control case, add FILE_READ_DATA
	in case of query_stat_control.
2006-02-22 16:40:42 +00:00
Danny Smith f41c4c7ced * include/ddk/ntifs,h (FILE_ID_FULL_DIRECTORY_INFORMATION): Revert
last change.
	Remove file level #pragma pack(push,4)/#pragma pop.
2006-02-21 08:28:01 +00:00
Christopher Faylor 8aaf07c7a2 fix typo 2006-02-20 16:26:16 +00:00
Christopher Faylor 0a5f931a43 * spawn.cc (av::fixup): Check for .bat and friends specifically now since these
extensions are no longer automatically detected.
2006-02-20 16:15:51 +00:00
Christopher Faylor badc494165 revert erroneous checkin 2006-02-20 02:06:37 +00:00
Christopher Faylor a339c989c7 * exceptions.cc (stackdump): Avoid dumping more than once. 2006-02-20 02:04:31 +00:00
Christopher Faylor 6d61866578 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use NtOpenFile to open
the directory.
(fhandler_disk_file::readdir): Use NT_SUCCESS to determine if status represents
success.
2006-02-19 21:18:36 +00:00
Corinna Vinschen 84a447aa08 * include/ddk/ntifs.h (FILE_ID_FULL_DIRECTORY_INFORMATION): Add filler
value to force correct alignment.
2006-02-19 10:56:20 +00:00
Danny Smith 25109ea7f3 * include/commctrl.h (LPNMLVCACHEHINT): Correct spelling.
Thanks to: Sebastian Pipping <hartwork at users dot sf dot net>
	(PNM_CACHEHINT): Add backward compatibilty define.
	(LPNM_CACHEHINT): Likewise.
2006-02-19 09:22:00 +00:00
Corinna Vinschen d4e9248df3 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop generating
path_conv for root.
2006-02-19 08:34:25 +00:00
Corinna Vinschen 408b92dbb5 * fhandler_disk_file.cc (FS_IS_SAMBA): Move out of
path_conv::hasgood_inode.
	(path_conv::is_samba): New method.
	(fhandler_base::fstat_by_handle): Don't even try to use
	FileIdBothDirectoryInformation on Samba.
	* path.h (class path_conv): Declare is_samba method.
2006-02-18 10:46:53 +00:00
Christopher Faylor 753702223c * path.cc (conv_path_list): Eat empty paths when converting to POSIX.
(cygwin_conv_to_win32_path): Deal with Cygwin's necessity of adding a '/' to
the end of a path ending in '.'.
2006-02-17 20:12:11 +00:00
Corinna Vinschen 4fc92aa730 * cygpath.cc (get_long_name): Load GetLongPathNameA instead of incorrect
GetLongPathName.
	(doit): Create mixed filename after converting to short or long pathname
	respectively.
2006-02-17 12:17:47 +00:00
Corinna Vinschen 32410d2175 * ps.cc (main): Set aflag if -p option is given. 2006-02-17 11:16:23 +00:00
Corinna Vinschen c6e48b1cd1 * cygwin.din: Export sigignore and sigset.
* exceptions.cc (sigset): New function.
	(sigignore): New function.
	* include/cygwin/signal.h (SIG_HOLD): Define.
	(sigignore): Declare.
	(sigset): Declare.
	* include/cygwin/version.h: Bump API minor number to 154.
2006-02-16 18:21:49 +00:00
Corinna Vinschen df4f13b723 * ps.cc (longopts): Add --process option.
(opts): Add -p option.
	(usage): Mention -p/--process option.
	(main): Handle -p option.
	* utils.sgml: Describe -p/--process option.
2006-02-16 11:17:19 +00:00
Christopher Faylor 5e8b96517c minor comment restructuring 2006-02-15 22:11:13 +00:00
Corinna Vinschen 96a4362c92 * regtool.cc (usage): Clarify help for "-K". 2006-02-15 10:57:17 +00:00
Christopher Faylor 49bc9a6939 * include/mntent.h: Add missing #include. 2006-02-13 19:01:32 +00:00
Christopher Faylor 462c98e96a * gentls_offsets: Fix typo in error message. 2006-02-13 18:59:01 +00:00
Earnie Boyd 3801e59ad8 2006-02-13 Earnie Boyd <earnie@users.sf.net>
* Makefile.in (libmsvcr80.a): Add import lib.
	(libmsvcr80d.a): Ditto.
2006-02-13 13:33:07 +00:00
Christopher Faylor 472130e897 * fhandler_process.cc (format_process_stat): Use cygwin-derived start time even
on NT since it is the logical start time of the "process".
* pinfo.cc (set_myself): Don't set start time when it should have already been
set previously.
2006-02-11 04:53:14 +00:00
Christopher Faylor 5a8a5efcfd revert previously applied patch. 2006-02-11 00:07:43 +00:00
Christopher Faylor 7f8c7bff6f * times.cc (clock_getres): Use correct conversion from milliseconds to
seconds/nanoseconds.
(clock_setres): Use correct conversion to nanoseconds.
2006-02-11 00:06:50 +00:00
Christopher Faylor 9a08fd5a50 * external.cc (sync_winenv): Rename from "setup_winenv". Use same mechanism as
spawn to determine environment variables which should be converted back to
windows form.
(cygwin_internal): Reflect setup_winenv -> sync_winenv name change.
* include/sys/cygwin.h: Ditto.
2006-02-10 17:22:34 +00:00
Corinna Vinschen 30f1c8a675 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
the dirent_get_d_ino flag on filesystems having useful File IDs.
	Add comment explaining why.
2006-02-09 14:42:48 +00:00