[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [coldsync-hackers] Variables in Coldsync.conf
Sorry, could you give me more detail on how to set this up?
For reference, I have
*Visor*|root|0|bjohnson
in /etc/palms and in /etc/coldsync.conf
pda "Brian's Palm IIIe" {
snum: "*Visor*";
# directory: "${HOME}/.palm";
directory: "/home/bjohnson/.palm";
username: "root";
userid: 0;
}
When I switched the directory setting, it tried to access //.palm so it
thought I was root
When I have
conduit fetch, dump {
path: "/usr/share/coldsync-2.2.5/conduits/memo-text";
type: memo/DATA;
arguments:
# File: $(HOME)/Memos;
File: /home/bjohnson/Memos;
Delete: no;
}
it works, I haven't yet tried File: $(HOME)/Memos; or File: Memos; to stick
it in the users home directory specified by the directory statement in the
pda block
I hope one of these works so I don't have to make a copy of every conduit
for every user in their .coldsyncrc file
-----Original Message-----
From: owner-coldsync-hackers@lusars.net
[mailto:owner-coldsync-hackers@lusars.net]On Behalf Of Andrew
Arensburger
Sent: Friday, February 08, 2002 9:22 AM
To: coldsync-hackers@lusars.net
Subject: Re: [coldsync-hackers] Variables in Coldsync.conf
[Rearranged to conform to email standards.]
On Fri, Feb 08, 2002 at 08:35:53AM -0500, Brian Johnson wrote:
> > From: Fred Gylys-Colwell
> > Sent: Friday, February 08, 2002 1:32 AM
> > To: coldsync-hackers@lusars.net
> > Subject: Re: [coldsync-hackers] Variables in Coldsync.conf
> >
> > I think that $(HOME) gets expanded to the home directory of the user
> > running coldsync. Are you running it as root?
Indeed this might be the case, if you're running in daemon
mode. Rather than just taking my word as to which variables are set to
what, it'd be easier to just add a conduit like:
#!/bin/sh
echo "Args: $@" 1>&2
echo "Environment:" 1>&2
set 1>&2
echo "200 Success"
sync with "-l mylogfile", then look at the log file.
> > It would probably take a special hack to coldsync to either read in
> > the users environment, or just set USER and HOME after it has figured
> > out who's palm is in the cradle.
I'd kind of hoped that setuid() would set some environment
variables, but no such luck, apparently.
It should be reasonably easy to do this, though. IMO the best
place to do this is in src/conduit.c, just after it figures out the
path to the conduit executable, and just before it calls execv(). At
that point, the relevant information is already in the global variable
'userinfo'.
> Now that gives me an idea.
>
> As far as I can figure, right now to add a new user, you need to add an
> entry to /etc/palms to map the palm user to a local user and also make a
pda
> block in coldsync.conf or .coldsyncrc.
>
> I don't know the internal operations of Coldsync, but can the mapping to
the
> local user be done within coldsync.conf?
I'm not sure that's the best way to do things: when ColdSync
runs in daemon mode, it runs as root. It then gets a connection from
some random Palm, and needs to figure out whose Palm it is so that it
can surrender root privileges properly. The point is to run as root
for as short a time as possible. /etc/palms is intended as a minimal
file that maps PDAs to users.
Before the setuid(), most of /etc/coldsync.conf is useless. I
think the only bits of useful information are the listen{} block and
the serial line speed (if applicable).
> Not only that, but if getting the local users home directory is difficult,
> can we just define it in the pda block and then refer to it later in the
> coldsync.conf file (in the conduit blocks)?
ColdSync already looks up the user's home directory, because
it needs to know where to look for the ".palm" directory. So IMO the
best thing to do is to set a minimal environment just before
execv()ing the conduit.
--
Andrew Arensburger This message *does* represent the
arensb@ooblick.com views of ooblick.com
I'm not arrogant, I'm RIGHT!
--
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.
--
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.