@id
Fairlight
fairlite at fairlite.com
Thu Jan 25 10:39:57 PST 2007
Confusious (Chris Rendall) say:
> With SCO UNIX the longest username possible was 8 characters. Linux
> allows longer usernames so I've created everyone's username as the first
> initial and last name. In filePro @id only returns the first 8
> characters which has broken a number of my apps since it is cutting off
> the username. I'm still running 5.0.14 and I'm wondering if this has
> been fixed in a newer release, and it not are there plans to expand @id
> to return the whole username?
I doubt they're planning on changing it, personally.
It's also a good idea to stick with the lowest common denomenator, no
matter what 'x' platform allows. There's a reason I don't use "fairlight"
as a username even on linux, and stick to my legacy 8-char "fairlite" on
-every- system I use on which I get my own account--it's always going to
work.
Seeing as you have code in place already, what I would suggest is that
instead of using @ID, you actually use getenv("USER") and store it in a
field of whatever length you deem appropriate. Actually, I did some
quick poking, and on both 2.4 and 2.6 kernels, the answer is:
# define L_cuserid 9
...a whole whopping extra character. I traced this from the include file
trace for getlogin(3), which pointed to /usr/include/stdio.h which lead to
/usr/include/bits/stdio_lim.h in the end. I didn't have a lot of time to
check for backups (the define is listed in an #ifdef for POSIX), but it
looks like that's the actual limit defined up-front unless my C is a lot
rustier than I think. Thing is, I know I've seen longer usernames--I'm
just not sure where the other definition that allows it is, nor do I
currently have time to look.
At any rate, no matter what the length, create the extra field and store
from that env var and use that field instead of the system maintained
field, and you're set.
mark->
--
Try our new SPF-0 lotion, SunScream[tm]. Get it while it's hot!
More information about the Filepro-list
mailing list