579_chowntty_debug updated for upstream version 4.1.2.
This commit is contained in:
Vendored
+1
@@ -5,6 +5,7 @@ shadow (1:4.1.2-1) experimental; urgency=low
|
||||
- Updated patches:
|
||||
+ debian/patches/431_su_uid_0_not_root
|
||||
+ debian/patches/463_login_delay_obeys_to_PAM
|
||||
+ debian/patches/579_chowntty_debug
|
||||
* debian/control: changed the "Replaces" on manpages-zh to a versioned
|
||||
one on 1.5.1-1
|
||||
* debian/control: drop all Replaces on manpages-* when the version is
|
||||
|
||||
Vendored
+13
-13
@@ -25,26 +25,26 @@ Index: shadow-4.1.0/libmisc/chowntty.c
|
||||
/*
|
||||
* is_my_tty -- determine if "tty" is the same as TTY stdin is using
|
||||
*/
|
||||
@@ -47,12 +48,31 @@
|
||||
@@ -47,13 +48,31 @@
|
||||
{
|
||||
struct stat by_name, by_fd;
|
||||
|
||||
- if (stat (tty, &by_name) || fstat (0, &by_fd))
|
||||
+ if (stat (tty, &by_name)) {
|
||||
- if ((stat (tty, &by_name) != 0) || (fstat (0, &by_fd) != 0)) {
|
||||
+ if (stat (tty, &by_name) != 0) {
|
||||
+ /* Can use neither strerror() nor "%m" sequence -- first
|
||||
+ * is locale-dependent (while SYSLOG isn't) and for second
|
||||
+ * the SYSLOG macro isn't errno-transparent. --xrgtn */
|
||||
+ int e = errno;
|
||||
+ SYSLOG ((LOG_WARN, "can't stat(`%s'): errno %i\n", tty, e));
|
||||
return 0;
|
||||
+ }
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (by_name.st_rdev != by_fd.st_rdev)
|
||||
+ if (fstat (0, &by_fd)) {
|
||||
- if (by_name.st_rdev != by_fd.st_rdev) {
|
||||
+ if (fstat (0, &by_fd) != 0) {
|
||||
+ int e = errno;
|
||||
+ SYSLOG ((LOG_WARN, "can't fstat(stdin): errno %i\n", e));
|
||||
return 0;
|
||||
- else
|
||||
return false;
|
||||
- } else {
|
||||
+ }
|
||||
+
|
||||
+ if (by_name.st_rdev != by_fd.st_rdev) {
|
||||
@@ -55,8 +55,8 @@ Index: shadow-4.1.0/libmisc/chowntty.c
|
||||
+ * which are GNU extn */
|
||||
+ major(by_name.st_rdev), minor(by_name.st_rdev),
|
||||
+ major(by_fd.st_rdev), minor(by_fd.st_rdev)));
|
||||
+ return 0;
|
||||
+ } else
|
||||
return 1;
|
||||
+ return false;
|
||||
+ } else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user