* fhandler_disk_file.cc (fhandler_disk_file::fchown): Fix typo in
comment. * mount.cc (mount_info::from_fstab): Use tmp_pathbuf rather than stack for big local buffer. * net.cc (cygwin_gethostname): Call GetComputerNameExA rather than GetComputerNameA if gethostname failed. * shared.cc (user_info::initialize): Fix formatting. * include/sys/file.h: Define flock and accompanying macros if not already defined in sys/_default_fcntl.h.
This commit is contained in:
parent
46913a8290
commit
abbe1f5320
|
@ -1,3 +1,15 @@
|
||||||
|
2014-02-06 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_disk_file.cc (fhandler_disk_file::fchown): Fix typo in
|
||||||
|
comment.
|
||||||
|
* mount.cc (mount_info::from_fstab): Use tmp_pathbuf rather than
|
||||||
|
stack for big local buffer.
|
||||||
|
* net.cc (cygwin_gethostname): Call GetComputerNameExA rather than
|
||||||
|
GetComputerNameA if gethostname failed.
|
||||||
|
* shared.cc (user_info::initialize): Fix formatting.
|
||||||
|
* include/sys/file.h: Define flock and accompanying macros if not
|
||||||
|
already defined in sys/_default_fcntl.h.
|
||||||
|
|
||||||
2014-02-04 Corinna Vinschen <corinna@vinschen.de>
|
2014-02-04 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 29.
|
* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 29.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* fhandler_disk_file.cc
|
/* fhandler_disk_file.cc
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||||
2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
|
2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
|
||||||
|
|
||||||
This file is part of Cygwin.
|
This file is part of Cygwin.
|
||||||
|
|
||||||
|
@ -928,7 +928,7 @@ fhandler_disk_file::fchown (uid_t uid, gid_t gid)
|
||||||
if (pc.issymlink ())
|
if (pc.issymlink ())
|
||||||
attrib = S_IFLNK | STD_RBITS | STD_WBITS;
|
attrib = S_IFLNK | STD_RBITS | STD_WBITS;
|
||||||
res = set_file_attribute (get_handle (), pc, uid, gid, attrib);
|
res = set_file_attribute (get_handle (), pc, uid, gid, attrib);
|
||||||
/* If you're running a Samba server which has no winbidd running, the
|
/* If you're running a Samba server which has no winbind running, the
|
||||||
uid<->SID mapping is disfunctional. Even trying to chown to your
|
uid<->SID mapping is disfunctional. Even trying to chown to your
|
||||||
own account fails since the account used on the server is the UNIX
|
own account fails since the account used on the server is the UNIX
|
||||||
account which gets used for the standard user mapping. This is a
|
account which gets used for the standard user mapping. This is a
|
||||||
|
|
|
@ -31,4 +31,16 @@
|
||||||
#define L_INCR SEEK_CUR
|
#define L_INCR SEEK_CUR
|
||||||
#define L_XTND SEEK_END
|
#define L_XTND SEEK_END
|
||||||
|
|
||||||
|
/* Including <sys/file.h> always defines flock & macros. */
|
||||||
|
#if __BSD_VISIBLE - 0 == 0
|
||||||
|
|
||||||
|
#define LOCK_SH 0x01 /* shared file lock */
|
||||||
|
#define LOCK_EX 0x02 /* exclusive file lock */
|
||||||
|
#define LOCK_NB 0x04 /* don't block when locking */
|
||||||
|
#define LOCK_UN 0x08 /* unlock file */
|
||||||
|
|
||||||
|
extern int flock _PARAMS ((int, int));
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* mount.cc: mount handling.
|
/* mount.cc: mount handling.
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||||
2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
|
2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
|
||||||
|
|
||||||
This file is part of Cygwin.
|
This file is part of Cygwin.
|
||||||
|
|
||||||
|
@ -1180,6 +1180,7 @@ mount_info::from_fstab (bool user, WCHAR fstab[], PWCHAR fstab_end)
|
||||||
IO_STATUS_BLOCK io;
|
IO_STATUS_BLOCK io;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
HANDLE fh;
|
HANDLE fh;
|
||||||
|
tmp_pathbuf tp;
|
||||||
|
|
||||||
if (user)
|
if (user)
|
||||||
{
|
{
|
||||||
|
@ -1204,13 +1205,13 @@ mount_info::from_fstab (bool user, WCHAR fstab[], PWCHAR fstab_end)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char buf[NT_MAX_PATH];
|
char *buf = tp.c_get ();
|
||||||
char *got = buf;
|
char *got = buf;
|
||||||
DWORD len = 0;
|
DWORD len = 0;
|
||||||
unsigned line = 1;
|
unsigned line = 1;
|
||||||
/* Using buffer size - 2 leaves space to append two \0. */
|
/* Using buffer size - 2 leaves space to append two \0. */
|
||||||
while (NT_SUCCESS (NtReadFile (fh, NULL, NULL, NULL, &io, got,
|
while (NT_SUCCESS (NtReadFile (fh, NULL, NULL, NULL, &io, got,
|
||||||
(sizeof (buf) - 2) - (got - buf), NULL, NULL)))
|
(NT_MAX_PATH - 2) - (got - buf), NULL, NULL)))
|
||||||
{
|
{
|
||||||
char *end;
|
char *end;
|
||||||
|
|
||||||
|
@ -1232,7 +1233,7 @@ retry:
|
||||||
got = end + 1;
|
got = end + 1;
|
||||||
++line;
|
++line;
|
||||||
}
|
}
|
||||||
if (len < (sizeof (buf) - 2))
|
if (len < (NT_MAX_PATH - 2))
|
||||||
break;
|
break;
|
||||||
/* Check if the buffer contained at least one \n. If not, the
|
/* Check if the buffer contained at least one \n. If not, the
|
||||||
line length is > 32K. We don't take such long lines. Print
|
line length is > 32K. We don't take such long lines. Print
|
||||||
|
@ -1241,7 +1242,7 @@ retry:
|
||||||
{
|
{
|
||||||
system_printf ("%W: Line %d too long, skipping...", fstab, line);
|
system_printf ("%W: Line %d too long, skipping...", fstab, line);
|
||||||
while (NT_SUCCESS (NtReadFile (fh, NULL, NULL, NULL, &io, buf,
|
while (NT_SUCCESS (NtReadFile (fh, NULL, NULL, NULL, &io, buf,
|
||||||
(sizeof (buf) - 2), NULL, NULL)))
|
(NT_MAX_PATH - 2), NULL, NULL)))
|
||||||
{
|
{
|
||||||
len = io.Information;
|
len = io.Information;
|
||||||
buf[len] = buf[len + 1] = '\0';
|
buf[len] = buf[len + 1] = '\0';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* net.cc: network-related routines.
|
/* net.cc: network-related routines.
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||||
2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
|
2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
|
||||||
|
|
||||||
This file is part of Cygwin.
|
This file is part of Cygwin.
|
||||||
|
|
||||||
|
@ -1007,7 +1007,7 @@ cygwin_gethostname (char *name, size_t len)
|
||||||
{
|
{
|
||||||
DWORD local_len = len;
|
DWORD local_len = len;
|
||||||
|
|
||||||
if (!GetComputerNameA (name, &local_len))
|
if (!GetComputerNameExA (ComputerNameDnsFullyQualified, name, &local_len))
|
||||||
{
|
{
|
||||||
set_winsock_errno ();
|
set_winsock_errno ();
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* shared.cc: shared data area support.
|
/* shared.cc: shared data area support.
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||||
2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
|
2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
|
||||||
|
|
||||||
This file is part of Cygwin.
|
This file is part of Cygwin.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue