Problems with setegid() and seteuid() in ftpd

Problems with setegid() and seteuid() in ftpd

Post by Paul J Turn » Tue, 26 May 1992 03:14:54



Hello comp.unix.aix,

I'm attempting to port Chris Myers' deluxe ftp daemon to AIX
(it's the one used by ftp.uu.net, I believe) and I'm having
problems with the setegid() and seteuid() calls.  This section
of the code looks like it is from the original ftpd.

I've successfully compiled it, set permissions to -r-sr-xr--,
ownership to root.system, then I use 'smit inetd' to set the
the new ftpd. It works, but only for root logins. For all
others, it fails at the setegid() call in ftpd.c - with
an errno of 1, 'Not owner'.

Has anyone successfully ported this one? If so, could you tell me
how you did it?

Is there something different in the use of the sete[g|u]id
calls between SunOS (for example - where things do work) and
AIX?

Thanks,

--Paul


 
 
 

Problems with setegid() and seteuid() in ftpd

Post by Charles Hann » Wed, 27 May 1992 14:50:07



Quote:Turner) writes:

> Is there something different in the use of the sete[g|u]id calls
> between SunOS (for example - where things do work) and AIX?

Yes, and it's in the man pages.  <hint, hint>  Basically, set*uid* and
set*gid* under AIX are POSIX-compliant.

However, there is another bug.  Apparently, the saved uid and gid are
used when checking file permissions; i.e. if your saved uid == 0, you
can write to any file.  This is not correct.

The latter bug makes it a real pain to port ftpd.  Currently, you have
to sprinkle access() calls throughout the code.

Hopefully this will be fixed soon.  B-P
--

  White atheist male (WAM) pride!

 
 
 

Problems with setegid() and seteuid() in ftpd

Post by Curt Finch 903 2F021 c.. » Thu, 28 May 1992 03:44:05



Quote:

>Is there something different in the use of the sete[g|u]id
>calls between SunOS (for example - where things do work) and
>AIX?

Try this instead:

        setuidx( ID_EFFECTIVE|ID_REAL,0 );      /* become root */

The setuidx call gives you what you want I think.  Read info on it.
It conforms to some standard or the other, Posix I think.
--


My views are unrelated to those of IBM     |        Austin, TX
"We have no rules around here. We're trying accomplish something."-Thomas Edison

 
 
 

Problems with setegid() and seteuid() in ftpd

Post by Guy Harr » Wed, 10 Jun 1992 17:18:50


Quote:>The setuidx call gives you what you want I think.  Read info on it.
>It conforms to some standard or the other, Posix I think.

Nope.  There's no "setuidx()" in POSIX 1003.1.
 
 
 

1. setuid, seteuid (problem with ftpd-logging)

Hi, I'm trying to adapt the ftpd-logging daemon to the RS/6000's AIX.  The
compile works file (with little change and specific compilation options), but
once started, after logging in the system, I get the message
"Can't set uid.".

So, just to try I changed the seteuid to setuid, and I logged successfully to
the system's ftp server but... no more possibility to execute a commande
(such as dir or ls): "Unable to open data socket: permission denied".

Can anyone help me in modifying the source code so that it works correclty?

--

INSA Lyon - Departement Informatique  |  Fax: (+33) 72 44 08 00
69621 Villeurbanne Cedex, France      |    (Attn-To: Wolfhugel - C 210)

  Disclaimer: these are my own opinions, not my employer's.

2. 2.5.40 Compile error in ppa.o (Zip drive support)

3. setuidx/seteuid problem and ftpd

4. Embedded static links in httpd after building binaries??

5. seteuid() / ftpd

6. Is There a Linux Driver for Acer M314x Graphics Card ?

7. Matrox Mystique ands X.

8. Kernel Memory

9. in.ftpd zombie problem with wu-ftpd on RH6

10. Problem using seteuid and POSIX saved id feature

11. interesting setEuid problem (need help)

12. setuid() and seteuid() problems under Sol2.3

13. setegid(), has it always existed?