bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2008-2018 Dovecot authors, see the included COPYING file */
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainenstatic bool readfile(const char *path, const char **data_r)
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainenstatic bool lsb_distro_get(const char *path, const char **name_r)
ba5c8b0ae7460752adaf911901bf263788f62c72Phil Carmody for (p = t_strsplit(data, "\n"); *p != NULL; p++) {
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen if (strncmp(*p, "DISTRIB_DESCRIPTION=", 20) == 0)
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen *name_r = str_unescape(p_strdup_until(unsafe_data_stack_pool,
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen unsigned int i;
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen if (lsb_distro_get("/etc/lsb-release", &name))
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen return t_strconcat(files[i], t_strcut(name, '\n'),
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainenstatic const char *filesystem_get(const char *mail_location)
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen /* we don't know where users' home dirs are */
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen /* all in all it seems we can support only /<path>/%u style location */
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen if (mountpoint_get(path, pool_datastack_create(), &mp) < 0)
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainenconst char *sysinfo_get(const char *mail_location)
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen const char *distro = "", *fs, *uname_info = "";
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen if (*uname_info == '\0' && *distro == '\0' && *fs == '\0')
c1847a38dfbc8bad29547d96432ef9d707dbd345Timo Sirainen return t_strdup_printf("OS: %s %s %s %s %s", u.sysname, u.release, u.machine, distro, fs);