On Sat, Aug 11, 2018 at 09:54:44PM -0400, Rob Pierce wrote:
> In aldap.c, tls_write(2) and write(2) also return ssize_t, so both error and
> wrote have been changed accordingly.
> 
> ok?

OK claudio
 
> Index: usr.bin/ldap/aldap.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/ldap/aldap.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 aldap.c
> --- usr.bin/ldap/aldap.c      31 Jul 2018 11:37:18 -0000      1.4
> +++ usr.bin/ldap/aldap.c      12 Aug 2018 01:53:10 -0000
> @@ -126,10 +126,10 @@ aldap_tls(struct aldap *ldap, struct tls
>  int
>  aldap_send(struct aldap *ldap, struct ber_element *root)
>  {
> -     int error, wrote;
>       void *ptr;
>       char *data;
>       size_t len, done;
> +     ssize_t error, wrote;
>  
>       len = ber_calc_len(root);
>       error = ber_write_elements(&ldap->ber, root);
> @@ -311,7 +311,7 @@ int
>  aldap_create_page_control(struct ber_element *elm, int size,
>      struct aldap_page_control *page)
>  {
> -     int len;
> +     ssize_t len;
>       struct ber c;
>       struct ber_element *ber = NULL;
>  
> Index: usr.bin/ldap/ber.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/ldap/ber.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 ber.c
> --- usr.bin/ldap/ber.c        3 Aug 2018 01:51:28 -0000       1.18
> +++ usr.bin/ldap/ber.c        12 Aug 2018 01:53:10 -0000
> @@ -802,7 +802,7 @@ ber_get_writebuf(struct ber *b, void **b
>   *   >=0     number of bytes written
>   *   -1      on failure and sets errno
>   */
> -int
> +ssize_t
>  ber_write_elements(struct ber *ber, struct ber_element *root)
>  {
>       size_t len;
> Index: usr.bin/ldap/ber.h
> ===================================================================
> RCS file: /cvs/src/usr.bin/ldap/ber.h,v
> retrieving revision 1.6
> diff -u -p -r1.6 ber.h
> --- usr.bin/ldap/ber.h        3 Aug 2018 01:51:28 -0000       1.6
> +++ usr.bin/ldap/ber.h        12 Aug 2018 01:53:10 -0000
> @@ -124,7 +124,7 @@ int                        ber_string2oid(const char *, 
> stru
>  struct ber_element   *ber_printf_elements(struct ber_element *, char *, ...);
>  int                   ber_scanf_elements(struct ber_element *, char *, ...);
>  ssize_t                       ber_get_writebuf(struct ber *, void **);
> -int                   ber_write_elements(struct ber *, struct ber_element *);
> +ssize_t                       ber_write_elements(struct ber *, struct 
> ber_element *);
>  void                  ber_set_readbuf(struct ber *, void *, size_t);
>  struct ber_element   *ber_read_elements(struct ber *, struct ber_element *);
>  off_t                         ber_getpos(struct ber_element *);
> cvs server: Diffing usr.sbin
> cvs server: Diffing usr.sbin/ldapd
> Index: usr.sbin/ldapd/ber.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ldapd/ber.c,v
> retrieving revision 1.28
> diff -u -p -r1.28 ber.c
> --- usr.sbin/ldapd/ber.c      3 Aug 2018 01:51:28 -0000       1.28
> +++ usr.sbin/ldapd/ber.c      12 Aug 2018 01:53:10 -0000
> @@ -802,7 +802,7 @@ ber_get_writebuf(struct ber *b, void **b
>   *   >=0     number of bytes written
>   *   -1      on failure and sets errno
>   */
> -int
> +ssize_t
>  ber_write_elements(struct ber *ber, struct ber_element *root)
>  {
>       size_t len;
> Index: usr.sbin/ldapd/ber.h
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ldapd/ber.h,v
> retrieving revision 1.7
> diff -u -p -r1.7 ber.h
> --- usr.sbin/ldapd/ber.h      3 Aug 2018 01:51:28 -0000       1.7
> +++ usr.sbin/ldapd/ber.h      12 Aug 2018 01:53:10 -0000
> @@ -124,7 +124,7 @@ int                        ber_string2oid(const char *, 
> stru
>  struct ber_element   *ber_printf_elements(struct ber_element *, char *, ...);
>  int                   ber_scanf_elements(struct ber_element *, char *, ...);
>  ssize_t                       ber_get_writebuf(struct ber *, void **);
> -int                   ber_write_elements(struct ber *, struct ber_element *);
> +ssize_t                       ber_write_elements(struct ber *, struct 
> ber_element *);
>  void                  ber_set_readbuf(struct ber *, void *, size_t);
>  struct ber_element   *ber_read_elements(struct ber *, struct ber_element *);
>  off_t                         ber_getpos(struct ber_element *);
> Index: usr.sbin/ldapd/ldape.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ldapd/ldape.c,v
> retrieving revision 1.29
> diff -u -p -r1.29 ldape.c
> --- usr.sbin/ldapd/ldape.c    31 Jul 2018 11:01:00 -0000      1.29
> +++ usr.sbin/ldapd/ldape.c    12 Aug 2018 01:53:10 -0000
> @@ -72,7 +72,7 @@ void
>  send_ldap_extended_response(struct conn *conn, int msgid, unsigned int type,
>      long long result_code, const char *extended_oid)
>  {
> -     int                      rc;
> +     ssize_t                  rc;
>       struct ber_element      *root, *elm;
>       void                    *buf;
>  
> @@ -117,7 +117,7 @@ ldap_refer(struct request *req, const ch
>       struct referral         *ref;
>       long long                result_code = LDAP_REFERRAL;
>       unsigned int             type;
> -     int                      rc;
> +     ssize_t                  rc;
>       void                    *buf;
>       char                    *url, *scope_str = NULL;
>  
> cvs server: Diffing usr.sbin/ldapd/schema
> cvs server: Diffing usr.sbin/snmpd
> Index: usr.sbin/snmpd/ber.3
> ===================================================================
> RCS file: /cvs/src/usr.sbin/snmpd/ber.3,v
> retrieving revision 1.17
> diff -u -p -r1.17 ber.3
> --- usr.sbin/snmpd/ber.3      31 Jul 2018 11:01:29 -0000      1.17
> +++ usr.sbin/snmpd/ber.3      12 Aug 2018 01:53:10 -0000
> @@ -130,7 +130,7 @@
>  .Fn "ber_scanf_elements" "struct ber_element *root" "char *format" "..."
>  .Ft "ssize_t"
>  .Fn "ber_get_writebuf" "struct ber *ber" "void **buf"
> -.Ft "int"
> +.Ft "ssize_t"
>  .Fn "ber_write_elements" "struct ber *ber" "struct ber_element *root"
>  .Ft "void"
>  .Fn "ber_set_readbuf" "struct ber *ber" "void *buf" "size_t len"
> Index: usr.sbin/snmpd/ber.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/snmpd/ber.c,v
> retrieving revision 1.47
> diff -u -p -r1.47 ber.c
> --- usr.sbin/snmpd/ber.c      3 Aug 2018 01:51:28 -0000       1.47
> +++ usr.sbin/snmpd/ber.c      12 Aug 2018 01:53:10 -0000
> @@ -802,7 +802,7 @@ ber_get_writebuf(struct ber *b, void **b
>   *   >=0     number of bytes written
>   *   -1      on failure and sets errno
>   */
> -int
> +ssize_t
>  ber_write_elements(struct ber *ber, struct ber_element *root)
>  {
>       size_t len;
> Index: usr.sbin/snmpd/ber.h
> ===================================================================
> RCS file: /cvs/src/usr.sbin/snmpd/ber.h,v
> retrieving revision 1.13
> diff -u -p -r1.13 ber.h
> --- usr.sbin/snmpd/ber.h      3 Aug 2018 01:51:28 -0000       1.13
> +++ usr.sbin/snmpd/ber.h      12 Aug 2018 01:53:10 -0000
> @@ -124,7 +124,7 @@ int                        ber_string2oid(const char *, 
> stru
>  struct ber_element   *ber_printf_elements(struct ber_element *, char *, ...);
>  int                   ber_scanf_elements(struct ber_element *, char *, ...);
>  ssize_t                       ber_get_writebuf(struct ber *, void **);
> -int                   ber_write_elements(struct ber *, struct ber_element *);
> +ssize_t                       ber_write_elements(struct ber *, struct 
> ber_element *);
>  void                  ber_set_readbuf(struct ber *, void *, size_t);
>  struct ber_element   *ber_read_elements(struct ber *, struct ber_element *);
>  off_t                         ber_getpos(struct ber_element *);
> Index: usr.sbin/snmpd/usm.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/snmpd/usm.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 usm.c
> --- usr.sbin/snmpd/usm.c      8 Feb 2018 18:02:06 -0000       1.12
> +++ usr.sbin/snmpd/usm.c      12 Aug 2018 01:53:11 -0000
> @@ -336,7 +336,8 @@ usm_encode(struct snmp_message *msg, str
>       struct ber_element      *usm, *a, *res = NULL;
>       void                    *ptr;
>       char                     digest[SNMP_USM_DIGESTLEN];
> -     size_t                   digestlen, saltlen, len;
> +     size_t                   digestlen, saltlen;
> +     ssize_t                  len;
>  
>       msg->sm_digest_offs = 0;
>       bzero(&ber, sizeof(ber));
> @@ -414,8 +415,7 @@ usm_encrypt(struct snmp_message *msg, st
>       struct ber               ber;
>       struct ber_element      *encrpdu = NULL;
>       void                    *ptr;
> -     int                      len;
> -     ssize_t                  elen;
> +     ssize_t                  elen, len;
>       u_char                   encbuf[READ_BUF_SIZE];
>  
>       if (!MSG_HAS_PRIV(msg))
> cvs server: Diffing usr.sbin/ypldap
> Index: usr.sbin/ypldap/aldap.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ypldap/aldap.c,v
> retrieving revision 1.42
> diff -u -p -r1.42 aldap.c
> --- usr.sbin/ypldap/aldap.c   31 Jul 2018 11:37:18 -0000      1.42
> +++ usr.sbin/ypldap/aldap.c   12 Aug 2018 01:53:11 -0000
> @@ -126,10 +126,10 @@ aldap_tls(struct aldap *ldap, struct tls
>  int
>  aldap_send(struct aldap *ldap, struct ber_element *root)
>  {
> -     int error, wrote;
>       void *ptr;
>       char *data;
>       size_t len, done;
> +     ssize_t error, wrote;
>  
>       len = ber_calc_len(root);
>       error = ber_write_elements(&ldap->ber, root);
> @@ -311,7 +311,7 @@ int
>  aldap_create_page_control(struct ber_element *elm, int size,
>      struct aldap_page_control *page)
>  {
> -     int len;
> +     ssize_t len;
>       struct ber c;
>       struct ber_element *ber = NULL;
>  
> Index: usr.sbin/ypldap/ber.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ypldap/ber.c,v
> retrieving revision 1.30
> diff -u -p -r1.30 ber.c
> --- usr.sbin/ypldap/ber.c     3 Aug 2018 01:51:28 -0000       1.30
> +++ usr.sbin/ypldap/ber.c     12 Aug 2018 01:53:11 -0000
> @@ -802,7 +802,7 @@ ber_get_writebuf(struct ber *b, void **b
>   *   >=0     number of bytes written
>   *   -1      on failure and sets errno
>   */
> -int
> +ssize_t
>  ber_write_elements(struct ber *ber, struct ber_element *root)
>  {
>       size_t len;
> Index: usr.sbin/ypldap/ber.h
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ypldap/ber.h,v
> retrieving revision 1.8
> diff -u -p -r1.8 ber.h
> --- usr.sbin/ypldap/ber.h     3 Aug 2018 01:51:28 -0000       1.8
> +++ usr.sbin/ypldap/ber.h     12 Aug 2018 01:53:11 -0000
> @@ -124,7 +124,7 @@ int                        ber_string2oid(const char *, 
> stru
>  struct ber_element   *ber_printf_elements(struct ber_element *, char *, ...);
>  int                   ber_scanf_elements(struct ber_element *, char *, ...);
>  ssize_t                       ber_get_writebuf(struct ber *, void **);
> -int                   ber_write_elements(struct ber *, struct ber_element *);
> +ssize_t                       ber_write_elements(struct ber *, struct 
> ber_element *);
>  void                  ber_set_readbuf(struct ber *, void *, size_t);
>  struct ber_element   *ber_read_elements(struct ber *, struct ber_element *);
>  off_t                         ber_getpos(struct ber_element *);
> 

-- 
:wq Claudio

Reply via email to