/bsd is executable or not (to chmod or not)?

/bsd is executable or not (to chmod or not)?

Post by Harry Pehkon » Mon, 19 Aug 2002 06:24:19



If you do a fresh install:

        home$ ls -l /bsd
        -rw-r--r--  1 root  wheel  4543036 Aug  1 21:16 /bsd

...but after doing a recompile:

        hannah$ ls -l /bsd
        -rwxr-xr-x  1 root  wheel  4543036 Aug 16 23:21 /bsd

The first machine was installed from a home-made release(8).  The
second machine is constantly updated using directions from release(8)
as well as http://openbsd.org/stable.html through a compiling process
(as opposed to reinstalling...duh).

Does anybody know of a reason (other than consistency) why I should
take out them executable bits out of /bsd's file mode (ie does anybody
care)?

Thanks!
Harry.

 
 
 

/bsd is executable or not (to chmod or not)?

Post by tedu » Mon, 19 Aug 2002 07:09:20



Quote:> Does anybody know of a reason (other than consistency) why I should
> take out them executable bits out of /bsd's file mode (ie does anybody
> care)?

You never actually run the kernel, so it doesn't need exec bits.  the
 priviledges matter little, since the bootloader doesn't care a
whole lot.

--
Mediocrity is a sin.

 
 
 

/bsd is executable or not (to chmod or not)?

Post by mkhom » Mon, 19 Aug 2002 11:58:25



> If you do a fresh install:

>    home$ ls -l /bsd
>    -rw-r--r--  1 root  wheel  4543036 Aug  1 21:16 /bsd

> ...but after doing a recompile:

>    hannah$ ls -l /bsd
>    -rwxr-xr-x  1 root  wheel  4543036 Aug 16 23:21 /bsd

> The first machine was installed from a home-made release(8).  The
> second machine is constantly updated using directions from release(8)
> as well as http://openbsd.org/stable.html through a compiling process
> (as opposed to reinstalling...duh).

> Does anybody know of a reason (other than consistency) why I should
> take out them executable bits out of /bsd's file mode (ie does anybody
> care)?

> Thanks!
> Harry.

Even your computer won't care since /bsd is a stand-alone program and
qualifies as 'Wrong architecture format' if ever invoked within another
running /bsd as a (time) shared process. You're just seeing a
border-line or boundary value anomaly within the make regime that does
not expect it is producing a standalone program for which the time-share
'mode' is meaningless.
 
 
 

/bsd is executable or not (to chmod or not)?

Post by Harry Pehkon » Tue, 20 Aug 2002 03:36:39


Thanks, mkhomo and tedu, for your replies.

Harry.

 
 
 

1. Executable is not executable

Hello guys,

I am having a problem with a executable I made, that the system refuses to, ehm,
execute. And it's not the simple 'execute bit not set'.

I build all my libraries in two versions, static (.a) and dynamic (.so).
The version of my executable that links the .so version works without a glitch.
When I build the statically linked version, the result is as follows:

pluto_hagen% ls -al ./TestProg
-rwxr-xr-x    1 hagen    users    11102630 Apr 29 09:12 ./TestProg

pluto_hagen% file ./TestProg
./TestProg: ELF 64-bit LSB executable, Alpha (unofficial), version 1,
dynamically linked (uses shared libs), not stripped

So far, so good. Looks like TestProg should work.

pluto_hagen% ./TestProg
./TestProg: Command not found.

Oops. Further examination of the executable yields:

pluto_hagen% ldd ./TestProg
/usr/bin/ldd: ./TestProg: No such file or directory

pluto_hagen% strace ./TestProg
execve("./TestProg", ["./TestProg"], [/* 60 vars */]) = 0
strace: exec: No such file or directory

pluto_hagen% gdb ./TestProg
GNU gdb Red Hat Linux (5.2-2)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "alpha-redhat-linux"...
(gdb) run
Starting program: /tmp/TestProg
~hagen/.cshrc: running!
/tmp/TestProg: Command not found.

Program exited with code 01.
You can't do that without a process to debug.
(gdb) quit

pluto_hagen% nm ./TestProg
000000012027b140 r a1
000000012027b148 r a2
0000000120272990 r aa
0000000120301e20 d aatEchoPara
00000001201be590 T abort
0000000000000000 a *ABS*
0000000000000000 a *ABS*
...
lots and lots more symbols, no problem.

So, I am stumped. nm seems to be the only tool that likes my executable. Can
anybody give me a hint how to examine this further? Or even had this problem
before, and solved it?

Any help very much appreciated.

Ulrich

2. Why there isn't strrstr isn't in <string.h>? It is POSIX stand.

3. /usr/sbin/pppd does not exist or is not executable

4. HOW MANY PATCHES INSTALLED?

5. gdb: core file not in executable format: File format not recognized

6. HTTP and POP server

7. "/usr/include/bsd/bsd.h" not found in redhat linux 5.1

8. Does my controller support DMA > 16M ?

9. chmod question; chmod a-x /bin/chmod?

10. startx.newbie.NOT.NOT.NOT

11. chmod, not on directories

12. chmod 2775 dir not work (bug!!!)

13. chmod 2711 not excutable under linux