@id
Chris Rendall
CRendall at teamind.com
Thu Jan 25 11:13:23 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.
The way I got around it is by using the environment variable LOGNAME
that is set when the user logs in. Where I was using @id before I
changed it to getenv("LOGNAME") and my code is working correctly again.
SUSE Linux let me create a username that is 13 characters long so
hopefully that won't mess anything else up. So far the system is
working great.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3368 bytes
Desc: not available
Url : http://lists.celestial.com/pipermail/filepro-list/attachments/20070125/7eafc272/attachment.bin
More information about the Filepro-list
mailing list