Visit Our UNIX and Linux User Community


Finger command not showing Office, Office Phone from /etc/passwd


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Finger command not showing Office, Office Phone from /etc/passwd
# 1  
Old 10-10-2009
Finger command not showing Office, Office Phone from /etc/passwd

Not sure if this is the best place to post, but at this point my question seems to be an advanced topic.

I'm curious why it is that the "office phone" column of finger does not seem to report anything even when data is entered in the GECOS field of /etc/passwd. I am using Ubuntu 8.10, kernel 2.6.27-11, finger version 'bsd-finger-0.17' compiled from source (available at http://us.archive.ubuntu.com/ubuntu/.../b/bsd-finger/). To the best of my knowledge, this is also the version of finger that ships with Ubuntu 8.10.

For a theoretical user:

User jpublic's entry from /etc/passwd:

Code:
jpublic:x:1000:1000:John,101,9999,555-1234:/home/jpublic:/bin/bash

Result of "finger" with no arguments:

Code:
Code:
jpublic> finger
Login     Name       Tty      Idle  Login Time   Office     Office Phone
jpublic   John      *pts/0          Oct  9 18:02 (localhost)

Result of "finger jpublic":

Code:
jpublic> finger jpublic
Login: jpublic                    Name: John
Directory: /home/jpublic                Shell: /bin/bash
Office: 101, x9999            Home Phone: 555-1234
On since Fri Oct  9 18:02 (EDT) on pts/0 from localhost (messages off)
No mail.
No Plan.

Comparing the output of 'finger' with 'finger jpublic', there are a couple differences which interest me:

1. The Office Phone shows in 'finger public', and not in 'finger' with no arguments.

2. The Office column in the 'finger' command shows where the user is logged in from (in this example, I had used telnet to connect to localhost). The Office entry in the 'finger jpublic' command displays sections 2 and 3 of the GECOS field in /etc/passwd.

I have attempted to follow through the source code of bsd-finger-0.17, but have made a poor job of it as I am not very c-savvy. There was a commented warning about how some gecos information may not display properly from distribution to distribution, but another part of code seems to clearly extract four sections out of the gecos field (function starting on line 83 of util.c). Even so, I'm not sure if this is intended to be used in the output of the command when it has no parameters ('finger') or rather when it has a username passed as a parameter (e.g., 'finger jpublic').

Here is the comment from finger.c:

Code:
* Finger prints out information about users.  It is not portable since
 * certain fields (e.g. the full user name, office, and phone numbers) are
 * extracted from the gecos field of the passwd file which other UNIXes
 * may not have or may use for other things. (This is not really true any
 * more, btw.)

Could this comment be applicable? Being a BSD version of finger, would there be some Ubuntu/Debian specific change necessary to have the office phone show up properly?

Am I just doing something wrong?

Thanks for the help.
# 2  
Old 12-04-2009
I resolved this problem to my satisfaction. For others interested, see this thread:

Finger command not showing office phone from /etc/passwd - LinuxQuestions.org

Previous Thread | Next Thread
Test Your Knowledge in Computers #351
Difficulty: Medium
Unix was hatched in an unnamed PDP-7 operating system in 1969.
True or False?

8 More Discussions You Might Find Interesting

1. Red Hat

Open office recommendation

NEED recommendation and assistance on getting open office source installation on redhat 6 linux . I want an open office on redhat 6 linux server . Dont have root access Can someone guide me ? (0 Replies)
Discussion started by: ajayram_arya
0 Replies

2. Red Hat

error to openopen office

Hi I am receiving folowing error while running open office on redhat please guide how to resolve (I) x.org loaded video driver of... (II) Loading /usr/lib64/xorg/modules/drivers/intel_drv.so (==) Depth 24 pixmap format is 32 bpp (III) Desktop is: GNOME (IV) openoffice.org-kde... (1 Reply)
Discussion started by: manigrover
1 Replies

3. Linux

how to rectify the MS Office problem

Dear forum members, I was configured smb ldap in fedora core 6, past 1 year its running nice with out any problem. but last one week I can't able to save microsoft office application(excel) in server. server having a sufficient memory(2Gb RAM). this problem only for ms application. how can i... (4 Replies)
Discussion started by: erbalamurugan
4 Replies

4. Linux

MS Office for Linux..

Hi all, I have to install MS office on the Linux 9. As it is the essential part of my Internship. So I just want to know the following things: 1. Is it possible? 2. From where I can get the MS Ofiice for Linux 9. 3. From wher I can get the Documentation for Installing it. Thanks in... (2 Replies)
Discussion started by: aman_mlt
2 Replies

5. UNIX for Dummies Questions & Answers

Office

My first question is: Is there a version of Microsoft Office out for Unix? My second Question is: If there isn't a version of Microsoft Office for Unix, then can i get MS office for MAC OS X and install it on my sparc sytems? Im running solaris 8 and 10. (2 Replies)
Discussion started by: vikster007
2 Replies

6. UNIX for Dummies Questions & Answers

Office Apps for OpenBSD???

Im wondering what type of office applications are in OpenBSD 3.5? Like for example OpenOffice, Adobe, and things like that. (2 Replies)
Discussion started by: wardialer
2 Replies

7. HP-UX

Office tool for HP-UX 11.0 ?

Hi Experts, I am facing a problem in opening the office files like *.doc, *.ppt , *.xls etc in HP Unix. How do I do this? Is the software available , If yes is it freely available or Do I need to buy it ? (3 Replies)
Discussion started by: prasanna
3 Replies

8. UNIX for Dummies Questions & Answers

mailx - out of the office

I'm using the mailx client on Solaris to read my email. I would like to know if it is possible to create an "Out of the Office" reply to the sender of email while I'm on vacation??? (3 Replies)
Discussion started by: bigfish
3 Replies

Featured Tech Videos