Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

User creation warning with dselect and fink UNIX
When first using dselect, the package manager with Fink, be very careful about letting it create users.

I wasn't paying careful enough attention and allowed Fink to create five or six new users, one of which was called "mysql". I already had a mysql user in order to run a MySQL server, but the new user Fink created overwrote that user, breaking my MySQL installation.

It is easy enough to remove that user, and recreate a mysql user, change the ownership of the correct files, and restore your MySQL installation, however, DO NOT use the Users preference pane in System Preferences to remove any of the users!

When Fink creates the users, if you check NetInfo, you'll see that each user's home folder is "/". Not good. Mac OS X assumes that when you remove a user, you, the admin, should take over the ownership of the former user's files. However, its not too smart about how it changes the ownership. Starting at the mysql user's home folder, /, OSX chowned EVERY SINGLE FILE stemming from the root directory to now be owned by me, nelsonj. To delete the user, you gave OSX root access, so it was able to change the ownership of all files, even those owned by "root". Things immediately ceased to work. I had to log out and log in as root (su and sudo don't work without the proper file ownerships). Tehn I had to change the ownership of everything back to root, then specify certain directories and change them back to my own. It's still not working 100%.

The lesson is either don't let Fink create new users, and/or don't use System Preferences to delete the users!

[Editor's note: I can't confirm this situation, as fink has never created a user on my system, but I thought a warning may be in order given the description of the situation! If you have further information, please post what you know about fink and user creation.]
  • Currently 3.00 / 5
  You rated: 4 / 5 (3 votes cast)

User creation warning with dselect and fink | 12 comments | Create New Account
Click here to return to the 'User creation warning with dselect and fink' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Not for me...
Authored by: sabi on Apr 30, '02 02:25:14AM
When Fink creates the users, if you check NetInfo, you'll see that each user's home folder is "/".

Not that I saw. Here are the users it's created for me:
news:*:250:250::0:0:News Server:/dev/null:/dev/null
mysql:*:251:251::0:0:MySQL Database Server:/dev/null:/dev/null
pgsql:*:252:252::0:0:PostgreSQL Database Server:/dev/null:/dev/null
games:*:253:253::0:0:Game Files Owner:/dev/null:/dev/null
(Anybody have any idea why my posts keep on showing up double-spaced? They don't for me...)

[ Reply to This | # ]
Not for me...
Authored by: cubixe on Apr 30, '02 03:17:33AM

I doubled-checked NetInfo and i'm showing that the home folders are all "/" while the shell path is /dev/null. I neglected to mention that "fink --version" reports package manager: 0.9.11 and Distribution version: 0.4.0. What version are/were you using to create those users?

[ Reply to This | # ]
Authored by: robg on Apr 30, '02 08:33:15AM

That's a "feature" of Geeklog 1.1, where it treats hard returns as "br" tags. This has been fixed in GL 1.35, which we're very close to upgrading to. For now, you basically can't use hard returns in HTML mode (or if you do, you can't use "br" tags). Inside "pre" tags, use "br" tags only without hard returns.

It's quite a pain, which is one of the reasons I'm so anxious to upgrade the site!


[ Reply to This | # ]
Multiple problems as a result of fink
Authored by: torifile on Apr 30, '02 03:04:22AM

I've been very wary of using fink to install stuff as it has screwed up my installation several times. The most troublesome of which was the mysql thing. I've since resolved that issue by letting fink install mysql for me, rather than doing it myself. Not an ideal solution, but it's a trade off I'm willing to accept for all the benefit that having fink brings.

[ Reply to This | # ]
Multiple problems as a result of fink
Authored by: cubixe on Apr 30, '02 03:14:35AM

An interesting quetsion is why is there no "SystemMySQL" as there is for other programs such as XFree86, where fink just checks your system to see that you have a valid install, then creates its own placeholder to make fink aware of the install.

[ Reply to This | # ]
Quick Fix
Authored by: vonleigh on Apr 30, '02 03:57:30AM


I knew fink had created a few users on my system, didn't know about the home directories being / though. For a quick fix read on.

You can list your users using the following command:

% sudo niutil -list / /users

Then you can see their home directories by doing:

% sudo niutil -list / /users home

You'll see which users have as their home just /. To change these just run the following commands:

% mkdir finkusers #create a dummy finkusers folder wherever you want it.
% sudo niutil -appendprop / /users/mysql home "/<path>/finkusers/"
% sudo niutil -appendprop / /users/news home "/<path>/finkusers/"
% sudo niutil -appendprop / /users/pgsql home "/<path>/finkusers/"
% sudo niutil -appendprop / /users/games home "/<path>/finkusers/"
% sudo niutil -appendprop / /users/canna home "/<path>/finkusers/"

Making sure to replace <path> with the proper path for the directory. For security purposes I made the folder "finkusers" owned by root.


[ Reply to This | # ]
Re: Quick Fix
Authored by: bjn on Apr 30, '02 09:28:10AM

If you only do "-appendprop" you end up with two values for the home property, the old value / and the new value you provided, and so the name service (getpwnam/getpwuid) still says that / is the home directory (it must pick the first one).

To get this to work, I had to also add a "-destroyprop" -- I don't know if that's the "right way" but it worked for me. So:

% sudo niutil -destroyprop / /users/<login> home /
% sudo niutil -appendprop / /users/<login> home <path>

[ Reply to This | # ]
Quick Fix
Authored by: chvid on Jun 23, '02 04:19:30PM

I found that all I needed to do was change the UID number of the new Fink-created mysql user to that of the "old" mysql user, which I determined by looking at the owner of the files in the /usr/local/mysql/bin - they belonged to user "504" instead of "mysql". After I did that, MySql started fine...

[ Reply to This | # ]
Already fixed
Authored by: bhines on Apr 30, '02 06:35:56AM

This was fixed, but it didn't make it into the first stable distro for .4.

Several ways to fix it now:

sudo dpkg --remove --force-depends passwd
to get rid of your passwd (ignoring dependencies)

Then, either:
- fink selfupdate-cvs; fink install passwd - will get and reinstall the fixed passwd pkg.
- Enable unstable tree and reinstall passwd. (fixed version was accidentally in unstable for the original .40 dist)
- sudo apt-get install passwd - will install the fixed passwd pkg from bindist.

[ Reply to This | # ]
Didn't work for me
Authored by: bjn on Apr 30, '02 09:23:27AM

I did the "dpkg --remove" followed by the "apt-get install passwd", and it didn't change any of the home directories, they were all still / -- I had to follow the niutil instructions above to get the home directories changed.

[ Reply to This | # ]
Didn't work for me
Authored by: bhines on May 01, '02 07:19:08PM

hmm, you might have to "fink rebuild passwd" before reinstalling. (after selfupdating!)

[ Reply to This | # ]
Fink isn't the problem here
Authored by: babbage on Apr 30, '02 11:25:00AM
Just to keep the blame from being piled up on the Fink project, the problem *isn't* with Fink. Rather, it is a glitch with the "passwd" package, which is required by a number of other things you may have installed with Fink (from stable: mysql, nethack, gnome-games, gnome-libs; from unstable: those plus postgresql, warp, leafnode, and postfix). This is a known bug, which is slated to be patched very soon. If you haven't installed any of these packages, then you probably didn't get passwd either, and you'll have no problem.

In the meantime, if I remember correctly, the fix is to set the home & shell parameters for these virtual users to /dev/null. This or something like it is probably what the fix will end up doing. That, or just leave things alone -- if your MySQL installation still works with the user you created for it, then you can leave the Passwd installed version alone for now. Granted, it may be a minor security hole to have extra users in your system database, but chances are it's not going to hurt much by being there.

In any event, the important point is that Fink isn't the critical problem here. Blaming Fink for this is like saying OSX is broken because of an iTunes bug -- it's inaccurate & misleading, and could scare people away from using a very good system that is being actively maintained & developed by a lot of enthusiastic users. The problem here is known, and while it is serious, a fix is on the way that will at least keep it from damaging other users. For more info, about this & other issues, please feel free to sign up for the Fink mailing lists.

[ Reply to This | # ]