#define SHADOW_PASSWD_STRING "x"
#endif
-#define SHADOW_SP_FLAG_UNSET ((unsigned long int)-1)
+#define SHADOW_SP_FLAG_UNSET ((unsigned long)-1)
#ifdef WITH_AUDIT
#ifdef __u8 /* in case we use pam < 0.80 */
int get_gid (const char *gidstr, gid_t *gid)
{
- long long int val;
+ long long val;
char *endptr;
errno = 0;
int get_pid (const char *pidstr, pid_t *pid)
{
- long long int val;
+ long long val;
char *endptr;
errno = 0;
*/
int get_pidfd_from_fd(const char *pidfdstr)
{
- long long int val;
+ long long val;
char *endptr;
struct stat st;
dev_t proc_st_dev, proc_st_rdev;
int get_uid (const char *uidstr, uid_t *uid)
{
- long long int val;
+ long long val;
char *endptr;
errno = 0;
*/
extern /*@only@*//*@null@*/struct group *getgr_nam_gid (/*@null@*/const char *grname)
{
- long long int gid;
+ long long gid;
char *endptr;
if (NULL == grname) {
*
* Returns 0 on failure, 1 on success.
*/
-int getlong (const char *numstr, /*@out@*/long int *result)
+int getlong (const char *numstr, /*@out@*/long *result)
{
long val;
char *endptr;
*
* Returns 0 on failure, 1 on success.
*/
-int getulong (const char *numstr, /*@out@*/unsigned long int *result)
+int getulong (const char *numstr, /*@out@*/unsigned long *result)
{
- unsigned long int val;
+ unsigned long val;
char *endptr;
errno = 0;
static int set_umask (const char *value)
{
- unsigned long int mask;
+ unsigned long mask;
if ( (getulong (value, &mask) == 0)
|| (mask != (mode_t) mask)) {
}
if (strncmp (cp, "pri=", 4) == 0) {
- long int inc;
+ long inc;
+
if ( (getlong (cp + 4, &inc) == 1)
&& (inc >= -20) && (inc <= 20)) {
errno = 0;
continue;
}
if (strncmp (cp, "ulimit=", 7) == 0) {
- long int blocks;
+ long blocks;
+
if ( (getlong (cp + 7, &blocks) == 0)
|| (blocks != (int) blocks)
|| (set_filesize_limit (blocks) != 0)) {
continue;
}
if (strncmp (cp, "umask=", 6) == 0) {
- unsigned long int mask;
+ unsigned long mask;
+
if ( (getulong (cp + 6, &mask) == 0)
|| (mask != (mode_t) mask)) {
SYSLOG ((LOG_WARN,
extern struct group *prefix_getgr_nam_gid(const char *grname)
{
- long long int gid;
+ long long gid;
char *endptr;
struct group *g;
extern /*@only@*//*@null@*/struct group *getgr_nam_gid (/*@null@*/const char *grname);
/* getlong.c */
-extern int getlong (const char *numstr, /*@out@*/long int *result);
+extern int getlong (const char *numstr, /*@out@*/long *result);
/* get_pid.c */
extern int get_pid (const char *pidstr, pid_t *pid);
extern int get_uid (const char *uidstr, uid_t *uid);
/* getulong.c */
-extern int getulong (const char *numstr, /*@out@*/unsigned long int *result);
+extern int getulong (const char *numstr, /*@out@*/unsigned long *result);
/* fputsx.c */
extern /*@null@*/char *fgetsx (/*@returned@*/ /*@out@*/char *, int, FILE *);
return NULL;
}
owner_uid = pwd->pw_uid;
- ret = snprintf(owner_uid_string, sizeof (owner_uid_string), "%lu", (unsigned long int)owner_uid);
+ ret = snprintf(owner_uid_string, sizeof (owner_uid_string), "%lu", (unsigned long)owner_uid);
if (ret < 0 || (size_t)ret >= sizeof (owner_uid_string))
return NULL;
if (__builtin_mul_overflow(uid, sizeof(*fl), &offset)) {
fprintf(stderr,
_("%s: Failed to get the entry for UID %lu\n"),
- Prog, (unsigned long int)uid);
+ Prog, (unsigned long)uid);
return -1;
}
if (fread(fl, sizeof(*fl), 1, fail) != 1) {
fprintf(stderr,
_("%s: Failed to get the entry for UID %lu\n"),
- Prog, (unsigned long int)uid);
+ Prog, (unsigned long)uid);
return -1;
}
} else {
fprintf (stderr,
_("%s: Failed to reset fail count for UID %lu\n"),
- Prog, (unsigned long int)uid);
+ Prog, (unsigned long)uid);
return true;
}
fprintf (stderr,
_("%s: Failed to set max for UID %lu\n"),
- Prog, (unsigned long int)uid);
+ Prog, (unsigned long)uid);
return true;
}
fprintf (stderr,
_("%s: Failed to set locktime for UID %lu\n"),
- Prog, (unsigned long int)uid);
+ Prog, (unsigned long)uid);
return true;
}
break;
case 'm':
{
- long int lmax;
+ long lmax;
+
if ( (getlong (optarg, &lmax) == 0)
- || ((long int)(short) lmax != lmax)) {
+ || ((long)(short) lmax != lmax)) {
fprintf (stderr,
_("%s: invalid numeric argument '%s'\n"),
Prog, optarg);
} else {
fprintf (stderr,
_("%s: GID '%lu' already exists\n"),
- Prog, (unsigned long int) group_id);
+ Prog, (unsigned long) group_id);
exit (E_GID_IN_USE);
}
}
*/
fprintf (stderr,
_("%s: GID '%lu' already exists\n"),
- Prog, (unsigned long int) group_newid);
+ Prog, (unsigned long) group_newid);
exit (E_GID_IN_USE);
}
if (fread (&ll, sizeof (ll), 1, lastlogfile) != 1) {
fprintf (stderr,
_("%s: Failed to get the entry for UID %lu\n"),
- Prog, (unsigned long int)pw->pw_uid);
+ Prog, (unsigned long)pw->pw_uid);
exit (EXIT_FAILURE);
}
} else {
if (fwrite (&ll, sizeof(ll), 1, lastlogfile) != 1) {
fprintf (stderr,
_("%s: Failed to update the entry for UID %lu\n"),
- Prog, (unsigned long int)pw->pw_uid);
+ Prog, (unsigned long)pw->pw_uid);
exit (EXIT_FAILURE);
}
}
(getgid() != st.st_gid)) {
fprintf(stderr, _( "%s: Target process is owned by a different user: uid:%lu pw_uid:%lu st_uid:%lu, gid:%lu pw_gid:%lu st_gid:%lu\n" ),
Prog,
- (unsigned long int)getuid(), (unsigned long int)pw->pw_uid, (unsigned long int)st.st_uid,
- (unsigned long int)getgid(), (unsigned long int)pw->pw_gid, (unsigned long int)st.st_gid);
+ (unsigned long)getuid(), (unsigned long)pw->pw_uid, (unsigned long)st.st_uid,
+ (unsigned long)getgid(), (unsigned long)pw->pw_gid, (unsigned long)st.st_gid);
return EXIT_FAILURE;
}
(getgid() != st.st_gid)) {
fprintf(stderr, _( "%s: Target process is owned by a different user: uid:%lu pw_uid:%lu st_uid:%lu, gid:%lu pw_gid:%lu st_gid:%lu\n" ),
Prog,
- (unsigned long int)getuid(), (unsigned long int)pw->pw_uid, (unsigned long int)st.st_uid,
- (unsigned long int)getgid(), (unsigned long int)pw->pw_gid, (unsigned long int)st.st_gid);
+ (unsigned long)getuid(), (unsigned long)pw->pw_uid, (unsigned long)st.st_uid,
+ (unsigned long)getgid(), (unsigned long)pw->pw_gid, (unsigned long)st.st_gid);
return EXIT_FAILURE;
}
{
const struct group *grp;
struct group *result_grp = NULL;
- long long int gid;
+ long long gid;
char *endptr;
gid = strtoll (grp_name, &endptr, 10);
errno = 0;
first = strtoll(str, &pos, 10);
if (('\0' == *str) || ('-' != *pos ) || (ERANGE == errno) ||
- (first != (unsigned long int)first))
+ (first != (unsigned long)first))
goto out;
errno = 0;
last = strtoll(pos + 1, &pos, 10);
if (('\0' != *pos ) || (ERANGE == errno) ||
- (last != (unsigned long int)last))
+ (last != (unsigned long)last))
goto out;
if (first > last)
goto out;
- result.first = (unsigned long int)first;
- result.last = (unsigned long int)last;
+ result.first = (unsigned long)first;
+ result.last = (unsigned long)last;
out:
return result;
}