Date: Sat, 22 Feb 1997 13:45:14 +-200 From: David Stickney <david@wvb.gomel.by> To: "'FBSD ISP'" <freebsd-isp@freebsd.org> Subject: Answer to Big Directories Message-ID: <01BC20C6.A2794040@david>
next in thread | raw e-mail | index | archive | help
Dear ISP'ers I thought I would share the results of my questions. > while : ; do > mkdir x > cd x > done > > 1. How can you prevent users from running this in their home directory, > without cutting off their shell account Preventing this can only be achieved by not letting users have shell accounts, or rewriting the OS.. (?) Controlling the effects can be accomplished by Disks Quotas (Bradley Dunn). Other Ideas such as shooting the user, were viewed by management too stern, although they agreed to allow me to stick toothpicks under his fingernails. ( Sergey explains that he read it in a white paper about UNIX security and wanted to see if it worked.... Some peoples kids...) As for fixing it; Lots of Good Answers, several would even work.... "rm -r works by creating a command line with all the subdirectories included, ie. in effect rmdir x/x/x rmdir x/x rm x. This fails when the maximum command line length is reached" (John Beukema) Funny, I read the man page for rmdir, it didn't mention any parameters.. "Try this... 1. cd to x (first level) 2. find . -depth -exec rmdir {} \; 3. cd .. 4. rmdir x If find doesn't blow up because of all the subdirs, it should work." (Chaz} Blew Up.. It reached about 1/3 up the structure and said it was too long.. Michael Bryan had the most original answer,, included compiling. .. As for Mounting Unmounting, fscking, and the like, sounded like to much work, (I'm lazy) Paul Danckaert, John Beukema and Richard Hodges all had the right Idea, Here is what I did and it worked on a directory with 900 subdirectories. In the directory, do while : ; do cd x done When It starts bitch'n at you hit control-c ( I'm lazy) Then run : While : ; do cd .. rmdir x done ^c to stop... It only took about 15 seconds on a 486/66 with LB IDE Roubles are in the Outbox, and it should take 2-3 weeks to the US, holler it the mail gets eaten by the mail system here, they like to open mail with US addresses, (Maybe you have heard of Belarus) Thanks everyone, Someday I hope to have a real IP connection so I can sign up to the list and read everything.. Best, Dave
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01BC20C6.A2794040>