setuid bit not set (sometimes) #2951

Closed
minshallj opened this Issue Feb 19, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@minshallj
Contributor

minshallj commented Feb 19, 2015

to recreate:

1: start with a recipe that looks like

file "try_it" do
        action :create
        content "Hey there"
        mode "4755"
        owner "chef"
        group "chef"
end

2: run it and inspect the file

ls -l try_it
-rwsr-xr-x 1 chef chef   9 Feb 19 19:35 try_it

3: then edit the recipe to look like this

file "try_it" do
    action :create
    content "Hey there"
    mode "4755"
    owner "root"
    group "root"
end

4: run it and inspect the file

ls -l try_it
-rwxr-xr-x 1 root root   9 Feb 19 19:35 try_it

note the setuid bit is no longer set, on the next run of chef it will be set however.

@lamont-granquist

This comment has been minimized.

Show comment
Hide comment
@lamont-granquist

lamont-granquist Feb 20, 2015

Contributor

This happens on Ubuntu and not Mac correct?

It is because setting the ownership on Ubuntu, even with chown from the command line, strips the setuid bit as a side effect.

Contributor

lamont-granquist commented Feb 20, 2015

This happens on Ubuntu and not Mac correct?

It is because setting the ownership on Ubuntu, even with chown from the command line, strips the setuid bit as a side effect.

@minshallj

This comment has been minimized.

Show comment
Hide comment
@minshallj

minshallj Feb 20, 2015

Contributor

This was done in a cent os server, but I assume it holds true for all
Linux.
On Feb 19, 2015 4:18 PM, "Lamont Granquist" notifications@github.com
wrote:

This happens on Ubuntu and not Mac correct?

It is because setting the ownership on Ubuntu, even with chown from the
command line, strips the setuid bit as a side effect.


Reply to this email directly or view it on GitHub
#2951 (comment).

Contributor

minshallj commented Feb 20, 2015

This was done in a cent os server, but I assume it holds true for all
Linux.
On Feb 19, 2015 4:18 PM, "Lamont Granquist" notifications@github.com
wrote:

This happens on Ubuntu and not Mac correct?

It is because setting the ownership on Ubuntu, even with chown from the
command line, strips the setuid bit as a side effect.


Reply to this email directly or view it on GitHub
#2951 (comment).

@minshallj minshallj closed this May 7, 2015

EricDuminil referenced this issue in EricDuminil/itamae Oct 26, 2016

@thommay thommay added Type: Bug and removed Bug labels Jan 25, 2017

@chef chef locked and limited conversation to collaborators Nov 16, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.