Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

when you add a user?

Discussion in 'General Discussion' started by carock, Jun 9, 2004.

  1. carock

    carock Well-Known Member

    Joined:
    Sep 25, 2002
    Messages:
    256
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    St. Charles, MO
    When you add a new Cpanel account, does it use the systems' adduser or useradd command, or does it just write to the files directly?

    I would like to know so I can remove the adduser binary from the system.

    Thanks,
    Chuck
     
  2. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    778
    Likes Received:
    4
    Trophy Points:
    318
    Location:
    N.W. Iowa
    If you examine the wwwacct script in the /scripts folder, you'll see the following code around line 770 or so:
    Code:
    if ($system =~ /freebsd/i) {
    	($fd0, $fd1) = POSIX::pipe();
    	POSIX::write( $fd0, $pass, length($pass) );
    	if (int($minuid) > 1) {
    		system("/usr/sbin/pw","adduser","$user","-i","$minuid,32000","-b","$mnt","-h",$fd1);
    	} else {
    		system("/usr/sbin/pw","adduser","$user","-b","$mnt","-h",$fd1);
    	}
    } else {
    	if (-e "/etc/SuSE-release" && -x "/usr/sbin/useradd") {
    		system("/usr/sbin/groupadd","${user}");
    		system("/usr/sbin/useradd","-d","${mnt}/${user}","-g","${user}","${user}");
    	} else {
    		$result = system("/scripts/adduser","$user","$mnt","!!");
    	}
    	open(CHPASS,"|/scripts/chpass");
    	print CHPASS "${user} ${pass}\n";
    	close(CHPASS);
    }
    
    you see it uses both, depending on which system your using. Hope this helps :D
    Mickalo
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. carock

    carock Well-Known Member

    Joined:
    Sep 25, 2002
    Messages:
    256
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    St. Charles, MO
    Cool, so as long as I'm not using Suse, it should be good to remove it then.

    I'll try it out.

    Thank you.

    Chuck
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice