Patches for Solaris 8 compile

Toomas Soome tsoome at
Wed Mar 7 21:21:25 GMT 2001

On Wed, 7 Mar 2001, Jeremy Allison wrote:

> It's one of those "we have no business doing things there"
> issues that will cause problems with administrators.
> So - you mention another option "fix utmp logging to behave
> like for example wu-ftpd".
> What does this involve ?

I have made VERY QUICK comparization, and it seems to do the same thing.

however, there are some points.

samba code is useing struct utmp at most places, wuftpd is useing utmpx,
if utmpx is available. samba code is useing getutmpx(), but it does not
zero fill utmpx structure before. samba does fill utmp struct in several
places - not in one function.

I'll include here most important part of wu_logwtmp(), from logwtmp.c

void wu_logwtmp(char *line, char *name, char *host, int login)
  struct utmpx utx;

  memset((void *) &utx, '\0', sizeof(utx));
  (void) strncpy(utx.ut_user, name, sizeof(utx.ut_user));
  (void) strncpy(utx.ut_host, host, sizeof(utx.ut_host));
  (void) strncpy(utx.ut_id, "ftp", sizeof(utx.ut_id));
  (void) strncpy(utx.ut_line, line, sizeof(utx.ut_line));
  utx.ut_syslen = strlen(utx.ut_host) + 1;
  utx.ut_pid = getpid();
  (void) time(&utx.ut_tv.tv_sec);
  if (login /* name && *name */ ) {
    utx.ut_type = USER_PROCESS;
  } else {
    utx.ut_type = DEAD_PROCESS;
  utx.ut_exit.e_termination = 0;
  utx.ut_exit.e_exit = 0;
  write(fdx, (char *) &utx, sizeof(struct utmpx));

of course, this is not perfect, it actually does not hange utmp only
systems, but we have utmpx only system (sol8) and there is problem with
current samba code:)

A.A.A.A.A.: An organization for drunks who drive.

More information about the samba-technical mailing list