[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coldsync-hackers] conduit - userid information
On Monday 01 March 2004 04:09, Janssen, B.J. wrote:
> Hello,
>
> I'm writing a Coldsync fetch/dump Conduit. To distinguish between the
> different users I planned to discriminate by snum. But since my Sony Clie
> PEG-TJ25 does not return a serial number that is not an option. Now I
> want to use a combination of ctime of the database, the palm username and
> the userid on the palm. The problem is I don't know how to get the userid
> information into my fetch and dump scripts. Is it possible to get this
> information dynamically, and how can I get it?
Hmmm...
The PDA username is provided in $HEADERS{PDA-Username}. You also have the
PDA serial number in $HEADERS{PDA-Snum}, but you've already guessed that
you can't count on it. The user id... doesn't seem to be available. It's a
one liner to add, if you want to work from the CVS repository.
I'm not sure that having both the userid and username would be a big help,
anyhow. These are the values defined in coldsync.conf and if you're not
setting the username to something unique, you've potentially got other
problems.
One trick you can use, however, is to set the PDA userid to the Unix userid
and just use POSIX::getuid() or whatever the corresponding perl variable is
called. Also ensures that you can't accidentally have two identical userids
on any two PDAs synched to your system.
I suppose you could also pull the userid and username directly from one of
the backup databases... I'm not quite sure off hand which one, probably the
hotsync database, and probably also one of the preference files. But
that'll involve understanding those record structures.
I'm not sure that you want to count on ctime, either. I've been burned,
badly, by assuming that certain timestamps can't change.
c.
This message was sent through the coldsync-hackers mailing list. To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body. For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.