summaryrefslogtreecommitdiffstats
path: root/util.cxx
Commit message (Collapse)AuthorAgeFilesLines
* PR11105 part 2: tighten constraints on stap-server parameters passed to makeFrank Ch. Eigler2010-02-121-1/+35
| | | | | | | * util.h, util.cxx (assert_match_regexp): New function. * main.cxx (main): Constrain -R, -r, -a, -D, -S, -q, -B flags. * stap-serverd (listen): Harden stap-server-connect with ulimit/loop. * testsuite/systemtap.server/{client,server}_args.exp: Revised.
* Add .library("lib").mark("mark") and use it for .mark semaphores.Stan Cox2009-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | tapset-utrace.cxx (TOK_LIBRARY): New. (utrace_derived_probe::utrace_derived_probe): Add library and has_library. (utrace_builder::build): Handle library. (utrace_derived_probe_group::emit_probe_decl): Add sdt_sem_offset to emitted stap_utrace_probes. Add stap_task_finder_target mmap_callback for handling shared library. Handle sdt_sem_offset in emitted_stp_utrace_probe_cb. Add stap_utrace_mmap_found. (register_tapset_utrace): Handle .library tapset-utrace.cxx (TOK_LIBRARY): New. (base_query::base_query): Add path and has_library. (dwarf_derived_probe::dwarf_derived_probe) Likewise. (dwarf_derived_probe::register_patterns): Handle .library (sdt_query::convert_location): Likewise. (dwarf_builder::build): Likewise. (uprobe_derived_probe_group::emit_module_decls): Emit sdt_sem_address. Add sdt_sem_offset to emitted stap_uprobe_spec. Add offset and vm_flags to signature of stap_uprobe_change_plus, and handle sdt_sem_offset. Allow writeable segments in emitted stap_uprobe_mmap_found. sdt_misc.exp: Test .library util.cxx (find_executable): Add env_path to sig and use it in getenv. util.h (find_executable): Likewise. Make "PATH" the default. dtrace.in (provider): Turn on semaphores. sdt.h: Likewise.
* Fix compilation warning of passing NULL to int parameterWenji Huang2009-11-261-1/+1
| | | | * util.cxx (in_group_id): Replace NULL with 0.
* Fix compilation error, use getgroups without fixed limits.Roland McGrath2009-11-251-16/+15
| | | | * util.cxx (in_group_id): Don't use NGROUPS_MAX.
* - Allow root, the owner of the uprobes build directory and the members of theDave Brolley2009-11-251-14/+3
| | | | | | | | | | group owner of the uprobes buld directory to build uprobes.ko. - When building uprobes.ko, make all generated files writable by the group owner of the uprobes build directory. - Don't change the group owner of the uprobes build directory during 'make install'
* Ensure uprobes/Makefile never returns failure due to setting permissions.Dave Brolley2009-11-231-1/+1
| | | | | Ensure uprobes install directory has group 'stap-server'. Rename igid_in to in_group.
* Allow members of the group stap-server to build the uprobes module.Dave Brolley2009-11-201-0/+43
|
* Simplify copy_file callsJosh Stone2009-09-281-11/+19
| | | | | | | | | | | | | | Every single copy_file call we had was converting strings to char*, printing the same error message, and optionally printing the same verbose string. Let's canonicalize that. * util.cxx (copy_file): Take string filenames, add a verbose flag, and consolidate the message printing. * cache.cxx (add_to_cache): Pass strings and remove message printing. (get_from_cache): Ditto. * main.cxx (main): Ditto. * tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto. (dwarf_cast_expanding_visitor::filter_special_modules): Ditto.
* PR10544: clean up stap child process error handlingFrank Ch. Eigler2009-08-211-8/+27
| | | | | | | * util.cxx (stap_system): Take extra verbosity value. Standardize error handling / tracing. * util.h: Corresponding changes. * buildrun.cxx, main.cxx, modsign.cxx: Update callers.
* Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-08-041-0/+4
|\ | | | | | | | | | | Conflicts: cache.cxx
| * PR10204: Place userspace markers in systemtap itselfKent Sebastian2009-07-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | * cache.cxx (add_to_cache,clean_cache): add static markers * main.cxx (main): likewise * runtime/staprun/common.c (send_request): likewise * runtime/staprun/mainloop.c (stp_main_loop): likewise * runtime/staprun/staprun.c (remove_module): likewise * runtime/staprun/staprun.h: include sdt.h * runtime/staprun/staprun_funcs.c (insert_module): likewise * util.cxx (stap_system): likewise * tapset/stap_staticmarkers.stp: new file
| * Module signing and verification using a separate file for the module signature.Dave Brolley2009-05-041-1/+20
| |
* | Only sign modules if --unprivileged is specified.Dave Brolley2009-06-111-0/+24
| | | | | | | | | | | | Don't generate an error message for unsigned modules. Make sure module signature exists before attempting to copy to the cache. Allow timer p[robes for unprivileged users.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-04-021-4/+37
|\| | | | | | | | | | | Conflicts: configure
| * PR10016: Purge stap of all pgrp and system() usageJosh Stone2009-04-011-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We hereby no longer try to manipulate process groups in any way. We don't set a private process group, and we never kill() our entire group either. Instead of using system(), we now have a stap_system() which saves the child PID, so when we get a terminating signal we can pass it along to the child. Signals sent through the TTY have always worked, since the TTY sends it to the entire pgrp. However, if we're running as part of a wrapper script or GUI, which may not have a separate process group for stap, we still would like to allow "kill -TERM $STAPPID" to terminate stap nicely. There's still a short window of failure in the time that staprun is active, because we can't kill a setuid process from a user process. Once staprun drops privileges and execs to stapio though, everything should work fine.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-03-261-0/+27
|\|
| * Add the kernel tree's git revision to the hashJosh Stone2009-03-251-0/+27
| | | | | | | | | | To better support kernel developers who work out of a single source tree, this adds the git HEAD revision to our caching hash.
* | 2009-03-12 Dave Brolley <brolley@redhat.com>Dave Brolley2009-03-121-1/+20
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * util.cxx (remove_file_or_dir): New function. * util.h (remove_file_or_dir): New function. * systemtap.spec (stap): Add stap-env, stap-gen-cert, stap-authorize-cert, and stap-authorize-signing-cert. (stap-client): Remove stap-find-or-start-server, stap-add-server-cert. Add stap-authorize-server-cert. (stap-server): Add stap-find-servers, stap-find-or-start-server, stap-authorize-server-cert. Remove stap-gen-server-cert. * stap-find-servers: Source stap-env. Use $stap_avahi_service_tag. (initialization): Set timeout to 10. (find_servers): Run avahi-browse in the background and wait for it. Use a temp file for the output of avahi-browse. Kill avahi-browse if the timeout expires. (match_server): Set read timeout. (fatal): New function. * stap-find-or-start-server: Source stap-env. Use $stap_exec_prefix. Always exit with 0. * stap-start-server: Source stap-env. Check for the server PID as a running process and for avahi-publish-service running as a child in order to verify that the server is ready. * stap-add-server-cert: Renamed to stap-authorize-server-cert. Source stap-env. Call stap-authorize-cert. * stap-client: Source stap-env. Use $stap_user_ssl_db and $stap_root_ssl_db. Use $stap_tmpdir_prefix_client, $stap_tmpdir_prefix_server. Use $stap_exec_prefix. (configuration): Removed. (staprun_running): Removed. (interrupt): Don't kill staprun. * stap-server: Source stap-env. Use $stap_user_ssl_db and $stap_root_ssl_db. Use $stap_tmpdir_prefix_client, $stap_tmpdir_prefix_server. Use $stap_exec_prefix. (configuration): Removed. * session.h (systemtap_session): Add cert_db_path. * runtime/staprun/staprun_funcs.c (config.h): #include it. (modverify.h): #include it. (check_signature): New function. (check_groups): New function extracted from check_permissions. (check_permissions): Call check_groups and check_signature. * runtime/staprun/mainloop.c (cleanup_and_exit): Pass modpath to staprun, not modname. * main.cxx (main): Initialize cert_db_path. Handle LONG_OPT_SIGN_MODULE. Save the module signature if the module was signed and is being saved. (LONG_OPT_SIGN_MODULE): #define it. (long_options): Add --sign-module. * cache.cxx (config.h): #include it. (add_to_cache): Add the module signature file to the cache if the module has been signed. * buildrun.cxx (modsign.h): #include it. (compile_pass): Call sign_module, if requested. * configure.ac: Define HAVE_NSS if NSS libraries are available. * Makefile.am (AM_CPPFLAGS): Add -DSYSCONFDIR. (bin_SCRIPTS): Add stap-env, stap-gen-cert, stap-authorize-cert, stap-authorize-signing-cert, stap-authorize-server-cert. Remove stap-gen-server-cert, stap-add-server-cert. (stap_SOURCES): Add nsscommon.c, modsign.cxx (stap_CPPFLAGS): Add $(nss_CFLAGS), $(nspr_CFLAGS). (stap_LDADD): Add -lnss3. (staprun_SOURCES): Add nsscommon.c. * modsign.cxx: New file. * modsign.h: New file. * nsscommon.c: New file. * nsscommon.h: New file. * runtime/staprun/modverify.c: New file. * runtime/staprun/modverify.h: New file. * stap-authorize-cert: New file. * stap-authorize-signing-cert: New file. * stap-env: New file. * Makefile.in: Regenerated. * aclocal.m4: Regenerated. * config.in: Regenerated. * configure: Regenerated. * doc/Makefile.in: Regenerated. * doc/SystemTap_Tapset_Reference/Makefile.in: Regenerated. * testsuite/Makefile.in: Regenerated. * testsuite/aclocal.m4: Regenerated.
* Add Vim modelines for GNU style in stapJosh Stone2009-01-281-0/+1
|
* add #include <stdio.h> for more reported gcc 4.4 compatibilityFrank Ch. Eigler2008-11-121-0/+1
|
* Merge commit 'origin/master' into pr4225Frank Ch. Eigler2008-08-281-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'origin/master': PR5686: correct regression in semok/optimize.stp trailing whitespace removal, as approved by emacs fix global-var array index rendering fix NEWS to refer to simpler context.stp tapset functions in auto-printing blurb Document written but unread global variable automatic display. 2nd try initial Make _get_sock_addr return correct address in kernel before 2.6.16. Automatically print written but unread globals Make nodwf test passed when CONFIG_QUOTACTL unset Uses STAPCONF_DPATH_PATH instead of a kernel version check. Simplified "rpm" target a bit. Moved tar archive creation step from "rpm" target to "dist-gzip" target. remove support for "make dist" since git-archive does as well; Examples html files moved into subdir. 2008-08-25 David Smith <dsmith@redhat.com> ChangeLog Entries Robustness improvements for the stap client/server
| * trailing whitespace removal, as approved by emacsFrank Ch. Eigler2008-08-281-3/+3
| | | | | | | | (add-hook 'before-save-hook 'delete-trailing-whitespace)
* | PR4225 and PR6826: expand & canonicalize executable path names process probesFrank Ch. Eigler2008-08-091-8/+19
| |
* | prep find_executable() for use by process() probesFrank Ch. Eigler2008-08-091-34/+42
|/
* 2007-08-20 Martin Hunt <hunt@redhat.com>hunt2007-08-201-0/+31
| | | | | | | | | PR2424 From Lai Jiangshan <laijs@cn.fujitsu.com> * util.cxx (cmdstr_quoted): New. Properly quote command string. * buildrun.cxx (run_pass): Call cmdstr_quoted().
* 2006-10-23 David Smith <dsmith@redhat.com>dsmith2006-10-231-0/+199
* main.cxx (printscript): New function containing code moved from main(). (main): Added code to create cache directory, call function to generate hash, and see if we can use cached source/module. If pass 4 is actually run to produce a new module, we call add_to_cache() to cache the result. * session.h (struct systemtap_session): Added hash/cache session data. * cache.cxx: New file handling adding/getting files from the cache. * cache.h: New header file for cache.cxx. * hash.cxx: New file containing C++ wrapper for routines in mdfour.c and the find_hash function which computes the hash file name for an input script. * hash.h: New header file for hash.cxx. * mdfour.c: New file containing MD4 hash code. * mdfour.h: New header file for mdfour.c. * util.cxx: New file containing several utility functions used by the caching code. * util.h: New header file for util.cxx. * Makefile.am: Added new C/C++ files. * Makefile.in: Regenerated.