1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-20 20:09:11 +00:00

* Read from utmp rather than wtmp since we are looking for current users

* Fix an integer underflow which could result in an infinite loop on startup

PR:		115771
Submitted by:	Marcin Wisnicki <mwisnicki+freebsd@gmail.com>
This commit is contained in:
Joe Marcus Clarke 2007-08-26 00:39:38 +00:00
parent 91ab42dc1d
commit baa9289b9b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=198315
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@
PORTNAME= gnome-volume-manager
PORTVERSION= 2.17.0
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= sysutils gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/${PORTNAME}/${PORTVERSION:R}

View File

@ -205,14 +205,14 @@
endutent ();
}
+#else
+ if ((fd = open (_PATH_WTMP, O_RDONLY, 0)) < 0 || fstat(fd, &sb) == -1) {
+ if ((fd = open (_PATH_UTMP, O_RDONLY, 0)) < 0 || fstat(fd, &sb) == -1) {
+ close (fd);
+ return TRUE;
+ }
+
+ len = (sb.st_size + sizeof(buf) - 1) / sizeof(buf);
+
+ while (!local && --len >= 0) {
+ while (!local && len-- > 0) {
+ if (lseek(fd, (off_t) (len * sizeof(buf)), L_SET) == -1 ||
+ (bytes = read (fd, buf, sizeof(buf))) == -1) {
+ close (fd);