errno = EINVAL;
return 0;
}
- len = read (fd, buf, sizeof (buf) - 1);
+ len = read(fd, buf, sizeof(buf) - 1);
close (fd);
if (len <= 0) {
if (log) {
entries[n] = ptr;
n++;
}
- qsort (entries, n, sizeof (struct commonio_entry *), cmp);
+ qsort(entries, n, sizeof(struct commonio_entry *), cmp);
/* Take care of the head and tail separately */
db->head = entries[0];
goto fail;
}
- memzero (&sb, sizeof sb);
+ memzero(&sb, sizeof(sb));
if (NULL != db->fp) {
if (fstat (fileno (db->fp), &sb) != 0) {
(void) fclose (db->fp);
* See if this tty is listed in the console file.
*/
- while (fgets (buf, sizeof (buf), fp) != NULL) {
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
stpsep(buf, "\n");
if (streq(buf, tty)) {
(void) fclose (fp);
char buf[8192];
ssize_t cnt;
- cnt = read (ifd, buf, sizeof buf);
+ cnt = read(ifd, buf, sizeof(buf));
if (cnt < 0) {
if (errno == EINTR) {
continue;
char *cp;
for (; argc > 0; argc--, argv++) {
- if (strlen (*argv) >= sizeof variable) {
+ if (strlen(*argv) >= sizeof(variable)) {
continue; /* ignore long entries */
}
void failure (uid_t uid, const char *tty, struct faillog *fl)
{
int fd;
- off_t offset_uid = (off_t) (sizeof *fl) * uid;
+ off_t offset_uid = (off_t) sizeof(*fl) * uid;
/*
* Don't do anything if failure logging isn't set up.
*/
if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid)
- || (read (fd, fl, sizeof *fl) != (ssize_t) sizeof *fl)) {
+ || (read(fd, fl, sizeof(*fl)) != (ssize_t) sizeof(*fl))) {
/* This is not necessarily a failure. The file is
* initially zero length.
*
* might reset the counter. But the new failure will be
* logged.
*/
- memzero (fl, sizeof *fl);
+ memzero(fl, sizeof(*fl));
}
/*
*/
if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid)
- || (write_full(fd, fl, sizeof *fl) == -1)) {
+ || (write_full(fd, fl, sizeof(*fl)) == -1)) {
goto err_write;
}
{
int fd;
struct faillog fail;
- off_t offset_uid = (off_t) (sizeof *fl) * uid;
+ off_t offset_uid = (off_t) sizeof(*fl) * uid;
/*
* Suppress the check if the log file isn't there.
*/
if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid)
- || (read (fd, fl, sizeof *fl) != (ssize_t) sizeof *fl)) {
+ || (read(fd, fl, sizeof(*fl)) != (ssize_t) sizeof(*fl))) {
(void) close (fd);
return 1;
}
fail.fail_cnt = 0;
if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid)
- || (write_full(fd, &fail, sizeof fail) == -1)) {
+ || (write_full(fd, &fail, sizeof(fail)) == -1)) {
goto err_write;
}
char newf[200];
char *cp;
- if (maxsize > sizeof (newf)) {
- maxsize = sizeof (newf);
+ if (maxsize > sizeof(newf)) {
+ maxsize = sizeof(newf);
}
printf ("\t%s [%s]: ", prompt, buf);
/*
* Go through all of the lines in the file.
*/
- while (fgets (buf, sizeof (buf), fp) != NULL) {
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
/*
* Trim trailing whitespace.
if (NULL == fp) {
return false;
}
- for (found = false; !found && (fgets (buf, sizeof buf, fp) == buf);) {
+ for (found = false; !found && (fgets(buf, sizeof(buf), fp) == buf);) {
stpsep(buf, "\n");
found = streq(buf, pw->pw_shell) ||
streq(buf, pw->pw_name);
* for this UID. Negative UID's will create problems, but ...
*/
- offset = (off_t) pw->pw_uid * sizeof newlog;
+ offset = (off_t) pw->pw_uid * sizeof(newlog);
if (lseek (fd, offset, SEEK_SET) != offset) {
SYSLOG ((LOG_WARN,
* the way we read the old one in.
*/
- if (read (fd, &newlog, sizeof newlog) != (ssize_t) sizeof newlog) {
- memzero (&newlog, sizeof newlog);
+ if (read(fd, &newlog, sizeof(newlog)) != (ssize_t) sizeof(newlog)) {
+ memzero(&newlog, sizeof(newlog));
}
if (NULL != ll) {
*ll = newlog;
strncpy_a(newlog.ll_host, host);
#endif
if ( (lseek (fd, offset, SEEK_SET) != offset)
- || (write_full(fd, &newlog, sizeof newlog) == -1)) {
+ || (write_full(fd, &newlog, sizeof(newlog)) == -1)) {
goto err_write;
}
(void) fclose (fp);
}
}
- (void) gethostname (buf, sizeof buf);
+ (void) gethostname(buf, sizeof(buf));
printf (_("\n%s login: "), buf);
(void) fflush (stdout);
*/
memzero_a(buf);
- if (fgets (buf, sizeof buf, stdin) != buf) {
+ if (fgets(buf, sizeof(buf), stdin) != buf) {
exit (EXIT_FAILURE);
}
if (NULL == fp) {
return;
}
- while (fgets (buf, (int)(sizeof buf), fp) == buf) {
+ while (fgets(buf, (int) sizeof(buf), fp) == buf) {
if (stpsep(buf, "\n") == NULL)
break;
* Copy the string to a temporary buffer so the substrings can
* be modified to be NULL terminated.
*/
- if (strlen (line) >= sizeof rangebuf)
+ if (strlen(line) >= sizeof(rangebuf))
return NULL; /* fail if too long */
strcpy (rangebuf, line);
perror (typefile);
return;
}
- while (fgets (buf, sizeof buf, fp) == buf) {
+ while (fgets(buf, sizeof(buf), fp) == buf) {
if (strprefix(buf, "#")) {
continue;
}
fp = fopen (fname, "r");
if ( (NULL == fp)
- || (fgets (tzbuf, sizeof (tzbuf), fp) == NULL)) {
+ || (fgets(tzbuf, sizeof(tzbuf), fp) == NULL)) {
result = "TZ=CST6CDT";
} else {
stpsep(tzbuf, "\n");
if (NULL == sfile) {
return 0;
}
- while (fgets (line, sizeof (line), sfile) == line) {
+ while (fgets(line, sizeof(line), sfile) == line) {
if (strprefix(line, "Uid:\t")) {
unsigned long ruid, euid, suid;
* Append the new failure record and close the log file.
*/
- if (write_full(fd, failent, sizeof *failent) == -1) {
+ if (write_full(fd, failent, sizeof(*failent)) == -1) {
goto err_write;
}
strncpy_a(utent->ut_host, hostname);
#endif
#if defined(HAVE_STRUCT_UTMPX_UT_SYSLEN)
- utent->ut_syslen = MIN (strlen (hostname),
- sizeof (utent->ut_host));
+ utent->ut_syslen = MIN(strlen(hostname),
+ sizeof(utent->ut_host));
#endif
#if defined(HAVE_STRUCT_UTMPX_UT_ADDR) || defined(HAVE_STRUCT_UTMPX_UT_ADDR_V6)
if (getaddrinfo (hostname, NULL, NULL, &info) == 0) {
# if defined(HAVE_STRUCT_UTMPX_UT_ADDR)
memcpy (&(utent->ut_addr),
&(sa->sin_addr),
- MIN (sizeof (utent->ut_addr),
- sizeof (sa->sin_addr)));
+ MIN(sizeof(utent->ut_addr),
+ sizeof(sa->sin_addr)));
# endif
# if defined(HAVE_STRUCT_UTMPX_UT_ADDR_V6)
memcpy (utent->ut_addr_v6,
&(sa->sin_addr),
- MIN (sizeof (utent->ut_addr_v6),
- sizeof (sa->sin_addr)));
+ MIN(sizeof(utent->ut_addr_v6),
+ sizeof(sa->sin_addr)));
} else if (info->ai_family == AF_INET6) {
struct sockaddr_in6 *sa =
(struct sockaddr_in6 *) info->ai_addr;
memcpy (utent->ut_addr_v6,
&(sa->sin6_addr),
- MIN (sizeof (utent->ut_addr_v6),
- sizeof (sa->sin6_addr)));
+ MIN(sizeof(utent->ut_addr_v6),
+ sizeof(sa->sin6_addr)));
# endif
}
freeaddrinfo (info);
(void) puts ("");
stprintf_a(buf, "%ld", mindays);
- change_field (buf, sizeof buf, _("Minimum Password Age"));
+ change_field(buf, sizeof(buf), _("Minimum Password Age"));
if (a2sl(&mindays, buf, NULL, 0, -1, LONG_MAX) == -1)
return 0;
stprintf_a(buf, "%ld", maxdays);
- change_field (buf, sizeof buf, _("Maximum Password Age"));
+ change_field(buf, sizeof(buf), _("Maximum Password Age"));
if (a2sl(&maxdays, buf, NULL, 0, -1, LONG_MAX) == -1)
return 0;
else
day_to_str_a(buf, lstchgdate);
- change_field (buf, sizeof buf, _("Last Password Change (YYYY-MM-DD)"));
+ change_field(buf, sizeof(buf), _("Last Password Change (YYYY-MM-DD)"));
if (streq(buf, "-1")) {
lstchgdate = -1;
}
stprintf_a(buf, "%ld", warndays);
- change_field (buf, sizeof buf, _("Password Expiration Warning"));
+ change_field(buf, sizeof(buf), _("Password Expiration Warning"));
if (a2sl(&warndays, buf, NULL, 0, -1, LONG_MAX) == -1)
return 0;
stprintf_a(buf, "%ld", inactdays);
- change_field (buf, sizeof buf, _("Password Inactive"));
+ change_field(buf, sizeof(buf), _("Password Inactive"));
if (a2sl(&inactdays, buf, NULL, 0, -1, LONG_MAX) == -1)
return 0;
else
day_to_str_a(buf, expdate);
- change_field (buf, sizeof buf,
+ change_field(buf, sizeof(buf),
_("Account Expiration Date (YYYY-MM-DD)"));
if (streq(buf, "-1")) {
if (NULL == sp) {
struct passwd pwent = *pw;
- memzero (&spwent, sizeof spwent);
+ memzero(&spwent, sizeof(spwent));
spwent.sp_namp = xstrdup (pwent.pw_name);
spwent.sp_pwdp = xstrdup (pwent.pw_passwd);
spwent.sp_flag = SHADOW_SP_FLAG_UNSET;
puts (_("Enter the new value, or press ENTER for the default"));
if (may_change_field ('f')) {
- change_field (fullnm, sizeof fullnm, _("Full Name"));
+ change_field(fullnm, sizeof(fullnm), _("Full Name"));
} else {
printf (_("\t%s: %s\n"), _("Full Name"), fullnm);
}
if (may_change_field ('r')) {
- change_field (roomno, sizeof roomno, _("Room Number"));
+ change_field(roomno, sizeof(roomno), _("Room Number"));
} else {
printf (_("\t%s: %s\n"), _("Room Number"), roomno);
}
if (may_change_field ('w')) {
- change_field (workph, sizeof workph, _("Work Phone"));
+ change_field(workph, sizeof(workph), _("Work Phone"));
} else {
printf (_("\t%s: %s\n"), _("Work Phone"), workph);
}
if (may_change_field ('h')) {
- change_field (homeph, sizeof homeph, _("Home Phone"));
+ change_field(homeph, sizeof(homeph), _("Home Phone"));
} else {
printf (_("\t%s: %s\n"), _("Home Phone"), homeph);
}
if (amroot) {
- change_field (slop, sizeof slop, _("Other"));
+ change_field(slop, sizeof(slop), _("Other"));
}
}
* group entry for each group will be looked up in the appropriate
* file (gshadow or group) and the password changed.
*/
- while (fgets (buf, (int) sizeof buf, stdin) != NULL) {
+ while (fgets(buf, (int) sizeof(buf), stdin) != NULL) {
line++;
if (stpsep(buf, "\n") == NULL) {
fprintf (stderr, _("%s: line %jd: line too long\n"),
* last change date is set in the age only if aging information is
* present.
*/
- while (fgets (buf, sizeof buf, stdin) != NULL) {
+ while (fgets(buf, sizeof(buf), stdin) != NULL) {
char *cp;
line++;
if (stpsep(buf, "\n") == NULL) {
if (feof (stdin) == 0) {
// Drop all remaining characters on this line.
- while (fgets (buf, sizeof buf, stdin) != NULL) {
+ while (fgets(buf, sizeof(buf), stdin) != NULL) {
if (strchr(buf, '\n'))
break;
}
static void new_fields (void)
{
puts (_("Enter the new value, or press ENTER for the default"));
- change_field (loginsh, sizeof loginsh, _("Login Shell"));
+ change_field(loginsh, sizeof(loginsh), _("Login Shell"));
}
/*
fl.fail_cnt = 0;
if ( (fseeko (fail, offset, SEEK_SET) == 0)
- && (fwrite (&fl, sizeof (fl), 1, fail) == 1)) {
+ && (fwrite(&fl, sizeof(fl), 1, fail) == 1)) {
(void) fflush (fail);
return false;
}
/* There is no need to reset outside of the faillog
* database.
*/
- uid_t uidmax = statbuf.st_size / sizeof (struct faillog);
+ uid_t uidmax = statbuf.st_size / sizeof(struct faillog);
if (uidmax > 1) {
uidmax--;
}
fl.fail_max = max;
if ( (fseeko (fail, offset, SEEK_SET) == 0)
- && (fwrite (&fl, sizeof (fl), 1, fail) == 1)) {
+ && (fwrite(&fl, sizeof(fl), 1, fail) == 1)) {
(void) fflush (fail);
return false;
}
/* The default umax value is based on the size of the
* faillog database.
*/
- uid_t uidmax = statbuf.st_size / sizeof (struct faillog);
+ uid_t uidmax = statbuf.st_size / sizeof(struct faillog);
if (uidmax > 1) {
uidmax--;
}
fl.fail_locktime = locktime;
if ( (fseeko (fail, offset, SEEK_SET) == 0)
- && (fwrite (&fl, sizeof (fl), 1, fail) == 1)) {
+ && (fwrite(&fl, sizeof(fl), 1, fail) == 1)) {
(void) fflush (fail);
return false;
}
/* The default umax value is based on the size of the
* faillog database.
*/
- uid_t uidmax = statbuf.st_size / sizeof (struct faillog);
+ uid_t uidmax = statbuf.st_size / sizeof(struct faillog);
if (uidmax > 1) {
uidmax--;
}
*/
static void new_grent (struct group *grent)
{
- memzero (grent, sizeof *grent);
+ memzero(grent, sizeof(*grent));
grent->gr_name = group_name;
if (pflg) {
grent->gr_passwd = group_passwd;
*/
static void new_sgent (struct sgrp *sgent)
{
- memzero (sgent, sizeof *sgent);
+ memzero(sgent, sizeof(*sgent));
sgent->sg_namp = group_name;
if (pflg) {
sgent->sg_passwd = group_passwd;
* shadowed password, we force the creation of a
* gshadow entry when a new password is requested.
*/
- bzero(&sgrp, sizeof sgrp);
+ bzero(&sgrp, sizeof(sgrp));
sgrp.sg_namp = xstrdup (grp.gr_name);
sgrp.sg_passwd = xstrdup (grp.gr_passwd);
sgrp.sg_adm = ∅
static char *empty = NULL;
/* add new shadow group entry */
- bzero(&sgent, sizeof sgent);
+ bzero(&sgent, sizeof(sgent));
sgent.sg_namp = gr->gr_name;
sgent.sg_passwd = gr->gr_passwd;
sgent.sg_adm = ∅
* entered for this user, which should be able to get the
* empty entry in this case.
*/
- if (fread (&ll, sizeof (ll), 1, lastlogfile) != 1) {
+ if (fread(&ll, sizeof(ll), 1, lastlogfile) != 1) {
fprintf (stderr,
_("%s: Failed to get the entry for UID %lu\n"),
Prog, (unsigned long)pw->pw_uid);
* as if we were reading an non existing entry in the
* sparse lastlog file).
*/
- memzero (&ll, sizeof (ll));
+ memzero(&ll, sizeof(ll));
}
/* Filter out entries that do not match with the -t or -b options */
return;
}
- offset = (off_t) pw->pw_uid * sizeof (ll);
+ offset = (off_t) pw->pw_uid * sizeof(ll);
/* fseeko errors are not really relevant for us. */
err = fseeko (lastlogfile, offset, SEEK_SET);
assert (0 == err);
- memzero (&ll, sizeof (ll));
+ memzero(&ll, sizeof(ll));
if (Sflg) {
ll.ll_time = NOW;
}
#endif
- if (fwrite (&ll, sizeof(ll), 1, lastlogfile) != 1) {
+ if (fwrite(&ll, sizeof(ll), 1, lastlogfile) != 1) {
fprintf (stderr,
_("%s: Failed to update the entry for UID %lu\n"),
Prog, (unsigned long)pw->pw_uid);
unsigned int failcount = 0;
/* Make the login prompt look like we want it */
- if (gethostname (hostn, sizeof (hostn)) == 0) {
+ if (gethostname(hostn, sizeof(hostn)) == 0) {
stprintf_a(loginprompt, _("%s login: "), hostn);
} else {
strtcpy_a(loginprompt, _("login: "));
#ifdef HAVE_LL_HOST /* __linux__ || SUN4 */
if (!strneq_a(ll.ll_host, "")) {
printf (_(" from %.*s"),
- (int) sizeof ll.ll_host, ll.ll_host);
+ (int) sizeof(ll.ll_host), ll.ll_host);
}
#endif
printf (".\n");
if (NULL != fp) {
intmax_t lineno = 0; /* for diagnostics */
while ( !match
- && (fgets (line, sizeof (line), fp) == line))
+ && (fgets(line, sizeof(line), fp) == line))
{
char *p;
static char name[MAXHOSTNAMELEN + 1] = "";
if (streq(name, "")) {
- gethostname (name, sizeof (name));
+ gethostname(name, sizeof(name));
stpcpy(&name[MAXHOSTNAMELEN], "");
}
return (name);
* over 100 is allocated. The pw_gid field will be updated with that
* value.
*/
- while (fgets (buf, sizeof buf, stdin) != NULL) {
+ while (fgets(buf, sizeof(buf), stdin) != NULL) {
line++;
if (stpsep(buf, "\n") == NULL && feof(stdin) == 0) {
fprintf (stderr, _("%s: line %jd: line too long\n"),
spent = *sp;
} else {
/* add new shadow entry */
- bzero(&spent, sizeof spent);
+ bzero(&spent, sizeof(spent));
spent.sp_namp = pw->pw_name;
spent.sp_min = getdef_num ("PASS_MIN_DAYS", -1);
spent.sp_max = getdef_num ("PASS_MAX_DAYS", -1);
return DENY;
}
- while (fgets (temp, sizeof (temp), authfile_fd) != NULL) {
+ while (fgets(temp, sizeof(temp), authfile_fd) != NULL) {
char *p;
lines++;
* Read the file a line at a time. Only the lines that have relevant
* values are used, everything else can be ignored.
*/
- while (fgets (buf, sizeof buf, fp) == buf) {
+ while (fgets(buf, sizeof(buf), fp) == buf) {
stpsep(buf, "\n");
cp = stpsep(buf, "=");
goto skip;
}
- while (fgets (buf, sizeof buf, ifp) == buf) {
+ while (fgets(buf, sizeof(buf), ifp) == buf) {
char *val;
if (stpsep(buf, "\n") == NULL) {
*/
static void new_pwent (struct passwd *pwent)
{
- memzero (pwent, sizeof *pwent);
+ memzero(pwent, sizeof(*pwent));
pwent->pw_name = (char *) user_name;
if (is_shadow_pwd) {
pwent->pw_passwd = (char *) SHADOW_PASSWD_STRING;
*/
static void new_spent (struct spwd *spent)
{
- memzero (spent, sizeof *spent);
+ memzero(spent, sizeof(*spent));
spent->sp_namp = (char *) user_name;
spent->sp_pwdp = (char *) user_pass;
spent->sp_lstchg = gettime () / DAY;
static void new_grent (struct group *grent)
{
- memzero (grent, sizeof *grent);
+ memzero(grent, sizeof(*grent));
grent->gr_name = (char *) user_name;
#ifdef SHADOWGRP
if (is_shadow_grp) {
static void new_sgent (struct sgrp *sgent)
{
- memzero (sgent, sizeof *sgent);
+ memzero(sgent, sizeof(*sgent));
sgent->sg_namp = (char *) user_name;
sgent->sg_passwd = "!"; /* XXX warning: const */
sgent->sg_adm = &empty_list;
{
struct faillog fl;
int fd;
- off_t offset_uid = (off_t) (sizeof fl) * uid;
+ off_t offset_uid = (off_t) sizeof(fl) * uid;
struct stat st;
if (stat (FAILLOG_FILE, &st) != 0 || st.st_size <= offset_uid) {
return;
}
- memzero (&fl, sizeof (fl));
+ memzero(&fl, sizeof(fl));
fd = open (FAILLOG_FILE, O_RDWR);
if (-1 == fd) {
return;
}
if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid)
- || (write_full(fd, &fl, sizeof (fl)) == -1)
+ || (write_full(fd, &fl, sizeof(fl)) == -1)
|| (fsync (fd) != 0)) {
fprintf (stderr,
_("%s: failed to reset the faillog entry of UID %lu: %s\n"),
{
struct lastlog ll;
int fd;
- off_t offset_uid = (off_t) (sizeof ll) * uid;
+ off_t offset_uid = (off_t) sizeof(ll) * uid;
uid_t max_uid;
struct stat st;
return;
}
- memzero (&ll, sizeof (ll));
+ memzero(&ll, sizeof(ll));
fd = open(_PATH_LASTLOG, O_RDWR);
if (-1 == fd) {
return;
}
if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid)
- || (write_full (fd, &ll, sizeof (ll)) == -1)
+ || (write_full(fd, &ll, sizeof(ll)) == -1)
|| (fsync (fd) != 0)) {
fprintf (stderr,
_("%s: failed to reset the lastlog entry of UID %lu: %s\n"),
* a shadowed password
* + aging information is requested
*/
- bzero(&spent, sizeof spent);
+ bzero(&spent, sizeof(spent));
spent.sp_namp = user_name;
/* The user explicitly asked for a shadow feature.
{
struct lastlog ll;
int fd;
- off_t off_uid = (off_t) user_id * sizeof ll;
- off_t off_newuid = (off_t) user_newid * sizeof ll;
+ off_t off_uid = (off_t) user_id * sizeof(ll);
+ off_t off_newuid = (off_t) user_newid * sizeof(ll);
uid_t max_uid;
if (access(_PATH_LASTLOG, F_OK) != 0) {
}
if ( (lseek (fd, off_uid, SEEK_SET) == off_uid)
- && (read (fd, &ll, sizeof ll) == (ssize_t) sizeof ll)) {
+ && (read(fd, &ll, sizeof(ll)) == (ssize_t) sizeof(ll))) {
/* Copy the old entry to its new location */
if ( (lseek (fd, off_newuid, SEEK_SET) != off_newuid)
- || (write_full(fd, &ll, sizeof ll) == -1)
+ || (write_full(fd, &ll, sizeof(ll)) == -1)
|| (fsync (fd) != 0)) {
fprintf (stderr,
_("%s: failed to copy the lastlog entry of user %lu to user %lu: %s\n"),
/* Check if the new UID already has an entry */
if ( (lseek (fd, off_newuid, SEEK_SET) == off_newuid)
- && (read (fd, &ll, sizeof ll) == (ssize_t) sizeof ll)) {
+ && (read(fd, &ll, sizeof(ll)) == (ssize_t) sizeof(ll))) {
/* Reset the new uid's lastlog entry */
- memzero (&ll, sizeof (ll));
+ memzero(&ll, sizeof(ll));
if ( (lseek (fd, off_newuid, SEEK_SET) != off_newuid)
- || (write_full(fd, &ll, sizeof ll) == -1)
+ || (write_full(fd, &ll, sizeof(ll)) == -1)
|| (fsync (fd) != 0)) {
fprintf (stderr,
_("%s: failed to copy the lastlog entry of user %lu to user %lu: %s\n"),
{
struct faillog fl;
int fd;
- off_t off_uid = (off_t) user_id * sizeof fl;
- off_t off_newuid = (off_t) user_newid * sizeof fl;
+ off_t off_uid = (off_t) user_id * sizeof(fl);
+ off_t off_newuid = (off_t) user_newid * sizeof(fl);
if (access (FAILLOG_FILE, F_OK) != 0) {
return;
}
if ( (lseek (fd, off_uid, SEEK_SET) == off_uid)
- && (read (fd, &fl, sizeof fl) == (ssize_t) sizeof fl)) {
+ && (read(fd, &fl, sizeof(fl)) == (ssize_t) sizeof(fl))) {
/* Copy the old entry to its new location */
if ( (lseek (fd, off_newuid, SEEK_SET) != off_newuid)
- || (write_full(fd, &fl, sizeof fl) == -1)
+ || (write_full(fd, &fl, sizeof(fl)) == -1)
|| (fsync (fd) != 0)) {
fprintf (stderr,
_("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"),
/* Check if the new UID already has an entry */
if ( (lseek (fd, off_newuid, SEEK_SET) == off_newuid)
- && (read (fd, &fl, sizeof fl) == (ssize_t) sizeof fl)) {
+ && (read(fd, &fl, sizeof(fl)) == (ssize_t) sizeof(fl))) {
/* Reset the new uid's faillog entry */
- memzero (&fl, sizeof (fl));
+ memzero(&fl, sizeof(fl));
if ( (lseek (fd, off_newuid, SEEK_SET) != off_newuid)
- || (write_full(fd, &fl, sizeof fl) == -1))
+ || (write_full(fd, &fl, sizeof(fl)) == -1))
{
fprintf (stderr,
_("%s: failed to copy the faillog entry of user %lu to user %lu: %s\n"),