On Sep 18, 2009, at 6:53 AM, Daniel J. Luke wrote:

On Sep 17, 2009, at 9:44 PM, Scott Haneda wrote:
Hello, I am working on trying to make a change to a port that does not have user and group adding abilities, but it probably should. At this point, I need to confirm this by adding a user and group by hand, using dscl in Mac OS X 10.5

The port should use the adduser/addgroup commands (see 'man portfile')

Yes, thanks, eventually I will use those commands, though for the time being, I need to test that it works in this way, to be sure I am even on the right track.

I took this from some old docs on dovecot:
sudo dscl . -create /Groups/_ftpg
sudo dscl . -create /Groups/_ftpg UniqueID 490
sudo dscl . -create /Users/_ftpu
sudo dscl . -create /Users/_ftpu UserShell /usr/bin/false
sudo dscl . -create /Users/_ftpu RealName "PureFTPd FTP Server"
sudo dscl . -create /Users/_ftpu UniqueID 490
sudo dscl . -create /Users/_ftpu PrimaryGroupID 490
sudo dscl . -create /Users/_ftpu NFSHomeDirectory /var/empty

This sort of works. In this case, the ftpd has a flag to "auto create home dirs", which I have enabled. I have told the ftpd to use user and group 490. On first ftp login, it will create the directory I tell it to:

drwxr-x---  2 _ftpu   490     68 Sep 17 18:42 someplace

As you can see, there is something wrong with the group.

You didn't set PrimaryGroupID

Thank you, that did the trick.

$sudo chgrp _ftpg someplace/
drwxr-x---  2 _ftpu   nobody   68 Sep 17 18:42 someplace

I think what I would really like to do is also create a user and group more like www and mysql, where they have both the _foo and foo version, but I can not figure this out.

why? I don't think you want/need to have the user be 'special' in this way.

Any idea what the significance of the _user and _group is?
--
Scott * If you contact me off list replace talklists@ with scott@ *

_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to