Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 Nov 2018 09:45:09 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 232950] execle in FreeBSD work differ than execle in Linux ?
Message-ID:  <bug-232950-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D232950

            Bug ID: 232950
           Summary: execle in FreeBSD work differ than execle in Linux ?
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: gnu
          Assignee: bugs@FreeBSD.org
          Reporter: zhecka@gmail.com

FreeBSD execle system call works wrong in code written for Linux.

In many Linux sources i see next system call notation like
execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
               "hypervisor initiated shutdown", (char*)NULL, environ);

Where second argument used as short "program name".
In FreeBSD systems, this argument is not bypassed in call and attached to a=
rgs
list.

As a result, when the source is ported to FreeBSD, the system call is not
executed correctly.
---- truss output start ----
946: execve("/sbin/shutdown",[ "shutdown", "-h", "-r", "+0", "hypervisor
initiated shutdown" ],0x7fffffffeac0) =3D 0 (0x0)
946: geteuid() =3D 0 (0x0)
946: write(2,"shutdown: ",10) =3D 10 (0xa)
946: write(2,"incompatible switches -c, -h, -k"...,43) =3D 43 (0x2b)
---- truss output end ----

If we change system call to
execle("/sbin/shutdown", "-h", shutdown_flag, "+0",
               "hypervisor initiated shutdown", (char*)NULL, environ);

all is ok.

But, may be this an error in args parsing in FreeBSD "shutdown" ?

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-232950-227>