Configuring NETSNMP_TEMP_FILE_PATTERN

This is a discussion on Configuring NETSNMP_TEMP_FILE_PATTERN within the SNMP Coders forums, part of the Networking and Network Related category; Is there any way, how to modify NETSNMP_TEMP_FILE_PATTERN without patching net-snmp-config.h.in? Like some well-hidden argument ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-23-2008
Jan Safranek
 
Posts: n/a
Default Configuring NETSNMP_TEMP_FILE_PATTERN

Is there any way, how to modify NETSNMP_TEMP_FILE_PATTERN without
patching net-snmp-config.h.in? Like some well-hidden argument to
../configure or so? I don't like snmptrapd putting files into /tmp
(resp. SELinux does not like it, see
http://danwalsh.livejournal.com/11467.html).

Jan

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.p...r_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

Reply With Quote
  #2 (permalink)  
Old 07-23-2008
Thomas Anders
 
Posts: n/a
Default Re: Configuring NETSNMP_TEMP_FILE_PATTERN

Jan Safranek schrieb:
> Is there any way, how to modify NETSNMP_TEMP_FILE_PATTERN without
> patching net-snmp-config.h.in? Like some well-hidden argument to
> ./configure or so? I don't like snmptrapd putting files into /tmp
> (resp. SELinux does not like it, see
> http://danwalsh.livejournal.com/11467.html).


The generic approach through configure is something like:

./configure --with-cflags=-DNETSNMP_TEMP_FILE_PATTERN=xxx

Not sexy, but powerful. :-)


+Thomas

--
Thomas Anders (thomas.anders at blue-cable.de)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.p...r_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

Reply With Quote
  #3 (permalink)  
Old 07-23-2008
Jan Safranek
 
Posts: n/a
Default Re: Configuring NETSNMP_TEMP_FILE_PATTERN

Thomas Anders wrote:
> Jan Safranek schrieb:
>> Is there any way, how to modify NETSNMP_TEMP_FILE_PATTERN without
>> patching net-snmp-config.h.in? Like some well-hidden argument to
>> ./configure or so? I don't like snmptrapd putting files into /tmp
>> (resp. SELinux does not like it, see
>> http://danwalsh.livejournal.com/11467.html).

>
> The generic approach through configure is something like:
>
> ./configure --with-cflags=-DNETSNMP_TEMP_FILE_PATTERN=xxx
>
> Not sexy, but powerful. :-)


I've already tried this, but snmptrapd still creates files in /tmp. And
if I patch the net-snmp-config.h.in manually, it creates it wherever I want.

There should be some #ifndef NETSNMP_TEMP_FILE_PATTERN in the .h file to
make it working...

Jan

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.p...r_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

Reply With Quote
  #4 (permalink)  
Old 07-23-2008
Thomas Anders
 
Posts: n/a
Default Re: Configuring NETSNMP_TEMP_FILE_PATTERN

Jan Safranek wrote:
> I've already tried this, but snmptrapd still creates files in /tmp. And
> if I patch the net-snmp-config.h.in manually, it creates it wherever I
> want.
>
> There should be some #ifndef NETSNMP_TEMP_FILE_PATTERN in the .h file to
> make it working...


You're right. I've realized it myself shortly after hitting 'Send'.
The "--with-cflags=-D..." approach doesn't work for settings that are unconditionally defined in net-snmp-config.h, unfortunately. I agree there should be a way other than hacking net-snmp-config.h, though.


+Thomas

--
Thomas Anders (thomas.anders at blue-cable.de)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.p...r_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

Reply With Quote
  #5 (permalink)  
Old 07-24-2008
Jan Safranek
 
Posts: n/a
Default Re: Configuring NETSNMP_TEMP_FILE_PATTERN

Thomas Anders wrote:
> Jan Safranek wrote:
>> I've already tried this, but snmptrapd still creates files in /tmp. And
>> if I patch the net-snmp-config.h.in manually, it creates it wherever I
>> want.
>>
>> There should be some #ifndef NETSNMP_TEMP_FILE_PATTERN in the .h file to
>> make it working...

>
> You're right. I've realized it myself shortly after hitting 'Send'.
> The "--with-cflags=-D..." approach doesn't work for settings that are unconditionally defined in net-snmp-config.h, unfortunately. I agree there should be a way other than hacking net-snmp-config.h, though.


I checked in to trunk (rev. 17121) new ./configure with
--with-temp-file-pattern option, which allows users to override the
default /tmp/snmpdXXXXXX.

Would anyone mind if I put it also to 5.4.x branch?

Jan

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.p...r_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

Reply With Quote
  #6 (permalink)  
Old 07-28-2008
Dave Shield
 
Posts: n/a
Default Re: Configuring NETSNMP_TEMP_FILE_PATTERN

2008/7/24 Jan Safranek <jsafrane@redhat.com>:
> I checked in to trunk (rev. 17121) new ./configure with
> --with-temp-file-pattern option, which allows users to override the
> default /tmp/snmpdXXXXXX.
>
> Would anyone mind if I put it also to 5.4.x branch?


Seems sensible.
I've applied this patch to the three active lines,
since it's a fairly harmless change.

Dave

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.p...r_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:14 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0