Re: Creating directories with sticky bit set

2009-03-13 Thread Greg Wooledge
On Thu, Mar 12, 2009 at 07:40:58PM -0700, Ian Kelling wrote: mkdir also has the -m argument, so you could do mkdir -m 1755 dir Ah, clever. Then: mkdir() { command mkdir -m $(printf '%o\n' $((01777 - $(umask $@ } This still doesn't address the original poster's concerns if, for example,

Re: Creating directories with sticky bit set

2009-03-13 Thread Dave Rutherford
On Fri, Mar 13, 2009 at 9:30 AM, Greg Wooledge wool...@eeg.ccf.org wrote: This still doesn't address the original poster's concerns if, for example, a web browser creates a new ~/.browserconf directory the first time it's invoked. But nothing bash can do will solve that. True, but what about

Re: Creating directories with sticky bit set

2009-03-13 Thread Greg Wooledge
On Fri, Mar 13, 2009 at 11:40:58AM -0400, Dave Rutherford wrote: --- building $ gcc -fPIC -c -Wall sticky.c -o sticky.o $ gcc -shared sticky.o -ldl -lstdc++ -o sticky.so --- running $ export LD_PRELOAD=$PWD/sticky.so:$LD_PRELOAD --- for long-term use, add to bash startup files How

Creating directories with sticky bit set

2009-03-12 Thread Angel Tsankov
Hello, What can I do so that every directory I create has the sticky bit set? Regards, Angel Tsankov

Re: Creating directories with sticky bit set

2009-03-12 Thread Angel Tsankov
Greg Wooledge wrote: If you only ever create directories from interactive shells with the mkdir command, you could override it with a function: mkdir() { command mkdir $@ chmod +t $@ } (In reality you'd want to process function arguments, and remove for example a -p option before

Re: Creating directories with sticky bit set

2009-03-12 Thread smallnow
Angel Tsankov wrote: Greg Wooledge wrote: Let's say that removing '-p' is straightforward, but what about setting the sticky bit to every newly created directory component? mkdir also has the -m argument, so you could do mkdir -m 1755 dir interestingly -m does not apply to parent directories

Re: Creating directories with sticky bit set

2009-03-12 Thread Ian Kelling
Angel Tsankov wrote: Greg Wooledge wrote: Let's say that removing '-p' is straightforward, but what about setting the sticky bit to every newly created directory component? mkdir also has the -m argument, so you could do mkdir -m 1755 dir interestingly -m does not apply to parent