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

fix for Re: dpkg-gencontrol error, don't know what is it



Package: dpkg-dev
Version: 1.4.0.8

(ok, I've finally gotten bothered enough at this to hunt down a fix...)

for some reason, dpkg-gencontrol depends on being able to find a utmp
entry for the tty you're running on. This means you can't build from
inside emacs, for example, or with a corrupted utmp, or in an xterm
with utmpInhibit set.

This is because /usr/lib/dpkg/controllib.pl does:
	@fowner = (getpwnam(getlogin()))[2,3];
without any checks or fallback.  Kind of sad, since not even the
perlfunc manpage assumes getlogin works... changing this to:

	$fuser = getlogin || (getpwuid($<))[0] || $env{"USER"};
	die "couldn't identify user???" if not defined $fuser;
	@fowner = (getpwnam($fuser))[2,3];

should be *much* more robust.  Probably throw in a 
	die if not defined @fowner;
as well, in case getpwnam fails -- that's less likely, but it should
at least report it usefully...


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: