2011-05-31 08:00:39 +00:00
|
|
|
diff -up shadow-4.1.4.3/src/faillog.c.underflow shadow-4.1.4.3/src/faillog.c
|
|
|
|
--- shadow-4.1.4.3/src/faillog.c.underflow 2011-02-13 12:58:16.000000000 -0500
|
|
|
|
+++ shadow-4.1.4.3/src/faillog.c 2011-05-30 17:48:55.000000000 -0400
|
2010-06-14 11:15:21 +00:00
|
|
|
@@ -106,8 +106,8 @@ static void print_one (/*@null@*/const s
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
- offset = pw->pw_uid * sizeof (fl);
|
|
|
|
- if (offset <= (statbuf.st_size - sizeof (fl))) {
|
|
|
|
+ offset = (off_t) pw->pw_uid * sizeof (fl);
|
|
|
|
+ if (offset + sizeof (fl) <= statbuf.st_size) {
|
|
|
|
/* fseeko errors are not really relevant for us. */
|
|
|
|
int err = fseeko (fail, offset, SEEK_SET);
|
|
|
|
assert (0 == err);
|
|
|
|
@@ -206,8 +206,8 @@ static bool reset_one (uid_t uid)
|
|
|
|
off_t offset;
|
|
|
|
struct faillog fl;
|
|
|
|
|
|
|
|
- offset = uid * sizeof (fl);
|
|
|
|
- if (offset <= (statbuf.st_size - sizeof (fl))) {
|
|
|
|
+ offset = (off_t) uid * sizeof (fl);
|
|
|
|
+ if (offset + sizeof (fl) <= statbuf.st_size) {
|
|
|
|
/* fseeko errors are not really relevant for us. */
|
|
|
|
int err = fseeko (fail, offset, SEEK_SET);
|
|
|
|
assert (0 == err);
|
|
|
|
@@ -294,7 +294,7 @@ static bool setmax_one (uid_t uid, int m
|
|
|
|
struct faillog fl;
|
|
|
|
|
|
|
|
offset = (off_t) uid * sizeof (fl);
|
|
|
|
- if (offset <= (statbuf.st_size - sizeof (fl))) {
|
|
|
|
+ if (offset + sizeof (fl) <= statbuf.st_size) {
|
|
|
|
/* fseeko errors are not really relevant for us. */
|
|
|
|
int err = fseeko (fail, offset, SEEK_SET);
|
|
|
|
assert (0 == err);
|
|
|
|
@@ -385,7 +385,7 @@ static bool set_locktime_one (uid_t uid,
|
|
|
|
struct faillog fl;
|
|
|
|
|
|
|
|
offset = (off_t) uid * sizeof (fl);
|
|
|
|
- if (offset <= (statbuf.st_size - sizeof (fl))) {
|
|
|
|
+ if (offset + sizeof (fl) <= statbuf.st_size) {
|
|
|
|
/* fseeko errors are not really relevant for us. */
|
|
|
|
int err = fseeko (fail, offset, SEEK_SET);
|
|
|
|
assert (0 == err);
|
2011-05-31 08:00:39 +00:00
|
|
|
diff -up shadow-4.1.4.3/src/lastlog.c.underflow shadow-4.1.4.3/src/lastlog.c
|
|
|
|
--- shadow-4.1.4.3/src/lastlog.c.underflow 2011-05-31 03:52:25.000000000 -0400
|
|
|
|
+++ shadow-4.1.4.3/src/lastlog.c 2011-05-31 03:53:32.000000000 -0400
|
|
|
|
@@ -102,9 +102,8 @@ static void print_one (/*@null@*/const s
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- offset = pw->pw_uid * sizeof (ll);
|
|
|
|
-
|
|
|
|
- if (offset <= (statbuf.st_size - sizeof (ll))) {
|
|
|
|
+ offset = (off_t) pw->pw_uid * sizeof (ll);
|
2011-06-06 07:07:51 +00:00
|
|
|
+ if (offset + sizeof (ll) <= statbuf.st_size) {
|
2011-05-31 08:00:39 +00:00
|
|
|
/* fseeko errors are not really relevant for us. */
|
|
|
|
int err = fseeko (lastlogfile, offset, SEEK_SET);
|
|
|
|
assert (0 == err);
|