The branch, master has been updated
       via  c71d6ec genrand: Slightly simplify do_reseed
       via  dd0e38b tevent: Fix Coverity ID 989236 Operands don't affect result
      from  f1781ad dsdb: remove a wrong comment in 
dsdb_check_access_on_dn_internal()

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c71d6ecbcb463dca64118652e941bb0a162d306f
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Jun 13 21:55:43 2013 +0200

    genrand: Slightly simplify do_reseed
    
    The only caller set "use_fd" to "true".
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@samba.org>
    Autobuild-Date(master): Fri Jun 14 20:29:56 CEST 2013 on sn-devel-104

commit dd0e38b5feb51c8aa44e76bb6c84202bf8373005
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Jun 13 20:35:32 2013 +0200

    tevent: Fix Coverity ID 989236 Operands don't affect result
    
    "unsigned" could be less than uint64_t, so idx==UINT64_MAX is always false.
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/tevent/tevent_poll.c |    2 +-
 lib/util/genrand.c       |   24 +++++++++++-------------
 2 files changed, 12 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tevent/tevent_poll.c b/lib/tevent/tevent_poll.c
index c6e2a00..75d0ced 100644
--- a/lib/tevent/tevent_poll.c
+++ b/lib/tevent/tevent_poll.c
@@ -546,7 +546,7 @@ static int poll_event_loop_poll(struct tevent_context *ev,
           the handler to remove itself when called */
 
        for (fde = ev->fd_events; fde; fde = fde->next) {
-               unsigned idx = fde->additional_flags;
+               uint64_t idx = fde->additional_flags;
                struct pollfd *pfd;
                uint16_t flags = 0;
 
diff --git a/lib/util/genrand.c b/lib/util/genrand.c
index 3dfaf08..0e5902f 100644
--- a/lib/util/genrand.c
+++ b/lib/util/genrand.c
@@ -163,25 +163,23 @@ static void do_filehash(const char *fname, unsigned char 
*the_hash)
  above...
 **************************************************************/
 
-static int do_reseed(bool use_fd, int fd)
+static int do_reseed(int fd)
 {
        unsigned char seed_inbuf[40];
        uint32_t v1, v2; struct timeval tval; pid_t mypid;
        int reseed_data = 0;
 
-       if (use_fd) {
-               if (fd == -1) {
-                       fd = open( "/dev/urandom", O_RDONLY,0);
-                       if (fd != -1) {
-                               smb_set_close_on_exec(fd);
-                       }
-               }
-               if (fd != -1
-                   && (read(fd, seed_inbuf, sizeof(seed_inbuf)) == 
sizeof(seed_inbuf))) {
-                       seed_random_stream(seed_inbuf, sizeof(seed_inbuf));
-                       return fd;
+       if (fd == -1) {
+               fd = open( "/dev/urandom", O_RDONLY,0);
+               if (fd != -1) {
+                       smb_set_close_on_exec(fd);
                }
        }
+       if (fd != -1
+           && (read(fd, seed_inbuf, sizeof(seed_inbuf)) == 
sizeof(seed_inbuf))) {
+               seed_random_stream(seed_inbuf, sizeof(seed_inbuf));
+               return fd;
+       }
 
        /* Add in some secret file contents */
 
@@ -244,7 +242,7 @@ _PUBLIC_ void generate_random_buffer(uint8_t *out, int len)
                        }
                }
 
-               urand_fd = do_reseed(true, urand_fd);
+               urand_fd = do_reseed(urand_fd);
                done_reseed = true;
        }
 


-- 
Samba Shared Repository

Reply via email to