From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3778 invoked by alias); 15 Mar 2007 12:35:58 -0000 Received: (qmail 3756 invoked by uid 22791); 15 Mar 2007 12:35:57 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 15 Mar 2007 12:35:53 +0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id l2FCdeWK006562; Thu, 15 Mar 2007 13:39:40 +0100 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id l2FCde3c006555; Thu, 15 Mar 2007 13:39:40 +0100 Date: Thu, 15 Mar 2007 12:35:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix updwtmp on 32-bit arches Message-ID: <20070315123939.GN1826@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2007-03/txt/msg00022.txt.bz2 Hi! updwtmp etc. can't apparently handle >= 2GB wtmp on 32-bit architectures. 2007-03-15 Jakub Jelinek [BZ #4130] * login/utmp_file.c (setutent_file): Use O_LARGEFILE for open_not_cancel_2. (updwtmp_file): Likewise. --- libc/login/utmp_file.c.jj 2005-12-14 12:33:40.000000000 +0100 +++ libc/login/utmp_file.c 2007-03-15 13:30:19.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1996-2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper and Paul Janzen , 1996. @@ -140,11 +140,11 @@ setutent_file (void) file_name = TRANSFORM_UTMP_FILE_NAME (__libc_utmp_file_name); - file_fd = open_not_cancel_2 (file_name, O_RDWR); + file_fd = open_not_cancel_2 (file_name, O_RDWR | O_LARGEFILE); if (file_fd == -1) { /* Hhm, read-write access did not work. Try read-only. */ - file_fd = open_not_cancel_2 (file_name, O_RDONLY); + file_fd = open_not_cancel_2 (file_name, O_RDONLY | O_LARGEFILE); if (file_fd == -1) return 0; } @@ -459,7 +459,7 @@ updwtmp_file (const char *file, const st int fd; /* Open WTMP file. */ - fd = open_not_cancel_2 (file, O_WRONLY); + fd = open_not_cancel_2 (file, O_WRONLY | O_LARGEFILE); if (fd < 0) return -1; Jakub