search for: min_sizeof

Displaying 11 results from an estimated 11 matches for "min_sizeof".

Did you mean: min_size
2000 Jul 02
0
patch for NetBSD utmp (ut_name instead of ut_host)
...BSD: patch-al,v 1.1 2000/07/02 22:07:56 itojun Exp $ --- loginrec.c- Mon Jul 3 06:49:20 2000 +++ loginrec.c Mon Jul 3 06:51:59 2000 @@ -618,3 +618,9 @@ /* Use strncpy because we don't necessarily want null termination */ +# ifdef HAVE_USER_IN_UTMP strncpy(ut->ut_user, li->username, MIN_SIZEOF(ut->ut_user, li->username)); +# elif defined(HAVE_NAME_IN_UTMP) + strncpy(ut->ut_name, li->username, MIN_SIZEOF(ut->ut_name, li->username)); +# else +# error no ut_user nor ut_name +# endif # ifdef HAVE_HOST_IN_UTMP @@ -1008,4 +1014,12 @@ { +# ifdef HAVE_USER_IN_UTMP if (strn...
2000 Jul 04
0
AW: FreeBSD 3.5-STABLE
...ugh without PAM and the "hotfix". --- loginrec.c.orig Tue Jul 4 10:30:18 2000 +++ loginrec.c Tue Jul 4 10:31:18 2000 @@ -616,7 +616,7 @@ */ /* Use strncpy because we don't necessarily want null termination */ - strncpy(ut->ut_user, li->username, MIN_SIZEOF(ut->ut_user, li->username)); + strncpy(ut->ut_name, li->username, MIN_SIZEOF(ut->ut_name, li->username)); # ifdef HAVE_HOST_IN_UTMP strncpy(ut->ut_host, li->hostname, MIN_SIZEOF(ut->ut_host, li->hostname)); # endif @@ -1006,8 +1006,8 @@ static int wtm...
2009 Dec 25
2
[openssh-portable] utmpx and ut_name
...ticed OpenSSH also uses ut_name, even when using utmpx. I've come up with the following patch: %%% --- loginrec.c +++ loginrec.c @@ -758,8 +758,8 @@ utx->ut_pid = li->pid; /* strncpy(): Don't necessarily want null termination */ - strncpy(utx->ut_name, li->username, - MIN_SIZEOF(utx->ut_name, li->username)); + strncpy(utx->ut_user, li->username, + MIN_SIZEOF(utx->ut_user, li->username)); if (li->type == LTYPE_LOGOUT) return; @@ -1316,8 +1316,8 @@ static int wtmpx_islogin(struct logininfo *li, struct utmpx *utx) { - if (strncmp(li->user...
2001 Nov 20
0
PATCH: Fixing last/utmpx for Solaris
...ext part -------------- --- loginrec.c~ Mon Oct 29 21:50:40 2001 +++ loginrec.c Mon Nov 19 12:08:34 2001 @@ -701,6 +701,7 @@ line_stripname(utx->ut_line, li->line, sizeof(utx->ut_line)); set_utmpx_time(li, utx); utx->ut_pid = li->pid; + strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username)); if (li->type == LTYPE_LOGOUT) return; @@ -711,7 +712,6 @@ */ /* strncpy(): Don't necessarily want null termination */ - strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username)); # ifdef HAVE_HOST_IN_UTMPX str...
2002 Jan 29
0
[Bug 84] New: last command provides incorrect information on Solaris 8
...-- loginrec.c~ Mon Oct 29 21:50:40 2001 +++ loginrec.c Tue Jan 29 10:56:59 2002 @@ -701,6 +701,7 @@ line_stripname(utx->ut_line, li->line, sizeof(utx->ut_line)); set_utmpx_time(li, utx); utx->ut_pid = li->pid; + strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username)); if (li->type == LTYPE_LOGOUT) return; @@ -711,7 +712,6 @@ */ /* strncpy(): Don't necessarily want null termination */ - strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username...
2001 Nov 15
1
Patch for "last" providing incorrect information on Solaris 8
...part -------------- --- loginrec.c.orig Thu Nov 15 09:35:02 2001 +++ loginrec.c Thu Nov 15 09:38:01 2001 @@ -701,6 +701,7 @@ line_stripname(utx->ut_line, li->line, sizeof(utx->ut_line)); set_utmpx_time(li, utx); utx->ut_pid = li->pid; + strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username)); if (li->type == LTYPE_LOGOUT) return; @@ -711,7 +712,6 @@ */ /* strncpy(): Don't necessarily want null termination */ - strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username)); # ifdef HAVE_HOST_IN_UTMPX str...
2001 Jan 29
1
Solaris wtmpx patch
...openssh-2.3.0p1.orig/loginrec.c Sat Sep 30 03:34:44 2000 +++ openssh-2.3.0p1/loginrec.c Tue Jan 23 18:24:25 2001 @@ -674,6 +674,9 @@ set_utmpx_time(li, utx); utx->ut_pid = li->pid; + /* strncpy(): Don't necessarily want null termination */ + strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username)); + if (li->type == LTYPE_LOGOUT) return; @@ -682,8 +685,6 @@ * for logouts. */ - /* strncpy(): Don't necessarily want null termination */ - strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username)); # ifdef HAV...
2001 Sep 06
1
lastlog on Solaris with PAM (patch included)
...too thrilled about the use of strlcpy to get the hostname out of lastlog. The ll_host field of lastlog is a fixed-width field and is not null-terminated. Since strlcpy copies n-1 bytes and then sets byte n-1 to 0, it would be more appropriate to use: strlcpy(li->hostname, last->ll_host, MIN_SIZEOF(li->hostname, last->ll_host + 1)); Think about what happens if sizeof(last->ll_host) = n (n < LINFO_HOSTSIZE) and a specific hostname is exactly n bytes long without any trailing 0-bytes. Also, watch out for other null-termination issues in the same region of code - I mention this bec...
2001 Jun 29
1
wtmpx problem on Solaris 8 sparcv9 (64bit) environment
...258,11 @@ /* Return true if this wtmpx entry indicates a login */ static int +#ifdef __sparcv9 +wtmpx_islogin(struct logininfo *li, struct futmpx *utx) +#else wtmpx_islogin(struct logininfo *li, struct utmpx *utx) +#endif { if ( strncmp(li->username, utx->ut_name, MIN_SIZEOF(li->username, utx->ut_name)) == 0 ) { @@ -1226,7 +1281,11 @@ wtmpx_get_entry(struct logininfo *li) { struct stat st; +#ifdef __sparcv9 + struct futmpx utx; +#else struct utmpx utx; +#endif int fd, found=0; /* Clear the time entries */ @@ -1245,7 +1304,...
2007 Jan 17
0
login_get_lastlog - nss enviornment - works in shell env, doesn't work when sshd calls it.
...* reliably search wtmp(x) for the last login (see * wtmp_get_entry().) */ pw = getpwuid(uid); if (pw == NULL) { printf("FATAL::: %s: Cannot find account for uid %i", __func__, uid); exit(1); } /* No MIN_SIZEOF here - we absolutely *must not* truncate the * username (XXX - so check for trunc!) */ strlcpy(li->username, pw->pw_name, sizeof(li->username)); if (getlast_entry(li)) return (li); else return (NULL); } [--endcode--] ----...
2012 May 22
0
[klibc:master] ipconfig: Write $DOMAINSEARCH as domain-search
...acket.h index 6016e5f..1ef505e 100644 --- a/usr/kinit/ipconfig/bootp_packet.h +++ b/usr/kinit/ipconfig/bootp_packet.h @@ -28,4 +28,14 @@ struct bootp_hdr { /* 312 bytes of extensions */ }; +/* + * memory size of BOOTP Vendor Extensions/DHCP Options for receiving + * + * generic_ether_mtu:1500, min_sizeof(ip_hdr):20, sizeof(udp_hdr):8 + * + * #define BOOTP_EXTS_SIZE (1500 - 20 - 8 - sizeof(struct bootp_hdr)) + */ +/* larger size for backward compatibility of ipconfig */ +#define BOOTP_EXTS_SIZE 1500 + #endif /* BOOTP_PACKET_H */ diff --git a/usr/kinit/ipconfig/bootp_proto.c b/usr/kinit/ipconfig/boo...