Re: git-daemon problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22:44, Junio C Hamano wrote:

> The only "right" solution I could think of is to properly
> daemonize git-daemon when not running under --inetd mode.  Close
> and open /dev/null the low three fds, and dissociate the process
> from the controlling terminal (did I forget anything else --
> perhaps chdir("/") at the top?).  And we keep the current
> behaviour of assuming the sane set of low three fds when a new
> option --debug is given to help people look at its stderr.  The
> tentative patch to upload-pack would become moot at that point.
> 
> Hmm?

A common solution for this problem is 

	while (1) {
		int     fd;

		fd = open("/dev/null", O_RDWR);
		if (fd < 0)
			exit(EX_OSERR);
		if (fd > 2) {
			close(fd);
			break;
		}
	}

See

	http://rechner.lst.de/~okir/blackhats/node41.html

Andre
-- 
The only person who always got his work done by Friday was Robinson Crusoe

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]