Do not run telinit u on upgrades (#1579225)
This commit is contained in:
		
							parent
							
								
									189f35b396
								
							
						
					
					
						commit
						8ed5487f77
					
				@ -136,33 +136,6 @@ main (void)
 | 
			
		||||
		    "--nostdlib", iconv_dir);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Check if telinit is available and either SysVInit fifo,
 | 
			
		||||
     or upstart telinit.  */
 | 
			
		||||
  if (access ("/sbin/telinit", X_OK)
 | 
			
		||||
      || ((!!access ("/dev/initctl", F_OK))
 | 
			
		||||
	  ^ !access ("/sbin/initctl", X_OK)))
 | 
			
		||||
    _exit (0);
 | 
			
		||||
 | 
			
		||||
  /* Check if we are not inside of some chroot, because we'd just
 | 
			
		||||
     timeout and leave /etc/initrunlvl.
 | 
			
		||||
 | 
			
		||||
     On more modern systems this test is not sufficient to detect
 | 
			
		||||
     if we're in a chroot.  */
 | 
			
		||||
  if (readlink ("/proc/1/exe", initpath, 256) <= 0 ||
 | 
			
		||||
      readlink ("/proc/1/root", initpath, 256) <= 0)
 | 
			
		||||
    _exit (0);
 | 
			
		||||
 | 
			
		||||
  /* Here's another well known way to detect chroot, at least on an
 | 
			
		||||
     ext and xfs filesystems and assuming nothing mounted on the chroot's
 | 
			
		||||
     root. */
 | 
			
		||||
  if (stat ("/", &statbuf) != 0
 | 
			
		||||
      || (statbuf.st_ino != 2
 | 
			
		||||
	  && statbuf.st_ino != 128))
 | 
			
		||||
    _exit (0);
 | 
			
		||||
 | 
			
		||||
  if (check_elf ("/proc/1/exe"))
 | 
			
		||||
    verbose_exec (116, "/sbin/telinit", "/sbin/telinit", "u");
 | 
			
		||||
 | 
			
		||||
  _exit(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user