Re: how to deceive programs as if I were a local user?

2009-04-25 Thread Kouichiro Iwao
On Thu, Apr 23, 2009 at 11:17:11AM -0700, Chris Cowart wrote:
 This error means the program tried to look up some name information for
 your UID number and failed. You need to configure the data source in
 /etc/nsswitch.conf:
 
 group: files cache ldap
 passwd: files cache ldap

I've already set like you showed.
But, not for /compat/linux/etc/nsswitch.conf .

Configuring nsswitch.conf in linux emulation environment,
the program worked properly.  I did't know I had to set 
/compat/linux/etc/nsswitch.conf for linux binary compatibility.

Thanks.
-- 
Iwao, Koichiro m...@club.kyutech.ac.jp
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: how to deceive programs as if I were a local user?

2009-04-25 Thread Ruben de Groot
On Sat, Apr 25, 2009 at 05:34:16PM +0900, Kouichiro Iwao typed:
 On Thu, Apr 23, 2009 at 11:17:11AM -0700, Chris Cowart wrote:
  This error means the program tried to look up some name information for
  your UID number and failed. You need to configure the data source in
  /etc/nsswitch.conf:
  
  group: files cache ldap
  passwd: files cache ldap
 
 I've already set like you showed.
 But, not for /compat/linux/etc/nsswitch.conf .
 
 Configuring nsswitch.conf in linux emulation environment,
 the program worked properly.  I did't know I had to set 
 /compat/linux/etc/nsswitch.conf for linux binary compatibility.

That's interesting. Was there a /compat/linux/etc/nsswitch.conf before?
I think that if it's not there, the linux emulation layer should take
the system's /etc/nsswitch.conf as default. But I might be wrong(TM).

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: how to deceive programs as if I were a local user?

2009-04-25 Thread Kouichiro Iwao
On Sat, Apr 25, 2009 at 11:22:22AM +0200, Ruben de Groot wrote:
  Configuring nsswitch.conf in linux emulation environment,
  the program worked properly.  I did't know I had to set 
  /compat/linux/etc/nsswitch.conf for linux binary compatibility.
 
 That's interesting. Was there a /compat/linux/etc/nsswitch.conf before?
 I think that if it's not there, the linux emulation layer should take
 the system's /etc/nsswitch.conf as default. But I might be wrong(TM).

What does TM mean? :-(

Yes. I didn't make /compat/linux/etc/nsswitch.conf but just modified
the file that had already existed. I also configured 
/compat/linux/etc/yp.conf and /compat/linux/etc/sysconfig/network to
use NIS.

I examined the linux emulator takes /compat/linux/etc/nsswitch.conf.

/etc/nsswitch.conf:
$ grep -v -e ^$ -e ^# /etc/nsswitch.conf 
group: compat
group_compat: nis
hosts: files dns
networks: files
passwd: compat
passwd_compat: nis
shells: files
services: compat
services_compat: nis
protocols: files
rpc: files

/compat/linux/etc/nsswitch.conf:
$ grep -v -e ^$ -e ^# /compat/linux/etc/nsswitch.conf
passwd: files nis
shadow: files nis
group:  files nis
hosts:  files dns
bootparams: nisplus [NOTFOUND=return] files
ethers: files
netmasks:   files
networks:   files
protocols:  files
rpc:files
services:   files
netgroup:   nisplus
publickey:  nisplus
automount:  files nisplus
aliases:files nisplus

And the sample program sample.c:
#includesys/types.h
#includestdio.h
#includepwd.h

int main(){
struct passwd *pw;
pw = getpwuid(getuid()); 
if(pw){
printf(success\n);
} else {
printf(error\n);
}  
}

I compiled the sample for both freebsd and linux binaries.
With the setting above I ran each binary, both binaries resulted success.

But when nis is not written in linux emulation environment's nsswitch.conf,
the linux binary results error.

-- 
Iwao, Koichiro m...@club.kyutech.ac.jp
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: how to deceive programs as if I were a local user?

2009-04-25 Thread Kouichiro Iwao
On Sat, Apr 25, 2009 at 11:22:22AM +0200, Ruben de Groot wrote:
 On Sat, Apr 25, 2009 at 05:34:16PM +0900, Kouichiro Iwao typed:
  On Thu, Apr 23, 2009 at 11:17:11AM -0700, Chris Cowart wrote:
   This error means the program tried to look up some name information for
   your UID number and failed. You need to configure the data source in
   /etc/nsswitch.conf:
   
   group: files cache ldap
   passwd: files cache ldap
  
  I've already set like you showed.
  But, not for /compat/linux/etc/nsswitch.conf .
  
  Configuring nsswitch.conf in linux emulation environment,
  the program worked properly.  I did't know I had to set 
  /compat/linux/etc/nsswitch.conf for linux binary compatibility.
 
 That's interesting. Was there a /compat/linux/etc/nsswitch.conf before?
 I think that if it's not there, the linux emulation layer should take
 the system's /etc/nsswitch.conf as default. But I might be wrong(TM).
 

Sorry, I misunderstood what you meant.

# cd /compat/linux/etc
# mv nsswitch.conf nsswitch.conf.dummy

And I ran the sample program, the linux binary resuled success.
The linux emulator seems to take the /etc/nsswitch.conf.

However, it is true that /compat/linux/etc/nsswitch.conf had already
existed when I was going to edit.

-- 
Iwao, Koichiro m...@club.kyutech.ac.jp
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: how to deceive programs as if I were a local user?

2009-04-23 Thread Ruben de Groot
On Thu, Apr 23, 2009 at 04:32:29PM +0900, Kouichiro Iwao typed:
 Hi.
 
 I'm going to connect to the remote server with nxclient.
 But, net/linux-nx-client does't work with non-local (NIS or LDAP) account.
 
 Connecting the remote server, nxclient says connection error and
 I found out that it caused by nxssh.
 
 If nxssh was executed by a NIS account, nxssh says,
 [m...@trueno ~]$ nxssh
 You don't exist, go away!
 
 How to deceive programs as if I were a user in /etc/master.passwd?

I don't know anything of nxssh, but it sounds like a pam issue.

Ruben
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: how to deceive programs as if I were a local user?

2009-04-23 Thread Chris Cowart
Ruben de Groot wrote:
 On Thu, Apr 23, 2009 at 04:32:29PM +0900, Kouichiro Iwao typed:
  Hi.
  
  I'm going to connect to the remote server with nxclient.
  But, net/linux-nx-client does't work with non-local (NIS or LDAP) account.
  
  Connecting the remote server, nxclient says connection error and
  I found out that it caused by nxssh.
  
  If nxssh was executed by a NIS account, nxssh says,
  [m...@trueno ~]$ nxssh
  You don't exist, go away!
  
  How to deceive programs as if I were a user in /etc/master.passwd?
 
 I don't know anything of nxssh, but it sounds like a pam issue.

This error means the program tried to look up some name information for
your UID number and failed. You need to configure the data source in
/etc/nsswitch.conf:

group: files cache ldap
passwd: files cache ldap

-- 
Chris Cowart
Network Technical Lead
Network  Infrastructure Services, RSSP-IT
UC Berkeley


pgpfcq6FgaN0i.pgp
Description: PGP signature