Opened 18 years ago

Closed 17 years ago

Last modified 17 years ago

#11012 closed enhancement (fixed)

Portutil should use dscl instead of niutil

Reported by: giorgio_v@… Owned by: kballard (Lily Ballard)
Priority: High Milestone: MacPorts 1.5
Component: base Version: 1.3.2
Keywords: dscl niutil portutil Cc:
Port:

Description

Under the Mac OS X platform portutil.tcl should use dscl: Something (not tested) like:

proc adduser 
	system "dscl . -create /Users/${name}"
	system "dscl . -create /Users/${name} name ${name}"
	system "dscl . -create /Users/${name} passwd ${passwd}"
	system "dscl . -create /Users/${name} uid ${uid}"
	system "dscl . -create /Users/${name} gid ${gid}"
	system "dscl . -create /Users/${name} realname ${realname}"
	system "dscl . -create /Users/${name} NFSHomeDirectory ${home}"
	system "dscl . -create /Users/${name} UserShell ${shell}"}}}
{{{
proc addgroup 
	system "dscl . -create /Groups/${name}"
	system "dscl . -create /Groups/${name} name ${name}"
	system "dscl . -create /Groups/${name} gid ${gid}"
	system "dscl . -create /Groups/${name} passwd ${passwd}"
	system "dscl . -create /Groups/${name} GroupMembership ${users}"}}}
}}}

Change History (11)

comment:1 Changed 18 years ago by giorgio_v@…

My pseudo code didn't make it :-/

	system "dscl . -create /Users/${name}"
	system "dscl . -create /Users/${name} name ${name}"
	system "dscl . -create /Users/${name} passwd ${passwd}"
	system "dscl . -create /Users/${name} uid ${uid}"
	system "dscl . -create /Users/${name} gid ${gid}"
	system "dscl . -create /Users/${name} realname ${realname}"
	system "dscl . -create /Users/${name} NFSHomeDirectory ${home}"
	system "dscl . -create /Users/${name} UserShell ${shell}"
	system "dscl . -create /Groups/${name}"
	system "dscl . -create /Groups/${name} name ${name}"
	system "dscl . -create /Groups/${name} gid ${gid}"
	system "dscl . -create /Groups/${name} passwd ${passwd}"
	system "dscl . -create /Groups/${name} GroupMembership ${users}"

comment:2 Changed 18 years ago by markd@…

Component: portsbase
severity: Crash/data lossNormal

Changing ticket to base.

comment:3 Changed 18 years ago by jberry@…

This sounds like a good idea to me.

comment:4 Changed 18 years ago by jberry@…

It will of course need testing.

comment:5 Changed 18 years ago by jmpalacios (Juan Manuel Palacios)

Milestone: Needs developer review
Type: defectenhancement

Setting to the "Needs developer review" milestone so that base hackers pick it up when browsing the roadmap.

-jmpp

comment:6 Changed 18 years ago by kballard (Lily Ballard)

This seems like a good idea to me as well, and shouldn't be particularly hard.

Incidentally, after a reading of the dscl manpage, it appears you can specify all key/value pairs in one create command.

comment:7 Changed 18 years ago by kballard (Lily Ballard)

Owner: changed from macports-dev@… to eridius@…

comment:8 Changed 18 years ago by kballard (Lily Ballard)

Status: newassigned

comment:9 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Milestone: Needs developer reviewMacPorts 1.4
Resolution: fixed
Status: assignedclosed

This was fixed by Eridius in r25586, closing ticket.

-jmpp

comment:10 Changed 17 years ago by nox@…

Priority: ImportantHigh

comment:11 Changed 17 years ago by nox@…

Milestone: MacPorts 1.4MacPorts 1.5
Note: See TracTickets for help on using tickets.