LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-01-2004, 03:27 PM   #1
ming0
Member
 
Registered: Jul 2003
Location: Boston
Distribution: Ubuntu: Warty & Hoary
Posts: 113

Rep: Reputation: 16
Need a command so that non-root user can see interfaces that are up/down


I am working on a little laptop widget, and I need to figure out a script that will allow a non-root user to be able to get a list of ethernet interfaces that are up/down

When I try /sbin/ifconfig, all I get is a pile of giberish

(and someone suggested the "ip" command, but I don't seem to have that)


you can see what I am working on here:

http://www.kde-look.org/content/show.php?content=10460


Thanks,

Dean
 
Old 02-01-2004, 06:49 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
Could you please post that gibberish here?
It works just fine on all Linux-installations I've
ever laid hands on ...


Cheers,
Tink
 
Old 02-02-2004, 06:19 AM   #3
ming0
Member
 
Registered: Jul 2003
Location: Boston
Distribution: Ubuntu: Warty & Hoary
Posts: 113

Original Poster
Rep: Reputation: 16
tomorrow I will try the same command on a machine that I haven't messed with as much (which is also slack 9.1).

as non-root: (from konsole in KDE on SW 9.1) (root output is at the bottom of the page)

dean@dimtop:~$ cat /sbin/ifconfig
ELF4H4 (___8
( Ptd```,,/lib/ld-linux.so.2GNUCH5BG.9C?):!";A%7FE?6
/ @D8,#

&(* $+0'<432>18mg?q?Xq4f6
RA:sxfgd4XA!'kE"ԯH6RrD)K96}LWI;9(4CU4?<lT5c 4q9ң 0libc.so.6putcharstrcpyioctlgetserventsetserventstrerrorinet_ptonsnprintf__strtol_internalfscanffget sperrormallocgethostbyaddrsocket__strtoul_internalfreeaddrinfoabortendprotoentgetnameinfogetnetbyadd runamestrrchrcallocsetprotoentfprintfstrcatgetprotoentferrorstrstrstrncmpstrncpystrcasecmprealloc__s trdupsscanfinet_atonindexmemsetinet_ntoaherrorstrcmp__h_errno_locationgethostbynamesprintffclosesetl ocalestderrfputc__ctype_b_locgetaddrinfofwriteaccessgettextgetnetbyname__errno_locationexitbindtextd omaininet_ntopfopen__ctype_toupper_locendservent_IO_stdin_used__libc_start_mainstrlenstrchrfree__gmo n_start_F?QC_Q1GLIBC_2.0ii
Q
Q
RRQ
? ?$(048< @!D"H#L$P%T&X'\(`)d*h+l,p-t.x/|012345678_9:;<=>@ABCDEGUK5%%h%%h%h?%h _%h(%h0%h8p%h@`%hHP%hP@%hX0%h` %hh%hp%hx%hh%
h%h%h__%?h%h% hp%$h`%(hP%,h@%0h0%4h %8h%<h%@h%Dh%H%Lh%Ph?%Th _%Xh(%\h0%`h8p%dh@`%hhHP%lhP@%phX0%th` %xhh%|hp%hx%h%h%h%h%h__%h%h%_hp% h`%hP%h@%h0%h %h%h%h%h%%h%h?1^PTRhhQVhUSP[Zt]U=u-tҡuU塴tt
h]UVSu_t;
SH$Vx

Vhe[^]v'hhHv'
h
$UWVS0jV]S}
Ew
QxIQjVSw
Sh Rf }~x
1e[^_]
hZPPVPhW^_PSXƴ&'UWVS4j:P}

j"ëVjQuVWv
VhSxQPjPV4v
VhSf!}x
1e[^_]
hv'8ZWPVShdZYPPf
>t&Uh(ZYPP*$ZYPP$ZYPP$ZYPP$ZYPP$ ZYPP$`ZYPP$_rZYPPt$XZYPPZ$>ZYPP@$$ZY PP&$

ZYPP
ZYPP$ZYPP$ ZYPP$?(
hh`ZYPP$_uZYPPw$!$&U塰PPhP6$U
UM
ABAA?B
AQhQx1]@ZP
PhP϶UWVSLhXZh$6E
KtE
<-
jj RjE
P(V]r)
PqtB, ';au{ru{pu{t&ktɬRquBh@(R ĵCe[^_]t&jj
PP8|td1't5vPPCuƵtttpP(Rhp PxGDP(Rhq P

h
hZYPPʽC.J޿ S޿
4޿ ޿
޿
޿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-t
xVuxt- t
u
7"8-u
x?uxtB:-u
zhuzt+tu
PE
Q'UVS4jVuV]6Y
V]]]
EQEEEEEee[^H]ö'UWVS?V}
61xtPG
PPS1uYj:StC8t>@Att&<-t,Bujj

---------------------------------------------------------------------------------------------------------
cut for brevity
---------------------------------------------------------------------------------------------------------




?Ufhf}
WU$j/Wktjj
j@P ?t
Ww9v5
/hq[^PhǸe[^_]QFPWURM
h븶Ut#hPhP]öPhhvUS]
SPjxf1]]UWVShh4_
hIs$[$d_$G
VhSrt&PVhW[j
Stjj
jP
kv*t"
PRBPSh vPhZ
V1e[^_]
hr$ZURj1jhPj1jh@]ô&UWVS]wPhV
hP
PVjxM?
dv'dt9d8dxexvxvPPdnA?v' !tu)9v8
hk^_PSle[^_]Qjjj xxtNQh
Px
Q}1_
h}^S}Rh
Py
h
h}PSPh,$+6Cb
UM V|
Ut\@u4:tt?UM
]']&Pj,jhD״&Rj+jhU%Phj@h~]t&UWVS
U
ffUEu1
[^_]'E&MfPGfZж7fPGftAB C<w@EEZOC<wZ?U1BP1BP1BP1BP1BP1Phwj@h@k}@]v'UWVS
U
ffUEu1
[^_]'C~E&MfPGfZж7~fPftRB tGE?@EE<:Gt&'F<w~lBt&F<w Bt&:tuezǸ
'C<w Z/C<wZUPhRj
h{]UjEPMQU
UWV0U} RP]
EEEEEEUu}9vXuUEEM?tUUEM?EUQUMUMEU0^_E9Ev8U?EEtuEUE?MH hv'EuUU9UM9Mr<UE+EEEUE?E?EUEUEԸ )EUEM eUMU}EM u}UEee;UwF;Ut<E?EME)MME EU;EvM+}UEPEPMQU
RPEU]ô&UWV0U}
EEEEEEUu}9vXuUEEM?tUUE9Ev8U?EEtuEUE?MHhv'EuUU9UM9M r<UE+EEEUE?E?EUEUEԸ )EUEM eUMU}EM u}UEee;UwF;Ut<E?EME)MME EU;EvM+}UVS1t-9sC9r[^]U-]Xu
]]HKuUSRt?uX[]USR[^7?x]net-tools 1.60ifconfig 1.42 (2001-04-13)SIOCSIFFLAGS%s: unknown interface: %s
[multicast] [[-]promisc]
[txqueuelen <NN>]
[[-]dynamic]
[up|down] ...

<HW>=Hardware Type.
inet%s
%s
SIOCSIFNETMASK: %s
/usr/share/localenet-tools-arpmediaportautoport: SIOCSIFMAPport: SIOCGIFMAPUnknown media type.
-trailers-promisc-multicast-allmultidown-dynamicmetricSIOCSIFMETRIC: %s
SIOCSIFMTU: %s
keepaliveSIOCSKEEPALIVE: %s
outfillSIOCSOUTFILL: %s
-broadcastSIOCSIFBRDADDR: %s
dstaddrSIOCSIFDSTADDR: %s
netmasktxqueuelenSIOCSIFTXQLEN: %s
mem_startmem_start: SIOCSIFMAP: %s
mem_start: SIOCGIFMAP: %s
io_addrio_addr: SIOCSIFMAP: %s
io_addr: SIOCGIFMAP: %s
irq: SIOCSIFMAP: %s
irq: SIOCGIFMAP: %s
-pointopointSIOCSIFHWADDR: %s
%s: invalid %s address.
SIOCSIFADDRSIOGIFINDEXInterface %s not initialized
SIOCDIFADDR: %s
tunnelsocket--version--help%s:%dIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
No support for INET on this system.
Usage:
ifconfig [-a] [-i] [-v] [-s] <interface> [[<AF>] <address>]
[add <address>[/<prefixlen>]]
[del <address>[/<prefixlen>]]
[[-]broadcast [<address>]] [[-]pointopoint [<address>]]
[netmask <address>] [dstaddr <address>] [tunnel <address>]
[outfill <NN>] [keepalive <NN>]
[hw <HW> <address>] [metric <NN>] [mtu <NN>]
[[-]trailers] [[-]arp] [[-]allmulti]
[mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]
List of possible hardware types:
<AF>=Address family. Default: %s
List of possible address families:
hw address type `%s' has no handler to set address. failed.
No support for INET6 on this system.
Don't know how to set addresses for family %d.
ifconfig: `--help' gives usage information.
ifconfig: Cannot set address for this protocol family.
ifconfig: option `%s' not recognised.
ddpnetromtcpipeconetashUNSPECUNIX DomainDARPA InternetIPv6AMPR AX.25AMPR NET/ROMNovell IPXAppletalk DDPCCITT X.25Unknown address family `%s'.
,
%s (%s) ..Please don't supply more than one address family.
Too much address family arguments.
-%d[NONE SET]Callsign too longInvalid callsign%s: %s
/proc/net/ax25%d/%d/proc/net/appletalkLocal LoopbackVJ Serial Line IPVJ 6-bit Serial Line IPAdaptive Serial Line IPEthernetgeneric X.25IPIP TunnelPoint-to-Point ProtocolARCnetFrame Relay DLCIFrame Relay Access DeviceIrLAP16/4 Mbps Token Ring16/4 Mbps Token Ring (New)default*netstatgetaddrinfo: %s: %d
getnameinfo failed
[UNKNOWN]/proc/net/if_inet6/proc/net/ipv6_routeKernel IPv6 routing table
%s:%s:%s:%s:%s:%s:%s:%sAHG/proc/net/ndiscKernel IPv6 Neighbour Cache
UNKNOWN(%02x) %-9ld * %-7ld INCOMPLETEFAILEDND Tablend_printDestination Next Hop Flags Metric Ref Use Iface
%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %s
%-43s %-39s %-5s %-6d %-2d %7d %-8s
INET6 (IPv6) not configured in this system.
Neighbour HW Address Iface Flags Ref State Stale(sec) Delete(sec)
%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %08lx %08lx %08lx %04x %04x %04lx %8s %2s%2s%2s%2s%2s%2s
%-43s %-17s %-8s %-5s %-3d %-16sNeighbour HW Address Iface Flags Ref State
%s: no support for `%s' on this system.
Usage: inet6_route [-vF] del Target
inet6_route [-vF] add Target [gw Gw] [metric M] [[dev] If]
inet6_route [-FC] flush NOT supported
Flushing `inet6' routing table not supported
NONESIOCADDRTSIOCDELRTgatewaydeviceunknown10base2bnccoax10baseTutptpeAUIthickdb15100baseT100baseTX10 0baseFXSIOCGIFCONFcompressedbytes/proc/net/devDevice not found%-5.5s %5d %3d%8llu %6lu %6lu %6lu%8llu %6lu %6lu %6lu [NO FLAGS]%-56s%-9.9s Link encap:%s inet6 addr: %s/%d Scope:UnknownHostGlobalCompatSiteLink MTU:%d Metric:%d Outfill:%d Keepalive:%dDMA chan:%x Memory:%lx-%lx Base address:0x%x Interrupt:%d collisions:%lu txqueuelen:%d
compressed:%lu compressed:%lu
DYNAMIC MULTICAST MASTER SLAVE ALLMULTI PROMISC NOARP RUNNING NOTRAILERS POINTOPOINT LOOPBACK DEBUG BROADCAST UP [NO FLAGS] %s addr:%s Mask:%s
Bcast:%s P-t-P:%s Media:%s(auto)HWaddr %s warning: no inet socket available: %s
%llu %lu %lu %lu %lu %llu %lu %lu %lu %lu %lu%llu %llu %lu %lu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %lu %lu%llu %llu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %luWarning: cannot open %s (%s). Limited output.
%s: error fetching interface information: %s
- no statistics available -%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s
RX packets:%llu errors:%lu dropped:%lu overruns:%lu frame:%lu
TX packets:%llu errors:%lu dropped:%lu overruns:%lu carrier:%lu
RX bytes:%llu (%lu.%lu %s) TX bytes:%llu (%lu.%lu %s)
EtherTalk Phase 2 addr:%s
IPX/Ethernet 802.3 addr:%s
IPX/Ethernet 802.2 addr:%s
IPX/Ethernet SNAP addr:%s
IPX/Ethernet II addr:%s
b%02X%02X%02X%02X%02X%02X%08lX/proc/net/ipx%08lX:%02X%02X%02X%02X%02X%02X%02x:%02x:%02x:%02xirda%02X-unspecloop/proc/net/nrYou cannot start PPP with this program.
pppcslipcslip6adaptiveNo usable address families found.
/proc/net%02x-%02x%02x-%02x%02xSTRIP_set_disc(%d): %s
stripMetricom Starmode IP%02X:%02X:%02X:%02X:%02X:%02Xtr/proc/net/unixout of virtual memory
%d.%d.%dInvalid address/proc/net/x25Address can't exceed eighteen digits with sigdigits/proc/net/x25_routesKernel X.25 routing table
Destination Iface
%s/%*d %-5s
* %-5s
X.25 not configured in this system.
Usage: x25_route [-v] del Target[/mask] [dev] If
x25_route [-v] add Target[/mask] [dev] If
route: netmask doesn't match route address
Modifying `x25' routing cache not supported
Flushing `x25' routing table not supported
route: bogus netmask %d
arcnetether%idlcifrad??( X3
88GKKE
[
&
GGRX___@@ `` @G`__@` _`__@@ p
&
_ ,
?$)2<8``.|K`K`\`` p _3 $

$
@

P

ELUZzR|
,E.DD.
G.DD.)BH.A.L*B
E D.D.N.A.*B
P|

GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3GCC: (GNU) 3.2.3.shstrtab.interp.note.ABI-tag.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.eh_frame_hdr. data.eh_frame.dynamic.ctors.dtors.jcr.got.bss.comment
( !H4'
|/7o
DoP
@S
\ _

Pk0 qPP ``,__ _ zdean@dimtop:~$


as root:

dean@dimtop:~$ su
Password:
root@dimtop:/home/dean# ifconfig
eth1 Link encap:Ethernet HWaddr 00:05:5D:A6E:81
inet addr:192.168.0.199 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:368 errors:0 dropped:0 overruns:0 frame:0
TX packets:208 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:190302 (185.8 Kb) TX bytes:33205 (32.4 Kb)
Interrupt:10 Base address:0x100

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
 
Old 02-02-2004, 08:14 AM   #4
dopefish
Member
 
Registered: Nov 2003
Location: Northcliffe, WA
Distribution: Slackware 12.0
Posts: 481

Rep: Reputation: 30
/sbin/ifconfig works fine on my slack 9.1 install

i tried viewing the executable through less and get a similar output its obviously reading the file rather than executing it. Wouldnt know why tho
 
Old 02-02-2004, 12:30 PM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,902

Rep: Reputation: 589Reputation: 589Reputation: 589Reputation: 589Reputation: 589Reputation: 589
Why cat? this is just showing the binary code of ifconfig. just do /sbin/ifconfig without cat.
The permissions for ifconfig are -rxwr-xr-x so it's executable by users without doing anything.
 
Old 02-02-2004, 06:49 PM   #6
ming0
Member
 
Registered: Jul 2003
Location: Boston
Distribution: Ubuntu: Warty & Hoary
Posts: 113

Original Poster
Rep: Reputation: 16
ugg I feel like a dope--that is the second stupid mistake I have recently made (that I have posted here--there are many that have gone unpublished)

Thanks for catching my stupidity
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
root user has command start_fish_server b_s Linux - Security 4 06-09-2005 04:28 AM
root permissons to user command line chaitu_iiit Linux - Software 7 11-09-2004 07:54 AM
KDE command work as user, not root. mooreted Slackware 6 04-08-2004 03:21 PM
changing to root user without command line kaega2 Linux - Software 3 11-28-2003 04:14 PM
Is their a way to run a command as root..or another user.. in php BaerRS Programming 2 04-25-2002 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration