32 Bit UIDs For Unix?
Ghidra asks: "I work for an ISP and we now have UIDs greater than 65535. I thought by upgrading to Linux 2.4 (and having fairly current utilities) that I would be able to support these UIDs. Unfortunately, it doesn't look that easy. It also doesn't look like there is much help on the Internet on how to accomplish this. Things like ls, ps, chown, and the like just don't want to recognize these high numbered UIDs. So what kind of steps do I need to take to upgrade my system (Slackware-current) to support 32 bit UIDs?" What other Unix variants can benefit from this information, as I don't think Linux is the only Unix-clone that still uses 16-bit UIDs. Are there any flavors of Unix that have already solved this problem?
$ uname -sr /usr/include/sys/types.h
/* user id */
FreeBSD 4.2-STABLE
$ grep uid_t
typedef u_int32_t uid_t;
$
Okay you work at an ISP... but you have over 65k users who log in and use the system??
If not, use something like vpopmail so you don't need an actual unix account for each mail user. Proftpd will let you disentangle the FTP system from the unix accounts as well.
If you actually have that many people using shell accounts you should look into recompiling a lot of yoru standard utility packages: Util-linux, net-tools (I think), etc. Simply recompiling will probably solve your problems since they will be linked in with 32-bit UID support (I don't know of any distros which use 2.4.x as standard yet).
There are two major things that must be upgraded in order to get 32-bit UID's, and you've got one of them already. The other is the C library. The Linux 2.4 kernel has support for 32-bit UID's, but all the executables on your system are linked against a C library which must also know about big UID's.
32-bit UID's are supported in version 2.2 of the GNU C library. Red Hat Linux 7 will provide you with glibc 2.1.92, which, after upgrading to a 2.4 kernel, does the trick just fine. I tried out 32-bit UID support with the first publically available RH7 beta, and it worked like a charm.
I thought the same thing you did, and tried 32 bit UIDs on a RH6.2 box with the 2.4-test kernels. It failed, and there was much weeping and gnashing of teeth.
When RH7 came out, I put that on my desktop and installed a 2.4-test kernel, and it's been running beautifully ever since. And there was much rejoicing.
Dave, with a UID of 2015001 and NFS mounting from a big AIX box
Put the userid, the password and the home directory into the database. Authenticate off the database (might need to customize your FTP server to do this), and chroot() to the home directory. So long as you have the web server set up to chroot() when executing CGIs (and have the approriate hardlinks on your filesystem for binaries/libraries) you can have all the web sites owned by the same Unix user. I did this for an ISP back in '97 or so, with a few thousand users.
UIDs aren't just required for shell access and mail. Most ISPs provide web space now, and some mechanism to allow the user - and that user alone - to modify the content. Maybe HTTP PUT, maybe FTP. The standard file systems ownership fields are one way to handle this if you're using the standard servers.
For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken