Tomorrow morning I get on a plane and go on vacation for a week. Naturally, today was the most complicated day of work I've had to do in a long time.
I had to merged two svn branches that have been separate for at least 2 weeks and substantial work was done in both. To make things more interesting, today was that start of hardware testing, which meant the program I work on (and was merging) was going to be getting some of it's first real user interaction in months. The other person that works on the program with me was at his kid's birthday party, so I was the only point of contact and had to be on call all day. Right away, there was something I needed to patch.
Around 7pm, when the testing ended, I actually had some dedicated time to work on the merge. I chugged away and finally finished. Everything built, worked when I ran it, and I even got to delete a few class that were not being used anymore. That's when the trouble started.
I randomly noticed that some of my source files were executable. So rather than spend time traversing the tree and checking for which files needed the permission removed, I decided to just use globing to solve the problem.
chmod -x *
Ran fine, but that is just the top level and almost everything is deep in nested pacakges.
chmod -x */*
And this is where everything goes wrong. I don't know what went wrong, but I no longer have any permission on the contents of any of my 2nd level folders. But this not just no permissions, ls -l gives
?????????? ? ? ? file_name
for everything. No combination of sudo, chmod or chown can do anything. Not being able to find the permissions means you have no permissions for anything. This is all contained in the one base directory, so I didn't nuke the whole machine. But I still need to check in all the merged code that I've been working all day on.
At this point, it is now very late instead of just kind of late and there is only one other person in the lab. I asked him how good he was at Linux and he said meh. This does not bode well. We brain storm some and come up with a few ideas, but none work.
Finally, an idea that could work. sudo doesn't do anything, but what if I actually was logged in as root. su to the rescue!!! But wait, Ubuntu doesn't really have a root you can log in as. Turns out you can
assign root a password. Then after su-ing, another ls -l showed the directory just as it should have been (correct permissions and owned by my real log in).
I still have no idea what happened or why. If anyone can tell me, I'd love to know.