1

Compiling a simple program in Ubuntu 16.04 with gcc-5.4.0:

$ cat tmp.c
#include <stdio.h>
int main()
{

    printf("Hello World");
}

Yields the following error when trying to compile as a non-privileged user:

$ gcc tmp.c
gcc: error trying to exec 'as': execvp: Permission denied

If I look at the permissions of the assembler, as:

$ ls -lt /usr/bin/as

lrwxrwxrwx 1 root root 19 Aug 30 09:39 /usr/bin/as -> x86_64-linux-gnu-as

$ ls -lt /usr/bin/x86_64-linux-gnu-as

-rwxr-x--- 1 root root 369480 Aug 30 09:39 /usr/bin/x86_64-linux-gnu-as

This is very strange. I can compile this program as root without the error.

QUESTION:

Why is the assembler have 750 permissions? How would it have gotten into this state. I can't imagine that Ubuntu comes like this by default.

0 Answers0