Bug 473485 - a list of unchecked return values in sysvinit
Summary: a list of unchecked return values in sysvinit
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: sysvinit
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-28 19:58 UTC by mpachary
Modified: 2014-03-17 03:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-12-08 20:44:16 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description mpachary 2008-11-28 19:58:20 UTC
Description of problem:

unchecked return values in sysvinit

Version-Release number of selected component (if applicable):

SysVinit-2.84-13

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Here is the list

./sysvinit-2.84/src/shutdown.c:192:	chdir("/"); ### return value of chdir is not checked.  
 ./sysvinit-2.84/src/shutdown.c:578:  chdir("/"); ### return value of chdir not checked 
 ./sysvinit-2.84/src/init.c:582:	chdir("/"); ### return value of chdir not checked 
 ./sysvinit-2.84/src/sulogin.c:297:	(void)chdir(pwd->pw_dir); ### return value of chdir not checked 
 ./sysvinit-2.84/src/halt.c:219:	(void)chdir("/"); ### return value of chdir not checked 
 
 ./sysvinit-2.84/src/bootlogd.c:302:	n = fcntl(realfd, F_GETFL); ### return value of fcntl unchecked 
 ./sysvinit-2.84/src/bootlogd.c:304:	fcntl(realfd, F_SETFL, n); ### return value of fcntl unchecked 
 ./sysvinit-2.84/src/init.c:501:  		fcntl(fd, F_SETFL, mode); ### return value of fcntl not checked 
 ./sysvinit-2.84/src/init.c:1813:	fcntl(fds[1], F_SETFD, 1); ### return value of fcntl not checked 
 ./sysvinit-2.84/src/init.c:1814:	fcntl(fd, F_SETFD, 0); ### return value of fcntl not checked 
 
 ./sysvinit-2.84/src/bootlogd.c:147:	fstat(0, &st); ### return value of fstat not checked 
 ./sysvinit-2.84/src/init.c:1960:	fstat(pipe_fd, &st); ### return value of fstat not checked 
 ./sysvinit-2.84/src/init.c:1974:		fstat(pipe_fd, &st); ### return value of fstat not checked 
 ./sysvinit-2.84/src/last.c:615:  	fstat(fileno(fp), &st); ### return value of fstat not checked.  
 
 ./netkit-ftp-0.17/ftp/ruserpass.c:172:				*aacct = malloc((unsigned) strlen(tokval) + 1); ### return value of malloc, *aacct passed to strcpy without checking.  
 ./sysvinit-2.84/src/utmpdump.c:84:	struct tm *tm = malloc(sizeof(*tm)); ### return value of malloc passed to strptime without checking.  
 ./sysvinit-2.84/src/utmpdump.c:199:	line = linestart = malloc(1024 * sizeof *linestart); ### return value of malloc, line, not checked. notice. its aliased to linestart.  
 
 ./sysvinit-2.84/src/shutdown.c:579:  if (fastboot)  close(open(FASTBOOT,  O_CREAT | O_RDWR, 0644)); ### return value of open is not checked before being passed to close.  
 ./sysvinit-2.84/src/shutdown.c:580:  if (forcefsck) close(open(FORCEFSCK, O_CREAT | O_RDWR, 0644)); ### return value of open is not checked before being passed to close.  
 ./sysvinit-2.84/src/init.c:986:				f = open("/dev/null", O_RDWR); ### return value of open not checked before being passed to dup 
 ./sysvinit-2.84/src/init.c:1453:	close(open(INITLVL, O_WRONLY|O_TRUNC)); ### return value of open not checked before being passed to close.  
 ./sysvinit-2.84/src/init.c:1469:	close(open(INITLVL2, O_WRONLY|O_TRUNC)); ### return value of open not checked before being passed close.  
 ./sysvinit-2.84/src/init.c:2368:  	(void) close(open(UTMP_FILE, O_WRONLY|O_CREAT|O_TRUNC, 0644)); ### return value of open not checked before being passed to close.  
 ./sysvinit-2.84/src/sulogin.c:415:				fd = open(tty, O_RDWR); ### return value of open not checked before being passed to dup.  
 
 ./sysvinit-2.84/src/init.c:1810:	pipe(fds); ### return value of pipe not checked.  
 
 ./sysvinit-2.84/src/sulogin.c:318:	setenv("HOME", home, 1); ### return value of setenv not checked.  
 ./sysvinit-2.84/src/sulogin.c:319:	setenv("LOGNAME", "root", 1); ### return value of setenv not checked.  
 ./sysvinit-2.84/src/sulogin.c:320:	setenv("USER", "root", 1); ### return value of setenv not checked.  
 ./sysvinit-2.84/src/sulogin.c:322:		setenv("SHLVL","0",1); ### return value of setenv not checked.  
 ./sysvinit-2.84/src/sulogin.c:327:	setenv("SHELL", sushell, 1); ### return value of setenv not checked.  
 ./sysvinit-2.84/src/sulogin.c:334:	setenv("SHELL", BINSH, 1); ### return value of setenv not checked.

Comment 1 Bill Nottingham 2008-12-08 20:44:16 UTC
This is a very old version, and we don't even build most of these any more. Regardless, at least one issue fixed in 2.86-26.


Note You need to log in before you can comment on or make changes to this bug.