Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#11012 closed enhancement (fixed)

Portutil should use dscl instead of niutil

Reported by: giorgio_v@… Owned by: kballard (Kevin 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 11 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 11 years ago by markd@…

  • Component changed from ports to base
  • severity changed from Crash/data loss to Normal

Changing ticket to base.

comment:3 Changed 11 years ago by jberry@…

This sounds like a good idea to me.

comment:4 Changed 11 years ago by jberry@…

It will of course need testing.

comment:5 Changed 11 years ago by jmpp@…

  • Milestone set to Needs developer review
  • Type changed from defect to enhancement

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

-jmpp

comment:6 Changed 11 years ago by kballard (Kevin 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 11 years ago by kballard (Kevin Ballard)

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

comment:8 Changed 11 years ago by kballard (Kevin Ballard)

  • Status changed from new to assigned

comment:9 Changed 11 years ago by jmpp@…

  • Milestone changed from Needs developer review to MacPorts 1.4
  • Resolution set to fixed
  • Status changed from assigned to closed

This was fixed by Eridius in r25586, closing ticket.

-jmpp

comment:10 Changed 10 years ago by nox@…

  • Priority changed from Important to High

comment:11 Changed 10 years ago by nox@…

  • Milestone changed from MacPorts 1.4 to MacPorts 1.5
Note: See TracTickets for help on using tickets.