chiark / gitweb /
build fix
[disorder] / lib / configuration.c
index 35573c5c15dc6d03c26248315cc509132f21facb..34f8d53842473a5785ca7f8b7e203bc6515db2f8 100644 (file)
@@ -896,6 +896,7 @@ static const struct conf conf[] = {
   { C2(restrict, restrictions),         &type_restrict,         validate_any },
   { C(sample_format),    &type_sample_format,    validate_sample_format },
   { C(scratch),          &type_string_accum,     validate_isreg },
+  { C(short_display),    &type_integer,          validate_positive },
   { C(signal),           &type_signal,           validate_any },
   { C(sox_generation),   &type_integer,          validate_non_negative },
   { C(speaker_backend),  &type_backend,          validate_any },
@@ -1023,6 +1024,7 @@ static struct config *config_default(void) {
   c->multicast_ttl = 1;
   c->authorization_algorithm = xstrdup("sha1");
   c->noticed_history = 31;
+  c->short_display = 32;
   return c;
 }
 
@@ -1186,6 +1188,8 @@ char *config_private(void) {
 char *config_userconf(const char *home, const struct passwd *pw) {
   char *s;
 
+  if(!home && !pw && !(pw = getpwuid(getuid())))
+    fatal(0, "cannot determine our username");
   byte_xasprintf(&s, "%s/.disorder/passwd", home ? home : pw->pw_dir);
   return s;
 }