[sslh] [PATCH 07/10] Fix typos and type warnings

ondra+sslh at mistotebe.net ondra+sslh at mistotebe.net
Tue Sep 24 00:30:37 CEST 2013


From: Ondřej Kuzník <ondra at mistotebe.net>

---
 common.c      | 10 +++++-----
 sslh-main.c   |  2 +-
 sslh-select.c |  2 +-
 t             |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/common.c b/common.c
index c230328..f8bf30b 100644
--- a/common.c
+++ b/common.c
@@ -230,7 +230,7 @@ void dump_connection(struct connection *cnx)
 /* 
  * moves data from one fd to other
  *
- * retuns number of bytes copied if success
+ * returns number of bytes copied if success
  * returns 0 (FD_CNXCLOSED) if incoming socket closed
  * returns FD_NODATA if no data was available
  * returns FD_STALLED if data was read, could not be written, and has been
@@ -265,7 +265,7 @@ int fd2fd(struct queue *target_q, struct queue *from_q)
 
    size_w = write(target, buffer, size_r);
    /* process -1 when we know how to deal with it */
-   if ((size_w == -1)) {
+   if (size_w == -1) {
        switch (errno) {
        case EAGAIN:
            /* write blocked: Defer data */
@@ -479,7 +479,7 @@ void setup_signals(void)
     res = sigaction(SIGCHLD, &action, NULL);
     CHECK_RES_DIE(res, "sigaction");
 
-    /* Set SIGTERM to exit. For some reason if it's not set explicitely,
+    /* Set SIGTERM to exit. For some reason if it's not set explicitly,
      * coverage information is lost when killing the process */
     memset(&action, 0, sizeof(action));
     action.sa_handler = exit;
@@ -507,7 +507,7 @@ void setup_syslog(const char* bin_name) {
     log_message(LOG_INFO, "%s %s started\n", server_type, VERSION);
 }
 
-/* We don't want to run as root -- drop priviledges if required */
+/* We don't want to run as root -- drop privileges if required */
 void drop_privileges(const char* user_name)
 {
     int res;
@@ -521,7 +521,7 @@ void drop_privileges(const char* user_name)
 
     res = setgid(pw->pw_gid);
     CHECK_RES_DIE(res, "setgid");
-    setuid(pw->pw_uid);
+    res = setuid(pw->pw_uid);
     CHECK_RES_DIE(res, "setuid");
 }
 
diff --git a/sslh-main.c b/sslh-main.c
index 26f8c73..e8f7649 100644
--- a/sslh-main.c
+++ b/sslh-main.c
@@ -272,7 +272,7 @@ static int config_parse(char *filename, struct addrinfo **listen, struct proto *
     config_lookup_bool(&config, "numeric", &numeric);
     config_lookup_bool(&config, "transparent", &transparent);
 
-    if (config_lookup_int(&config, "timeout", &timeout) == CONFIG_TRUE) {
+    if (config_lookup_int(&config, "timeout", (int *)&timeout) == CONFIG_TRUE) {
         probing_timeout = timeout;
     }
 
diff --git a/sslh-select.c b/sslh-select.c
index 5b4b2f0..70f0ebc 100644
--- a/sslh-select.c
+++ b/sslh-select.c
@@ -188,7 +188,7 @@ int is_fd_active(int fd, fd_set* set)
 }
 
 /* Main loop: the idea is as follow:
- * - fds_r and fds_w contain the file descritors to monitor in read and write
+ * - fds_r and fds_w contain the file descriptors to monitor in read and write
  * - When a file descriptor goes off, process it: read from it, write the data
  * to its corresponding pair.
  * - When a file descriptor blocks when writing, remove the read fd from fds_r,
diff --git a/t b/t
index ed2e26d..7bef47d 100755
--- a/t
+++ b/t
@@ -58,7 +58,7 @@ for my $binary (@binaries) {
         my $cmd = "./$binary -v -f -u $user --listen localhost:$sslh_port --ssh $ssh_address --ssl $ssl_address -P $pidfile";
         warn "$cmd\n";
         #exec $cmd;
-        exec "valgrind --leak-check=full ./sslh-select -v -f -u $user --listen localhost:$sslh_port --ssh $ssh_address -ssl $ssl_address -P $pidfile";
+        exec "valgrind --leak-check=full ./$binary -v -f -u $user --listen localhost:$sslh_port --ssh $ssh_address -ssl $ssl_address -P $pidfile";
         exit 0;
     }
     warn "spawned $sslh_pid\n";
-- 
1.8.4.rc3




More information about the sslh mailing list