HylaFAX The world's most advanced open source fax server

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

UID <-> GID mixup in 4.1beta[12]?




Hi all, 

I have just noticed that there seem to be quite a few places in
4.1beta[12] where group and user IDs get mixed. 

In my setup (that has more or less randomly generated user/group IDs due
to a lot of testing and the user of useradd/groupadd commands), this leads
to the situation that hylafax related programs run with group IDs they
shouldn't run with.

I tracked this down to numerous places where there is code like (this has
been grepped out of the source:

faxd/faxApp.c++:        if (setegid(pwd->pw_uid) < 0)
                                ^           ^^^
Which does not make sense (at least not to me). The above snippet ends up
as code in (at least) faxgetty, which in turn calls faxrcvd (or a
replacement) belonging to a wrong group...

Could anybody confirm that this is a bug, or is there some other reason
that the fax user and its primary group must have the same ID. Is this
documented somewhere?

I have attached the tiny patch for this thingy... [But not yet tested its
implications]

peter



*** hylafax-4.1beta2/faxd/faxApp.c++	Sun Jun 13 09:41:05 1999
--- hylafax-4.1beta2/faxd/faxApp.c++.fixed	Tue May  9 21:43:23 2000
***************
*** 426,430 ****
  	    "This software is not installed properly!", FAX_USER);
      if (euid == 0) {
! 	if (setegid(pwd->pw_uid) < 0)
  	    faxApp::fatal("Can not setup permissions (gid)");
  	if (seteuid(pwd->pw_uid) < 0)
--- 426,430 ----
  	    "This software is not installed properly!", FAX_USER);
      if (euid == 0) {
! 	if (setegid(pwd->pw_gid) < 0)
  	    faxApp::fatal("Can not setup permissions (gid)");
  	if (seteuid(pwd->pw_uid) < 0)



Project hosted by iFAX Solutions