Skip to content

Commit d9b04c5

Browse files
author
Árni Dagur
committed
Use libc::c_long as the integer type
1 parent 72ed1f1 commit d9b04c5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/shadow.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ pub struct Shadow {
2929
/// It is expressed as the number of days since Jan 1, 1970. The value 0
3030
/// has a special meaning, which is that the user should change their
3131
/// password the next time they will log in the system
32-
pub last_change: i64,
32+
pub last_change: libc::c_long,
3333
/// Minimum password age
3434
///
3535
/// The minimum password age is the number of days the user will have to
3636
/// wait before she will be allowed to change their password again.
3737
/// An empty field and value 0 mean that there are no minimum password age.
38-
pub min: i64,
38+
pub min: libc::c_long,
3939
/// Maximum password age
4040
///
4141
/// The maximum password age is the number of days after which the user
@@ -47,15 +47,15 @@ pub struct Shadow {
4747
///
4848
/// If the maximum password age is lower than the minimum password age, the
4949
/// user cannot change their password.
50-
pub max: i64,
50+
pub max: libc::c_long,
5151
/// Password warning period
5252
///
5353
/// The number of days before a password is going to expire (see the
5454
/// maximum password age above) during which the user should be warned.
5555
///
5656
/// An empty field and value 0 mean that there are no password warning
5757
/// period.
58-
pub warn: i64,
58+
pub warn: libc::c_long,
5959
/// Password inactivity period
6060
///
6161
/// The number of days after a password has expired (see the maximum
@@ -65,7 +65,7 @@ pub struct Shadow {
6565
/// After expiration of the password and this expiration period is elapsed,
6666
/// no login is possible using the current user's password. The user should
6767
/// contact their system administrator.
68-
pub inactive: i64,
68+
pub inactive: libc::c_long,
6969
/// Account expiration date
7070
///
7171
/// The date of expiration of the account, expressed as the number of days
@@ -78,7 +78,7 @@ pub struct Shadow {
7878
///
7979
/// The value 0 should not be used as it is interpreted as either an account
8080
/// with no expiration, or as an expiration on Jan 1, 1970.
81-
pub expire: i64,
81+
pub expire: libc::c_long,
8282
}
8383

8484
impl From<&libc::spwd> for Shadow {
@@ -89,12 +89,12 @@ impl From<&libc::spwd> for Shadow {
8989
// These casts are necessary to convert the C `long int`
9090
// integers (which can be either 32 or 64 bits, depending on
9191
// the CPU architecture) into 64 bit integers.
92-
last_change: spwd.sp_lstchg as i64,
93-
min: spwd.sp_min as i64,
94-
max: spwd.sp_max as i64,
95-
warn: spwd.sp_warn as i64,
96-
inactive: spwd.sp_inact as i64,
97-
expire: spwd.sp_expire as i64,
92+
last_change: spwd.sp_lstchg,
93+
min: spwd.sp_min,
94+
max: spwd.sp_max,
95+
warn: spwd.sp_warn,
96+
inactive: spwd.sp_inact,
97+
expire: spwd.sp_expire,
9898
}
9999
}
100100
}

0 commit comments

Comments
 (0)