Weird make-kpkg error

I was trying to build a custom kernel for my Ubuntu 8.04 laptop, and I got the following error message:

dpkg-deb: building package linux-image-' in../linux-image-’.
dpkg-deb: control directory has bad permissions 2755 (must be >=0755 and <=0775)
make[1]: *** [debian/linux-image-] Error 2
make[1]: Leaving directory `/usr/src/linux-
make: *** [binary/linux-image-] Error 2

I changed the permissions of debian/control but the 2755 permissions ended up being re-applied. It turns out that somehow the entire kernel source directory was set GUID. To solve it, I simply did

chmod g-s /usr/src/linux- -R

Of course you should put in the details that match your environment.

Also, for the less experienced, set guid looks like this when do an ls -l

drwxr-sr-x 23 root src 4096 2008-06-14 10:31 linux-

The correct permissions look like this:

drwxr-xr-x 23 username src 4096 2008-06-14 10:31 linux-