C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-19-2009, 07:32 AM   #1
Registered User
 
Join Date: Oct 2006
Posts: 263
Equivalent to volume serial number in linux

I have a system whose server runs on linux and clients run on windows currently. I would very much like to port the client over to linux, but the current system uses MAC address, hostname, and volume serial number to authenticate stations. Is there an equivalent value in linux for volume serial number, or something else that is equally unique per-machine that would be useful for authentication, and could easily be hashed down to a 32-bit number? I've been searching google and this forum for over an hour and have found nothing useful. I found reference to an entry in /proc and another reference to using hdparm, but hdparm fails on my server, probably because it is for ide/ata drives, and the /proc entry does not exist on my server. I'm really hoping someone here knows something, because this is really holding me up in my efforts to develop a linux port of my client.
Elkvis is offline   Reply With Quote
Old 06-19-2009, 08:43 AM   #2
Registered User
 
Codeplug's Avatar
 
Join Date: Mar 2003
Posts: 3,844
There's "scsi_id" for non-ata drives...

gg
Codeplug is offline   Reply With Quote
Old 06-19-2009, 11:17 AM   #3
Senior software engineer
 
brewbuck's Avatar
 
Join Date: Mar 2007
Location: Portland, OR
Posts: 5,379
Is it really appropriate to authenticate clients with host characteristics? What sort of system is this where the user doesn't matter in the authentication process?
__________________
"Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot
brewbuck is online now   Reply With Quote
Old 06-19-2009, 01:53 PM   #4
Registered User
 
Join Date: Oct 2006
Posts: 263
Quote:
Originally Posted by brewbuck View Post
What sort of system is this where the user doesn't matter in the authentication process?
the user matters, but the station is also important. different stations have different devices (bill acceptors, receipt printers, credit card readers, etc.) installed, some of which require that a persistent state be stored on the server, which demands that the server be able to positively identify which station it is talking to.

as a workaround, I get the output of "uname -a" and hash it down to a 32-bit quantity and use that. it is not quite as unique as a volume serial number, but at least it doesn't change over time without a change of kernel.
Elkvis is offline   Reply With Quote
Old 06-19-2009, 04:07 PM   #5
Senior software engineer
 
brewbuck's Avatar
 
Join Date: Mar 2007
Location: Portland, OR
Posts: 5,379
Newer Linux distributions allow you to mount drive partitions by "volume ID" -- these IDs will be visible in the /etc/fstab file. You might try checking there.
__________________
"Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot
brewbuck is online now   Reply With Quote
Old 06-20-2009, 06:43 AM   #6
Registered User
 
Join Date: Oct 2006
Posts: 263
Quote:
Originally Posted by brewbuck View Post
Newer Linux distributions allow you to mount drive partitions by "volume ID" -- these IDs will be visible in the /etc/fstab file. You might try checking there.
no such luck in this case. can you think of any other data that I can readily get from the system that is as unique as a volume serial number, aside from hostname and MAC?
Elkvis is offline   Reply With Quote
Old 06-20-2009, 09:34 AM   #7
and the hat of vanishing
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,214
You could do several things when you first run the program, and store the results in a file somewhere.

- the 32-bit time of when the program was run.
- the 32-bit value composed of the pid() and parent pid() of the registration task.
- the 32-bit uptime at that moment.

Or just use a uuid generator
uuid_generate(3): create new unique UUID value - Linux man page
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Up to 8Mb PlusNet broadband from only £5.99 a month!
Salem is offline   Reply With Quote
Old 06-27-2009, 07:09 AM   #8
Registered User
 
Join Date: Dec 2006
Posts: 1,780
Code:
sudo vol_id --uuid /dev/sda1
?
cyberfish is offline   Reply With Quote
Old 06-30-2009, 08:46 PM   #9
Registered User
 
Join Date: Oct 2006
Posts: 263
Quote:
Originally Posted by cyberfish View Post
Code:
sudo vol_id --uuid /dev/sda1
?
I downloaded and installed the rpm package for that program, and it seems to work, and may be exactly what the doctor ordered.
Elkvis is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless Network Linux & C Testbed james457 Networking/Device Communication 3 06-11-2009 11:03 AM
Number Guessing blacknapalm C Programming 2 10-01-2008 01:48 AM
Linux serial port interrupts danga1993 Linux Programming 1 04-28-2007 11:15 AM
Linux equivalent of con dwks Linux Programming 3 11-12-2005 11:58 AM
Array of boolean DMaxJ C++ Programming 11 10-25-2001 11:45 PM


All times are GMT -6. The time now is 07:28 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22