Newer FAT32 and exFAT add FILE_SUPPORTS_ENCRYPTION to their
flags which wasn't handled by Cygwin yet.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Bump GPLv2+ to GPLv3+ for some files, clarify BSD 2-clause.
Everything else stays under GPLv3+.
New Linking Exception exempts resulting executables from LGPLv3 section 4.
Add CONTRIBUTORS file to keep track of licensing.
Remove 'Copyright Red Hat Inc' comments.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* include/sys/cygwin.h (CCP_PROC_CYGDRIVE): New flag.
* mount.cc (mount_info::cygdrive_posix_path): Take flag values rather
than just a trailing_slash_p bool. Emit /proc/cygdrive path if
CCP_PROC_CYGDRIVE flag is given.
(mount_info::conv_to_posix_path): Take flag values rather than just
a keep_rel_p bool. Rename _p variables. Print flag value as hex in
debug_printf. Call cygdrive_posix_path with flag values.
* mount.h (mount_info::cygdrive_posix_path): Accommodate above change
in declaration.
(mount_info::conv_to_posix_path): Ditto.
* fhandler_process.cc (format_process_exename): Accommodate change to
mount_info::conv_to_posix_path.
* path.cc (cygwin_conv_path): Ditto.
* cygpath.cc (absolute_flag): Initialize to CCP_RELATIVE to simplify
expressions.
(cygdrive_flag): New global flag.
(long_options): Add --proc-cygdrive option.
(options): Add -U option.
(usage): Add description for -U option.
(do_sysfolders): Or cygdrive_flag to cygwin_conv_path call.
(do_pathconv): Simply or absolute_flag to conv_func. Or
cygdrive_flag to conv_func.
(do_options): Initalize absolute_flag to CCP_RELATIVE. Initialize new
cygdrive_flag. Set absolute_flag to CCP_ABSOLUTE on -a. Set
cygdrive_flag to CCP_PROC_CYGDRIVE on -U.
* new-features.xml (ov-new2.4): Document cygpath -U option.
* utils.xml (cygpath): Ditto.
* path.xml (func-cygwin-path): Add CCP_PROC_CYGDRIVE description.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
initialize mount table in two steps, system and user, depending on
bool value.
* mount.h (class mount_info): Align declaration of init function to
above change.
* shared.cc (user_info::initialize): Initialize mount table in two
steps to allow internal_getpwsid to create valid POSIX paths from
DOS paths given in AD. Add comments.
* uinfo.cc (cygheap_pwdgrp::get_home): Allow DOS paths in
NSS_SCHEME_FREEATTR attributes.
(cygheap_pwdgrp::get_shell): Ditto.
* environ.cc (set_winsymlinks): Set allow_winsymlinks.
(parse_thing): Change "winsymlinks" to set by function.
* globals.cc (enum winsym_t): Define.
(allow_winsymlinks): Define as winsym_t.
(ro_u_afs): New R/O Unicode string.
* mount.cc (fs_info::update): Fix comment. Handle AFS.
(fs_names): Add "afs".
* mount.h (enum fs_info_type): Add afs.
(class fs_info): Implement afs.
* path.cc (symlink): Drop third parameter in call to symlink_worker.
(symlink_nfs): New function.
(symlink_native): New function.
(symlink_worker): Drop third argument. Handle native symlink type by
calling symlink_native. Move code to handle NFS to symlink_nfs. Fix
formatting. Slightly restructure code.
* path.h (class path_conv): Add fs_is_afs method.
(symlink_worker): Declare here.
* security.h: Define privilege constants as unsigned int instead of as
unsigned long.
* syscalls.cc (mknod_worker): Set third parameter in symlink_worker
call to WSYM_lnk.
* winsup.h (symlink_worker): Drop declaration here.
(mainly in fhandler*) start fixing gcc 4.7.2 mismatch between regparm
definitions and declarations.
* gendef: Define some functions to take @ declaration to accommodate _regN
defines which use __stdcall.
* gentls_offsets: Define __regN macros as empty.
* autoload.cc (wsock_init): Remove unneeded regparm attribute.
* winsup.h (__reg1): Define.
(__reg2): Define.
(__reg3): Define.
* advapi32.cc (DuplicateTokenEx): Coerce some initializers to avoid warnings
from gcc 4.7.2.
* exceptions.cc (status_info): Declare struct to use NTSTATUS.
(cygwin_exception::dump_exception): Coerce e->ExceptionCode to NTSTATUS.
* fhandler_clipboard.cc (cygnativeformat): Redefine as UINT to avoid gcc 4.7.2
warnings.
(fhandler_dev_clipboard::read): Ditto.
* mount.cc (fs_info::update): Recognize ReFS.
* mount.h (enum fs_info_type): Add refs.
(class fs_info): Add refs flag and accessor methods.
* ntdll.h (RtlAddAccessAllowedAceEx): Declare.
(RtlAddAccessDeniedAceEx): Declare.
* path.h (path_conv::fs_is_refs): Define.
* sec_helper.cc (_recycler_sd): New function to create security
descriptors suitable for the recycler bin starting with Vista.
* security.cc (add_access_allowed_ace): Use RtlAddAccessAllowedAceEx
and drop code to set AceFlags explicitely.
(add_access_denied_ace): Use RtlAddAccessDeniedAceEx and drop code to
set AceFlags explicitely.
* security.h (_recycler_sd): Declare.
(recycler_sd): Define.
* syscalls.cc (desktop_ini): Change formatting.
(desktop_ini_ext): Define third line of recycler desktop.ini file
since Vista,
(try_to_bin): Handle ReFS just like NTFS. Write Vista and later
Recycler in all uppercase, just like shell32 does when recreating it.
Fix comments to include ReFS. Don't implicitely reuse object
attributes from earlier NtOpenFile call, rather recreate it for safety.
Use recycler_sd call when creating security descriptor for Recycler
dirs and files on Vista and later. Write third line of desktop.ini
when on Vista and later.
* fhandler_disk_file.cc (fhandler_cygdrive::opendir): Rename flptst
to drive. Call new get_disk_type function rather than is_floppy and
check SMB drives with the NetUseGetInfo function. Explain why.
* mount.cc (get_disk_type): New function to evaluate disk type from
native NT device name.
(is_floppy): Remove.
* mount.h (enum disk_type): Define.
(get_disk_type): Declare.
* path.h (is_floppy): Drop declaration.
(FS_IS_NETAPP_DATAONTAP): Drop test for FILE_PERSISTENT_ACLS.
(fs_info::update): Set filetype to ntfs in remote case, too. Fix a
couple of comments. Add test for Netapps faking to be FAT.
* mount.h (IMPLEMENT_FS_FLAG): Simplify definition and usage.
(format_proc_filesystems): New function.
* mount.cc (fs_names): Move to global scope. Redefine as array
of { "name", block_device? } structs.
(fillout_mntent): Use name member of fs_names.
* mount.h (fs_names): New prototype.
* path.cc (path_conv::check): Clear filesystem info if following a
symlink. Use new fs_info::inited method to check if FS info is already
available.
(symlink_info::check): Drop fs_update_called. Use fs_info::inited
method instead. Streamline test for leading space and trailing dot or
space. Add comments.
from mask. Expand the comment a bit.
(WIN_FAT_FLAGS): New define.
(FS_IS_WINDOWS_FAT): New macro.
(fs_info::update): Handle remote FS faking to be FAT. Subsume under
CIFS. Check for NWFS and has_buggy_basic_info only for remote
filesystems. Add check for has_dos_filenames_only.
* mount.h (class fs_info): Add has_dos_filenames_only status flag.
Implement accessors.
* path.cc (symlink_info::check): Rearrange variable definitions to
clear them up. Add a restart label to allow a clean restart within
the method. Add a check for broken filesystems only allowing DOS
pathnames in case we encounter a STATUS_OBJECT_NAME_NOT_FOUND status.
If all checks point to one of that, restart method with tweaked
incoming path. Add lengthy comments to explain what we do.
(IMPLEMENT_FS_FLAG): New define.
(class fs_info): Convert filesystem type status flags into an enum
fs_info_type. Add cifs FS. Revert change to has_buggy_open and
has_buggy_fileid_dirinfo. Make them normal; status flags again.
Implement is_FS functions using IMPLEMENT_FS_FLAG.
* mount.cc (fs_info::update): Define MINIMAL_WIN_NTFS_FLAGS and
FS_IS_WINDOWS_NTFS. Add comment. Only test remote filesystems
for "NTFS" once. Add is_cifs check using FS_IS_WINDOWS_NTFS.
Set has_buggy_open flag for SUNWNFS. Set has_buggy_fileid_dirinfo
flag for UNIXFS and all cifs type filesystems. Only check for
caseinsensitivity once.
(fillout_mntent): Create locale fs_names array. Use for setting
_my_tls.locals.mnt_type.
(fs_info::clear): Clear fsn.
(fs_info::fsname): New read accessor for fsn.
* mount.cc (fs_info::update): Fill in fsn member with lowercased
filesystem name if filesystem is not well-known. Fall back to
"unknown" if filesystem name is missing.
(fillout_mntent): Print filesystem name retrieved in fs_info::update
rather than static string "unknown".
* mount.h (fs_info::sttaus): Move filesystem type flags into
substructure. Add union to allow simple test for having set any
one filesystem type flag. Replace has_buggy_open flag with is_sunwnfs
flag. Replace has_buggy_fileid_dirinfo with is_unixfs flag.
(fs_info::got_fs): New private method.
(fs_info::has_buggy_open): New explicit implementation.
(fs_info::has_buggy_fileid_dirinfo): Ditto.
* mount.cc (fs_info::update): Optimize filesystem checks for speed.
* winsup.h (IMPLEMENT_STATUS_FLAG): Change write accessor to return
value just set.
(select_record::select_record): Define do-nothing constructor for "new" to
avoid gratuitous zeroing.
(select_info): New base class.
(select_pipe_info): New class with methods for dealing with pipes.
(select_socket_info): New class with methods for dealing with sockets.
(select_serial_info): Dummy class for serial.
(select_mailslot_info): Dummy class for mailslots.
(select_stuff): Define device_specific_* as actual classes rather than void *.
* dtable.h (dtable::select_read): Accommodate return value change to 'bool' and
argument change to "select_stuff".
(dtable::select_write): Ditto.
(dtable::select_except): Ditto.
* dtable.cc (dtable::select_read): Accommodate return value change to 'bool'
and argument change to "select_stuff".
(dtable::select_write): Ditto.
(dtable::select_except): Ditto.
* fhandler.h: Excise select-related classes.
(fhandler_*::select_read): Change argument to select_stuff.
(fhandler_*::select_write): Ditto.
(fhandler_*::select_except): Ditto.
* select.cc (UNIX_FD_ZERO): Use memset rather than bzero.
(select_stuff::test_and_set): Change return type to bool. Allocate
select_record on entry and let fhandler_*::select_* operate on the start.next
field of select_stuff.
(pipeinf): Delete.
(select_pipe_info::select_pipe_info): New constructor. Allocates event for
controlling pipe waits.
(select_pipe_info::~select_pipe_info): New destructor. Destroy event. Stop
thread.
(select_pipe_info::add_watch_handle): New function.
(thread_pipe): Wait for the hEvent part of any overlapped pipes before peeking.
(start_thread_pipe): Don't allocate device_specific_pipe stuff here. Assume
that it has been allocated earlier.
(pipe_cleanup): Rely on select_pipe_info destructor to clean up pipe
paraphenalia.
(fhandler_*::select_*): Derive select_record from new select_stuff argument.
(fhandler_pipe::select_*): Ditto. Allocate pipe-specific field if not already
allocated.
(serialinf): Delete.
(thread_serial): serialinf -> select_serial_info.
(fhandler_base::ready_for_read): Rewrite to accommodate change in argument to
fhandler_*::select_*.
(socketinf): Delete.
(thread_socket): socketinf -> select_socket_info.
(mailslotinf): Delete.
(thread_mailslot): mailslotinf -> select_mailslot_info.
2009-05-13 Corinna Vinschen <corinna@vinschen.de>
Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc (mount_info::got_usr_bin): Define.
(mount_info::got_usr_lib): Ditto.
(mount_info::root_idx): Ditto.
(mount_info::create_root_entry): Create root entry as immutable and
flag as automatic.
(mount_info::init): Remove "Huh? No /etc/fstab..." warning.
Unconditionally call from_fstab for user and system tables. Fill in
/usr/bin and /usr/lib if they have not been specified in /etc/fstab.
(oopts): Alphabetize. Add "override" option to allow overriding
immutable mount points.
(mount_info::add_item): Accommodate new MOUNT_IMMUTABLE flag intended
for root mount.
(mount_info::add_item): Detect "/usr/bin", "/usr/lib", and "/" and set
appropriate global state.
(fillout_mntent): Add ,auto to mount points added by Cygwin DLL.
(mount): Remove masking of MOUNT_SYSTEM. Allow user to shoot
themselves. Add comment.
* mount.h (mount_info::got_usr_bin): Declare.
(mount_info::got_usr_lib): Ditto.
(mount_info::root_idx): Ditto.
* include/sys/mount.h: Reformat enum.
Add MOUNT_{OVERRIDE,IMMUTABLE,AUTOMATIC}.
doc ChangeLog
2009-05-13 Corinna Vinschen <corinna@vinschen.de>
Christopher Faylor <me+cygwin@cgf.cx>
* pathnames.sgml (mount-table): Sort mount options and add override
option. Add description of root mount handling.
utils ChangeLog
2009-05-13 Corinna Vinschen <corinna@vinschen.de>
Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc (oopts): Sort. Add override option. Add dummy "auto"
option for consistency.
(mount_entries): Avoid adding auto-mounted entries to -m output.
* utils.sgml: Sort mount options. Add description of override option.
evaluation for faked "." entry.
* mount.cc (fs_info::update): Move setting of is_cdrom after checking
for caseinsensitivity. Recognize UDF in is_cdrom case and set
caseinsensitive flag according to UDF brokenness determined by OS.
Add comment to explain why.
* mount.h (class fs_info): Add is_udf status flag.
* path.cc (symlink_info::check): Add workaround for UDF bug in
terms of casesensitivity on certain OSes.
* wincap.h (wincaps::has_broken_udf): New element.
(wincaps::has_broken_udf): New element
where appropriate.
* globals.cc: New file for generic global variables.
* mkglobals_h: New file to generate globals.h.
* mkstatic: New Script used to build a (currently non-working) static
libcygwin_s.a.
* Makefile.in: Add unused rule to build a non-working libcygwin_s.a.
(DLL_OFILES): Add globals.o. Make all objects rely on globals.h.
(globals.h): New target. Generate globals.h.
* cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE operator
is allowed in _cygtls.
* dcrt0.cc: Move most globals to globals.cc.
* init.cc: Ditto.
* environ.cc (strip_title_path): Remove now-unneeded extern.
* fhandler_serial.cc (fhandler_serial::open): Ditto.
* pinfo.cc: Ditto.
(commune_process): Ditto.
* shared.cc: Ditto.
* glob.cc: Ditto.
* strace.cc: Ditto.
* exceptions.cc: Define CYGTLS_HANDLE before including winsup.h.
* path.cc (stat_suffixes): Move here.
* security.h: Add forward class path_conv declaration.
* smallprint.cc (__small_vsprintf): Make a true c++ function.
(__small_sprintf): Ditto.
(small_printf): Ditto.
(console_printf): Ditto.
(__small_vswprintf): Ditto.
(__small_swprintf): Ditto.
* spawn.cc (spawn_guts): Remove _stdcall decoration in favor of regparm.
(hExeced): Move to globals.cc
* strfuncs.cc (current_codepage): Ditto.
(active_codepage): Ditto.
* sync.cc (lock_process::locker): Move here from dcrt0.cc.
* syscalls.cc (stat_suffixes): Move to path.cc.
* tty.cc (tty::create_master): Uncapitalize fatal warning for consistency.
* winsup.h: Include globals.h to declare most of the grab bag list of globals
which were previously defined here.
* mount.h: Move USER_* defines back to shared_info.h.
* speclib: Force temporary directory cleanup.
(smb_extended_info): Move here from path.cc.
(fs_info::update): Ditto.
(mount_info::create_root_entry): Delay conversion to slashes and use passed in
buffer to figure out fs type.
* path.cc (smb_extended_info): Move.
(fs_info::update): Ditto.
* mount.h: New file. Move mount information here.
* path.h: (fs_info::update): Move.
* shared_info.h (mount_item): Ditto.