Skip to content
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

lib389 should not create instance using nobody:nobody #1578

Closed
389-ds-bot opened this issue Sep 12, 2020 · 7 comments
Closed

lib389 should not create instance using nobody:nobody #1578

389-ds-bot opened this issue Sep 12, 2020 · 7 comments
Labels
closed: fixed Migration flag - Issue

Comments

@389-ds-bot
Copy link

Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/48247


If you are running lib389 as root, by default it will create a DS instance as nobody:nobody. This causes permissions problems when running lib389 test cases in 389-ds-base(ds/dirsrvtests/).

One option is to create a "dirsrv" user, if it doen't exist, and that should be the default used for instance creation.

@389-ds-bot 389-ds-bot added the closed: fixed Migration flag - Issue label Sep 12, 2020
@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2015-08-14 00:11:24

Since this is strictly and only for use with testing, it is probably ok to omit the -M -s /sbin/nologin and -r switches.

Do you also need the dirsrv group, or does useradd automatically create a group for the user?

You should clean up after and delete the user if you created it. What if it already exists on the system? I suppose you could create it with -c "lib389 test" or something like that, and only remove it during cleanup if the comment field matches.

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2015-08-14 00:15:09

Replying to [comment:2 richm]:

Since this is strictly and only for use with testing, it is probably ok to omit the -M -s /sbin/nologin and -r switches.

Do you also need the dirsrv group, or does useradd automatically create a group for the user?

It does

You should clean up after and delete the user if you created it. What if it already exists on the system?

If it already exists, then it is not added, and it is just used for the userid/groupid.

I suppose you could create it with -c "lib389 test" or something like that, and only remove it during cleanup if the comment field matches.

Sounds good. I'll work on a revision.

@389-ds-bot
Copy link
Author

Comment from spichugi (@droideck) at 2015-08-14 13:05:31

453  os.system("/usr/sbin/useradd %s" % (DEFAULT_USER))

Please, use '''subprocess''' module instead.

There's you can find the fully explanation about this issue:
[https://docs.python.org/2/library/os.html#os.system]
[https://docs.python.org/2/library/subprocess.html]

Also, the better way is use '''a dict''' as an argument, that contains all parts of command in separate items, not just one string(with variable substitution and such stuff).

@389-ds-bot
Copy link
Author

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2015-08-15 04:40:08

To ssh://git.fedorahosted.org/git/389/lib389.git
7a5fbe4..2f78164 master -> master
commit 2f7816407e594f87bd77e55eeab794fa6436043b
Author: Mark Reynolds mreynolds389@redhat.com
Date: Fri Aug 14 15:54:05 2015 -0400

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2016-02-13 04:52:07

Milestone lib389 1.0 deleted

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2017-02-11 22:51:55

Metadata Update from @mreynolds389:

  • Issue assigned to mreynolds389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: fixed Migration flag - Issue
Projects
None yet
Development

No branches or pull requests

1 participant