Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_socket.c

    r1 r22  
    244244}
    245245
    246 int sh_socket_use (char * c)
     246int sh_socket_use (const char * c)
    247247{
    248248  return sh_util_flagval(c, &sh_socket_flaguse);
     
    289289#endif
    290290
    291 int sh_socket_uid (char * c)
     291int sh_socket_uid (const char * c)
    292292{
    293293  uid_t val = (uid_t) strtol (c, (char **)NULL, 10);
     
    301301}
    302302
    303 int sh_socket_password (char * c)
     303int sh_socket_password (const char * c)
    304304{
    305305#if defined(NEED_PASSWORD_AUTH)
     
    378378
    379379  name.sun_family = AF_FILE;
    380   strcpy (name.sun_path, sh_sockname);
     380  sl_strlcpy (name.sun_path, sh_sockname, sizeof(name.sun_path));
    381381
    382382  size = (offsetof (struct sockaddr_un, sun_path)
     
    878878
    879879  new = SH_ALLOC(sizeof(struct socket_cmd));
    880   strcpy (new->cmd, in->cmd);
    881   strcpy (new->clt, in->clt);
    882   strcpy (new->cti, sh_unix_time(0));
     880  sl_strlcpy (new->cmd, in->cmd, sizeof(new->cmd));
     881  sl_strlcpy (new->clt, in->clt, sizeof(new->clt));
     882  sl_strlcpy (new->cti, sh_unix_time(0), sizeof(new->cti));
    883883  new->next = cmdlist;
    884884  cmdlist   = new;
     
    896896      if (0 == sl_strcmp(new->clt, client_name))
    897897        {
    898           strcpy (new->cmd, in->cmd);
    899           strcpy (new->clt, in->clt);
    900           strcpy (new->cti, sh_unix_time(0));
     898          sl_strlcpy (new->cmd, in->cmd, sizeof(new->cmd));
     899          sl_strlcpy (new->clt, in->clt, sizeof(new->clt));
     900          sl_strlcpy (new->cti, sh_unix_time(0), sizeof(new->cti));
    901901          return;
    902902        }
     
    905905
    906906  new = SH_ALLOC(sizeof(struct socket_cmd));
    907   strcpy (new->cmd, in->cmd);
    908   strcpy (new->clt, in->clt);
    909   strcpy (new->cti, sh_unix_time(0));
     907  sl_strlcpy (new->cmd, in->cmd, sizeof(new->cmd));
     908  sl_strlcpy (new->clt, in->clt, sizeof(new->clt));
     909  sl_strlcpy (new->cti, sh_unix_time(0), sizeof(new->cti));
    910910  new->next = runlist;
    911911  runlist   = new;
Note: See TracChangeset for help on using the changeset viewer.