+2009-04-15 Peter Vrabec <pvrabec@redhat.com>
+
+ * NEWS, srclib/getlong.c: Fix parsing of octal numbers.
+
+2009-04-15 Nicolas François <nicolas.francois@centraliens.net>
+
+ * NEWS, src/login.c: Fix segfault when no user is provided on the
+ command line.
+
2009-04-15 Nicolas François <nicolas.francois@centraliens.net>
* README, libmisc/system.c: Was contributed by Dan Walsh.
$Id$
-shadow-4.1.3 -> shadow-4.1.3.1 UNRELEASED
+shadow-4.1.3 -> shadow-4.1.3.1 2009-04-15
+*** security:
+- Due to bad parsing of octal permissions, the permissions on tty (login)
+ but also home directories, mailboxes, or UMASK were set wrongly (and
+ weirdly). Only shadow-4.1.3 was affected.
+
+*** general
- vipw
* SE Linux: Set the default context to the context of the file being
edited. This ensures that the backup file inherit from the file's
context.
+- login
+ * Fix regression when no user is specified on the command line.
shadow-4.1.2.2 -> shadow-4.1.3 2009-04-12
#include <errno.h>
#include "prototypes.h"
+/*
+ * getlong - extract a long integer provided by the numstr string in *result
+ *
+ * It supports decimal, hexadecimal or octal representations.
+ *
+ * Returns 0 on failure, 1 on success.
+ */
int getlong (const char *numstr, long int *result)
{
long val;
char *endptr;
errno = 0;
- val = strtol (numstr, &endptr, 10);
+ val = strtol (numstr, &endptr, 0);
if (('\0' == numstr) || ('\0' != *endptr) || (ERANGE == errno)) {
return 0;
}
set it to NULL */
retcode = pam_get_item (pamh, PAM_USER, (const void **)ptr_pam_user);
PAM_FAIL_CHECK;
- if (pam_user[0] == '\0') {
+ if ((NULL != pam_user) && ('\0' == pam_user[0])) {
retcode = pam_set_item (pamh, PAM_USER, NULL);
PAM_FAIL_CHECK;
}