Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • lemonldap-ng lemonldap-ng
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 315
    • Issues 315
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • LemonLDAP NGLemonLDAP NG
  • lemonldap-nglemonldap-ng
  • Issues
  • #2562
Closed
Open
Issue created Jul 15, 2021 by Alex Kelly@kellyaContributor

Add --user/--group options to lmConfigEditor and lemonldap-ng-cli (user:group hardcoded to apache may not work correctly)

Summary

Attempting to use lmConfigEditor gives errors about being unable to read configuration files. In order to make lemonldap-ng work with nginx, everything has to be owned nginx:nginx instead of apache:apache, but hard coding the user and group in this utility makes it impossible to use with anything other than apache.

Design proposition

add CLI options to specify --user and --group to override apache:apache.

I'm not a PERL master, but I made it work with this

use Getopt::Long;

our $opt_user = 'apache';
our $opt_group = 'apache';
GetOptions (
        "user=s" => \$opt_user,
        "group=s"   => \$opt_group
)
or die("Error in command line arguments\n");

eval {
    setgid( ( getgrnam($opt_group) )[2] );
    setuid( ( getpwnam($opt_user) )[2] );
    print STDERR "Running as uid $EUID and gid $EGID\n";
};
Edited Jul 15, 2021 by Yadd
Assignee
Assign to
Time tracking