Make the user-agent string a bit less verbose

We shouldn't pass things like the kernel version in the user agent string,
as it may be a bit too revealing and is not really necessary.

Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=57555

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2008-01-11 09:25:44 -06:00
parent f9a7d8cba4
commit 318d5c4ba8
1 changed files with 2 additions and 4 deletions

View File

@ -179,14 +179,12 @@ static void localize(void)
*/
static void setuseragent(void)
{
const char *pacman = "Pacman/" PACKAGE_VERSION;
const char *libalpm = "libalpm/" LIB_VERSION;
char agent[101];
struct utsname un;
uname(&un);
snprintf(agent, 100, "%s (%s %s %s; %s) %s", pacman, un.sysname,
un.machine, un.release, setlocale(LC_MESSAGES, NULL), libalpm);
snprintf(agent, 100, "pacman/" PACKAGE_VERSION " (%s %s) libalpm/" LIB_VERSION,
un.sysname, un.machine);
setenv("HTTP_USER_AGENT", agent, 0);
}