Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!clyde!cbosgd!cwruecmp!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon Allbery) Newsgroups: comp.os.minix Subject: Re: SETUID on mkdir and rmdir Message-ID: <2802@ncoast.UUCP> Date: Sun, 5-Jul-87 19:34:00 EDT Article-I.D.: ncoast.2802 Posted: Sun Jul 5 19:34:00 1987 Date-Received: Tue, 7-Jul-87 00:43:51 EDT References: <1478@ncc.UUCP> <14338@teknowledge-vaxc.ARPA> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.os.minix Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 30 As quoted from <14338@teknowledge-vaxc.ARPA> by mkhaw@teknowledge-vaxc.ARPA (Michael Khaw): +--------------- | -rwxr-xr-x 1 root staff 16388 Sep 15 1986 /bin/mkdir | -rwxr-xr-x 1 root staff 16384 Sep 15 1986 /bin/rmdir | | So why does SysV need them suid and not 4bsd? +--------------- NOT AGAIN!!!!! BSD has system calls mkdir() and rmdir() which deal with "." and "..", and rmdir() deals with directory not empty. Therefore, they can be used by non- root processes. USG does not. Directories are created with mknod() and removed with unlink(); neither handles "." or "..". As a result, mknod() and unlink(dir) are root- only, so that only programs that know to handle "." and ".." will munge directories. (System V r3 apparently has mkdir() now, from what I hear.) ++Brandon -- ---- Moderator for comp.sources.misc and comp.binaries.ibm.pc ---- Brandon S. Allbery!cbosgd!ncoast!allbery (NOW!!!!) aXcess Company {ames,mit-eddie,harvard,talcott}!necntc!ncoast!allbery 6615 Center St. #A1-105 {well,sun,pyramid,ihnp4}!hoptoad!ncoast!allbery Mentor, OH 44060-4101 necntc!ncoast!allbery@harvard.HARVARD.EDU (Internet) +01 216 974 9210 ncoast!allbery@CWRU.EDU (CSnet -- if you dare) NCOAST ADMIN GROUP Brandon Allbery on 157/504 (Fidonet/Matrix/whatever) * ncoast -- Public Access UN*X -- (216) 781-6201, 24 hrs., 300/1200/2400 baud * * ncoast is proud to be carrying alt.all -- contact me for more information *