IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New I'll bite
Attempt to create a file called '/tmp/wicked\\n/etc/passwd'

By why?
It fails because the '/' after the '\\n' signifies another
dir level that does not exists.

I assume it is an attempt to leave some type of trap for
the passwd program, but it escapes me.

Note: I got 2 wrong.

Umask and something else. I always hated umask.
New So far so good, now for a hint
First of all they got the umask question wrong, and the answer is distro dependent. (Also anyone sane writes a umask with at least 3 digits, not 2.)

But back to the interview question. You are perfectly right about what the command does. So, assuming that the previous two levels of directories were previously created (say in the previous two lines) and the desired file was created, what is the point?

At this stage in an interview I would give a hint.

The hint is to think about cron jobs which are likely to exist.

Cheers,
Ben
New My guess
Is there a program that is usually set up to clean up the /tmp folder? If such a program were to access a directory of the /tmp dir would it not see that one mangled filename as two separate files (the newline separating them)? Would it not then in deleting the file end up deleting both?

BTW I missed 7 on those, and a few of those I shouldn't have. Doh!
~~~)-Steven----

"I want you to remember that no bastard ever won a war by dying for his country.
He won it by making the other poor dumb bastard die for his country..."

General George S. Patton
New Bingo
If said cron was written as a shell script using find to produce a list of files to remove, and then removing them, it would be very easy to make exactly that mistake. And, of course, that would have to run as root, so it is able to blow away your password file.

If you wrote it in C, Perl, or any other "real programming language", you would not confuse returns inside of filenames as breaks between filenames.

Cheers,
Ben
New gak
a linefeed character in a file name? Ok, what characters aren't allowed in a Unix file name?
Have fun,
Carl Forde
New null and /
Insert usual fun and games with backspace characters, characters which cause X to do funky things, etc.
Expand Edited by ben_tilly Nov. 10, 2001, 02:15:31 PM EST
New dont forget pipe and redir | > and your example would be ok
inside " as opposed to `(maybe)
thanx,
bill
tshirt front "born to die before I get old"
thshirt back "fscked another one didnja?"
New touch 'foo | bar > baz'
Works perfectly well for me.

Cheers,
Ben
New Berkeley, Unix and something else
I'm reminded of a quote about Berkeley, Unix and something else. I'm sure you know what it is...
What is the point of allowing control characters? I assume the ommission of null is an artifact of C strings?

[link|http://www.linuxdoc.org/HOWTO/Unicode-HOWTO-3.html|Unicode filenames] are cool though.

Have fun,
Carl Forde
New It is easier to allow than to disallow
Null and the / already were taken. They had assigned meanings,
one for C and the other for directories.

Any other characters which you wanted to disallow would be more work. So they just allowed them all.

Cheers,
Ben
     Linux Test - (broomberg) - (21)
         Don't hire me. - (Another Scott)
         Re: Linux Test - (JayMehaffey)
         See the comments at LinuxToday - (ben_tilly) - (12)
             I'll bite - (broomberg) - (9)
                 So far so good, now for a hint - (ben_tilly) - (8)
                     My guess - (Steven A S) - (1)
                         Bingo - (ben_tilly)
                     gak - (cforde) - (5)
                         null and / - (ben_tilly) - (4)
                             dont forget pipe and redir | > and your example would be ok - (boxley) - (1)
                                 touch 'foo | bar > baz' - (ben_tilly)
                             Berkeley, Unix and something else - (cforde) - (1)
                                 It is easier to allow than to disallow - (ben_tilly)
             I'll bite - (cforde) - (1)
                 That sounds wrong - (wharris2)
         Unix Review -- can't connect - (kmself) - (1)
             Works here - DC area, Nav4/Win32. -NT - (Another Scott)
         Heh. - (static)
         I thought I didn't know much about Linux... - (Meerkat)
         Re: Linux Test - (gdaustin)
         Late comer... - (folkert)

Ben "I make grown men want to slit their wrists" Tilly.
58 ms