Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-06-05 19:43:49 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-05 19:43:49 +0400
commit2bb6b3e50619d10b93a8a2640dd4784e01e97236 (patch)
tree95bcb1bdb2ff003af4ded3ac8ed0873d68dad219
parente9259cb240fbd18e5e47617a6e236a26107d6ded (diff)
* dtable.cc (handle_to_fn): Check error return value from NtQueryObject first
before seeing if name buffer is NULL. * grp.cc (read_etc_group): Fix gcc warning regarding snprintf format. * passwd.cc (read_etc_passwd): Ditto.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/dtable.cc12
-rw-r--r--winsup/cygwin/grp.cc2
-rw-r--r--winsup/cygwin/passwd.cc2
4 files changed, 18 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index e4d0a3e65..022f4190d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2002-06-05 Christopher Faylor <cgf@redhat.com>
+
+ * dtable.cc (handle_to_fn): Check error return value from NtQueryObject
+ first before seeing if name buffer is NULL.
+
+ * grp.cc (read_etc_group): Fix gcc warning regarding snprintf format.
+ * passwd.cc (read_etc_passwd): Ditto.
+
2002-04-18 Thomas Pfaff <tpfaff@gmx.net>
* thread.h (pthread::joiner): New member.
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 62c960917..c00420d5d 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -734,15 +734,19 @@ handle_to_fn (HANDLE h, char *posix_fn)
DWORD res = NtQueryObject (h, ObjectNameInformation, ntfn, sizeof (fnbuf), NULL);
- // NT seems to do this on an unopened file
- if (!ntfn->Name.Buffer)
- return NULL;
-
if (res)
{
strcpy (posix_fn, "some disk file");
return posix_fn;
}
+
+ // NT seems to do this on an unopened file
+ if (!ntfn->Name.Buffer)
+ {
+ debug_printf ("nt->Name.Buffer == NULL");
+ return NULL;
+ }
+
ntfn->Name.Buffer[ntfn->Name.Length / sizeof (WCHAR)] = 0;
char win32_fn[MAX_PATH + 100];
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index 25d2ff864..54725c227 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -186,7 +186,7 @@ read_etc_group ()
&domain_name_len, &acType))
{
char strbuf[100];
- snprintf (linebuf, sizeof (linebuf), "%s:%s:%u:",
+ snprintf (linebuf, sizeof (linebuf), "%s:%s:%lu:",
group_name,
tg.string (strbuf),
*GetSidSubAuthority(tg,
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc
index b251264b7..a3df1219e 100644
--- a/winsup/cygwin/passwd.cc
+++ b/winsup/cygwin/passwd.cc
@@ -177,7 +177,7 @@ read_etc_passwd ()
{
char strbuf[100];
snprintf (linebuf, sizeof (linebuf),
- "%s::%u:%u:%s:%s:/bin/sh",
+ "%s::%lu:%lu:%s:%s:/bin/sh",
cygheap->user.name (),
*GetSidSubAuthority(tu,
*GetSidSubAuthorityCount(tu) - 1),