Subject: SFTP: password file lookups?

From: Simon Tatham <[email-masked]>
Date: Tue, 20 Feb 2001 13:02:30 +0000

I'm in the middle of writing an SFTP client at the moment, and it's
occurred to me that a couple of functions to look things up in the
password file would be handy:

 - when you get back numeric UIDs from FXP_READDIR, they're unlikely
   to be terribly meaningful to the user unless they can be
   translated back into usernames.

 - if the user issues FXP_SETSTAT to change ownership, they're
   likely to want to specify a username and have it converted into a
   user id.

 - if the user wants to copy something from another user's home
   directory, they may well want to type `~user' as the pathname.
   Being able to look up a user's home directory would be handy.

Obviously I realise that I could do all this myself by reading
/etc/passwd, but that strikes me as utterly the wrong solution
because (a) it assumes the server is Unix, and (b) it doesn't cope
with NIS.

Are there any plans to add these features to the drafts, or is it
far too late by now?

Cheers,
Simon
-- 
Simon Tatham         "Selfless? I'm so selfless I
<[email-masked]>    don't even know who I am."

---

From: Markus Friedl <[email-masked]>
Date: Tue, 20 Feb 2001 15:56:59 +0100

>    Being able to look up a user's home directory would be handy.

i don't think the concept of a
	'home directory of other users'
fits into the sftp-protocol.

-markus

---

From: [email-masked] (Niels M�ller)
Date: 20 Feb 2001 17:59:03 +0100

> password file would be handy:

That would make sense to me, either as an extension or as part of the
core protocol. One reason to have it in the core protocol is that it
is ugly that the longname in SSH_FXP_NAME, which is supposed to be
redundant, contains information that is not available anywhere else.

/Niels

---

From: Simon Tatham <[email-masked]>
Date: Wed, 21 Feb 2001 15:00:02 +0000

> redundant, contains information that is not available anywhere else.

OK, I've now written up a proposal for this which would support
everything I'd find useful. It's available at

  http://www.tartarus.org/~simon/ssh/draft-sftp-userdb-00.txt

It defines an SFTP extension, in a namespace I own, so obviously I
_could_ just start privately lobbying SSH implementors to add
support for it. I thought I'd expose it to the working group's
combined wisdom before doing that though :-)

(It supports only the user database fields that are actually useful:
username, default group, home directory. I considered adding the
rest of the Unix password file fields, such as full name and shell,
but on balance I thought it would bloat the specification
needlessly.)

Cheers,
Simon
-- 
Simon Tatham         "The voices in my head are trying to ignore me.
<[email-masked]>    But if I keep talking, I can drive them insane."