New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`kalite manage setup` erroneously warns about installing as root user #5032

Closed
indirectlylit opened this Issue Mar 23, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@indirectlylit
Member

indirectlylit commented Mar 23, 2016

Summary

Following the getting started instructions, running

kalite manage setup --username=admin --password=pass --noinput

prints:

-------------------------------------------------------------------
WARNING: You are installing KA-Lite as root user!
    Installing as root may cause some permission problems while running
    as a normal user in the future.
-------------------------------------------------------------------

However, this is not true.

Branch or installer method

develop branch, OSX 10.9.5, Python 2.7.11

How to reproduce

Check out a fresh copy of the develop, create a new virtualenv environment, and follow the instructions until step 8.

This seems to stem from setup.py, and was already noted in the code:

        # Tried not to be os-specific, but ... hey. :-/
        # benjaoming: This doesn't work, why is 502 hard coded!? Root is normally
        # '0' And let's not care about stuff like this, people can be free to
        # run this as root if they want :)
        if not is_windows() and hasattr(os, "getuid") and os.getuid() == 502:
            print(
                "-------------------------------------------------------------------")
            print("WARNING: You are installing KA-Lite as root user!")
            print(
                "\tInstalling as root may cause some permission problems while running")
            print("\tas a normal user in the future.")
            print(
                "-------------------------------------------------------------------")
            if options["interactive"]:
                if not raw_input_yn("Do you wish to continue and install it as root?"):
                    raise CommandError("Aborting script.\n")
@radinamatic

This comment has been minimized.

Show comment
Hide comment
@radinamatic

radinamatic Mar 23, 2016

Contributor

Could you please edit your issue - fill in the rest of the issue template and delete non applicable parts - so we can better understand the actual problem? Thanks! 😃

Contributor

radinamatic commented Mar 23, 2016

Could you please edit your issue - fill in the rest of the issue template and delete non applicable parts - so we can better understand the actual problem? Thanks! 😃

@indirectlylit

This comment has been minimized.

Show comment
Hide comment
@indirectlylit

indirectlylit Mar 23, 2016

Member

slipped and submitted before complete. updated now.

Member

indirectlylit commented Mar 23, 2016

slipped and submitted before complete. updated now.

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Jun 21, 2016

Member

Nicely spotted, @indirectlylit.. I always wondered why someone had put 502 there.

It doesn't make sense.

On a Mac OSX, the first user is 501 and the second user is 502. Someone must have wrongly assumed that this would be the root user on any system!?

We should use a check like os.geteuid() == 0.

Member

benjaoming commented Jun 21, 2016

Nicely spotted, @indirectlylit.. I always wondered why someone had put 502 there.

It doesn't make sense.

On a Mac OSX, the first user is 501 and the second user is 502. Someone must have wrongly assumed that this would be the root user on any system!?

We should use a check like os.geteuid() == 0.

@benjaoming benjaoming self-assigned this Jun 21, 2016

@benjaoming benjaoming added this to the 0.16.7 milestone Jun 21, 2016

@benjaoming benjaoming added the bug label Jun 21, 2016

@benjaoming benjaoming referenced this issue Jul 27, 2016

Merged

test getuid() == 0 instead of arbitrary 502 #5222

3 of 3 tasks complete
@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Jul 28, 2016

Member

Fixed in #5222

Member

benjaoming commented Jul 28, 2016

Fixed in #5222

@benjaoming benjaoming closed this Jul 28, 2016

benjaoming added a commit to benjaoming/ka-lite that referenced this issue Jul 28, 2016

benjaoming added a commit to benjaoming/ka-lite that referenced this issue Jul 28, 2016

benjaoming added a commit to benjaoming/ka-lite that referenced this issue Jul 31, 2016

benjaoming added a commit to benjaoming/ka-lite that referenced this issue Jul 31, 2016

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