The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    232
    Likes Received:
    1
    Trophy Points:
    18
    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:
    765
    Likes Received:
    2
    Trophy Points:
    18
    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
     
  3. carock

    carock Well-Known Member

    Joined:
    Sep 25, 2002
    Messages:
    232
    Likes Received:
    1
    Trophy Points:
    18
    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