This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: utmp database manipulations patch


Here are my proposed changes I'd like to include into utmp.h too. With these
changes getutid() in syscalls.cc should be modified to use UT_IDLEN as 3rd
parameter of strncmp().

Index: utmp.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/cygwin/sys/utmp.h,v
retrieving revision 1.5
diff -u -p -r1.5 utmp.h
--- utmp.h      2 May 2002 00:59:39 -0000       1.5
+++ utmp.h      7 Nov 2002 02:26:22 -0000
@@ -14,6 +14,7 @@
 #include <paths.h>

 #define UTMP_FILE _PATH_UTMP
+#define WTMP_FILE _PATH_WTMP

 #ifdef __cplusplus
 extern "C" {
@@ -22,6 +23,7 @@ extern "C" {
 #define UT_LINESIZE    16
 #define UT_NAMESIZE    16
 #define UT_HOSTSIZE    256
+#define UT_IDLEN       2
 #define ut_name ut_user

 struct utmp
@@ -29,7 +31,7 @@ struct utmp
  short ut_type;
  pid_t ut_pid;
  char  ut_line[UT_LINESIZE];
- char  ut_id[2];
+ char  ut_id[UT_IDLEN];
  time_t ut_time;
  char  ut_user[UT_NAMESIZE];
  char  ut_host[UT_HOSTSIZE];

Sergey Okhapkin
Somerset, NJ
----- Original Message -----
From: "Christopher Faylor" <cgf@redhat.com>
To: <cygwin-patches@cygwin.com>
Sent: Wednesday, November 06, 2002 9:21 PM
Subject: Re: utmp database manipulations patch


> On Wed, Nov 06, 2002 at 05:32:23PM -0500, Sergey Okhapkin wrote:
> >The patch fixes some bugs in utmp database support and provides a new
> >pututline() call.
> >
> >2002-11-06  Sergey Okhapkin  <sos@prospect.com.ru>
> >
> >        * cygwin.din (pututline): new exported function.
> >        * syscalls.cc (login): Use pututiline().
> >          (setutent): Open utmp as read/write.
> >          (endutent): Check if utmp file is open.
> >          (utmpname): call endutent() to close current utmp file.
> >          (getutid): Enable all cases, use strncmp() to compare ut_id
fields.
> >          (pututline): New.
> >        * tty.cc (create_tty_master): Set ut_pid to current pid.
>
> Looks good to me.
>
> I've checked this in, along with reformatting the ChangeLog and bumping
> the API minor version number.
>
> cgf



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]