Browse Source

Increased max path size

Andrea Luzzardi 17 years ago
parent
commit
f6f9a66203
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      src/conf.c
  2. +1
    -1
      src/conf.h
  3. +1
    -1
      src/local.c

+ 1
- 1
src/conf.c View File

@ -132,7 +132,7 @@ int pusb_conf_init(t_pusb_options *opts)
log_error("uname: %s\n", strerror(errno)); log_error("uname: %s\n", strerror(errno));
return (0); return (0);
} }
strncpy(opts->hostname, u.nodename, sizeof(opts->hostname));
strncpy(opts->hostname, u.nodename, sizeof(opts->hostname) - 1);
if (strlen(u.nodename) > sizeof(opts->hostname)) if (strlen(u.nodename) > sizeof(opts->hostname))
log_info("Hostname \"%s\" is too long, truncating to \"%s\".\n", log_info("Hostname \"%s\" is too long, truncating to \"%s\".\n",
u.nodename, opts->hostname); u.nodename, opts->hostname);


+ 1
- 1
src/conf.h View File

@ -47,7 +47,7 @@ typedef struct pusb_options
int color_log; int color_log;
int one_time_pad; int one_time_pad;
time_t pad_expiration; time_t pad_expiration;
char hostname[32];
char hostname[64];
char system_pad_directory[PATH_MAX]; char system_pad_directory[PATH_MAX];
char device_pad_directory[PATH_MAX]; char device_pad_directory[PATH_MAX];
t_pusb_device device; t_pusb_device device;


+ 1
- 1
src/local.c View File

@ -39,7 +39,7 @@ int pusb_local_login(t_pusb_options *opts, const char *user)
if (!strncmp(from, "/dev/", strlen("/dev/"))) if (!strncmp(from, "/dev/", strlen("/dev/")))
from += strlen("/dev/"); from += strlen("/dev/");
log_debug("Authentication request from tty %s\n", from); log_debug("Authentication request from tty %s\n", from);
strncpy(utsearch.ut_line, from, sizeof(utsearch.ut_line));
strncpy(utsearch.ut_line, from, sizeof(utsearch.ut_line) - 1);
setutent(); setutent();
utent = getutline(&utsearch); utent = getutline(&utsearch);
endutent(); endutent();


Loading…
Cancel
Save