Administrivia P2 all grades available now Relative importance of scores M1: 30% M2: 30% Rollout: 40% P3 -- good progress so far! Looks like a lot of the.

Slides:



Advertisements
Similar presentations
ANT: Another Nice Tool Ali Beyad October 1, 2003.
Advertisements

ANT – Another Neat Tool Representation and Management of Data on the Internet.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
MC365 Ant. Today We Will Cover: Overview of Ant Installing Ant Using the Ant command line tool Various Ant commands available Using Ant in Eclipse.
Understanding Makefiles COMP 2400, Fall 2008 Prof. Chris GauthierDickey.
1 Ant – Another Neat Tool Representation and Management of Data on the Internet.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Java Development Tools project.
Linux+ Guide to Linux Certification, Second Edition
Winter 2005Jason Prideaux1 Apache ANT A platform independent build tool for Java programs.
Talking to Threads. Administriva Grade summary today.
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 9.
Oh what a tangled web we weave… … when first to thread we do conceive Lecture 24, Dec 08.
Race Conditions and Security. News o’ the day Java security flaws 3 bugs in Sun’s JRE Elevation of privilege, execution of arbitrary code, read/write.
Oh what a tangled web we weave when first to thread we do conceive.
Automating the Build Process using ANT SE-2030 Dr. Mark L. Hornick 1.
Introduction to Linux and Shell Scripting Jacob Chan.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
2007 Adobe Systems Incorporated. All Rights Reserved. 1 Joe Berkovitz VP Engineering Allurent, Inc. Continuous Integration with Flex, FlexUnit, and Ant.
Using Ant to build J2EE Applications Kumar
Introduction to ant Guy Rixon AstroGrid Consortium Meeting
Automating the Build Process using Ant SE-2030 Dr. Rob Hasker 1 Based on material by Dr. Mark L. Hornick.
July 29, 2003Serguei Mokhov, 1 Makefile Brief Reference COMP 229, 346, 444, 5201 Revision 1.2 Date: July 18, 2004.
Apache Ant Java-Based Build Tool. Making your builds boring… Building projects should be easy and standardized. You should not be spending a substantial.
2INC0 Operating Systems Introduction to Linux
Linux+ Guide to Linux Certification, Second Edition
Introduction Use of makefiles to manage the build process Declarative, imperative and relational rules Environment variables, phony targets, automatic.
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
Ant Build Tools.  Creating a product from source may take several steps: Compile Link Copy files to various directories Remove intermediate files Generate.
Scons Writing Solid Code Overview What is scons? scons Basics Other cools scons stuff Resources.
Distributed Java Programming Distributed Java Programming Setting up a Java Development Environment.
Ant Presentation by: Bart Taylor. What is Ant? The simple definition: A Java-based build tool The Official Definition: “Apache Ant is a Java-based build.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
Introduction Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Software Development COMP220/COMP285 Seb Coope Introducing Ant These slides are mainly based on “Java Development with Ant” - E. Hatcher & S.Loughran.
14th Oct 2005CERN AB Controls Development Process of Accelerator Controls Software G.Kruk L.Mestre, V.Paris, S.Oglaza, V. Baggiolini, E.Roux and Application.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
SCons: Big Signature Refactoring 18 April Build tools do TWO things Build things in the correct order NOT build what’s up to date.
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
Chapter Linux Basics. Acknowledgements This presentation was prepared by – Banyat Settapanich – Bahran Madaen This presentation will be updated later.
CSc 352 An Introduction to make Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 14 – Makefiles and Compilation Management.
SG Introduction to ANT scmGalaxy Author: Rajesh Kumar
Ant Presented by: Mindaugas Idzelis Tatum Krawczyk.
Multiple file project management & Makefile
The make utility (original presentation courtesy of Alark Joshi)
Large Program Management: Make; Ant
CSE 303 Lecture 17 Makefiles reading: Programming in C Ch. 15
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha Fall 2015
CSE 374 Programming Concepts & Tools
Department of Computer Engineering
C – Multi-file development and make
Makefile Tutorial CIS5027 Prof: Dr. Shu-Ching Chen
What is make? make is a system utility for managing the build process (compilation/linking/etc). There are various versions of make; these notes discuss.
Prof: Dr. Shu-Ching Chen TA: Yimin Yang
Prof: Dr. Shu-Ching Chen TA: Samira Pouyanfar Hector Cen Fall 2017
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
Large Program Management: Make; Ant
Overview Unit testing Building Version control.
Large Program Management: Make; Ant
Build Tools (make) CSE 333 Autumn 2018
CSE 303 Concepts and Tools for Software Development
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Large Program Management: Make; Ant
Software Engineering and Architecture
What is make? make is a system utility for managing the build process (compilation/linking/etc). There are various versions of make; these notes discuss.
The make utility (original presentation courtesy of Alark Joshi)
Large Program Management: Make, Ant
Presentation transcript:

Administrivia P2 all grades available now Relative importance of scores M1: 30% M2: 30% Rollout: 40% P3 -- good progress so far! Looks like a lot of the “competition” will be on coolness of the GUI... Bad-ass corewarriors a plus too. ;-)

Race Conditions & Security Atomicity failures can sometimes be exploited to break security on multiprocessing systems One of the top 10 classes of exploits since... mid-1980’s, at least 100’s (or more) of reported vulnerabilities Independent of language: Java will not save you! Hostile program grabs a shared resource (e.g., file) before it is secured Beware when writing privileged code! N.b.: Sometimes your never-intended-to-be- secure code will be run in privileged context!

Basic Race Condition Exploit priv proc

Basic Race Condition Exploit priv proc file /tmp/foo write() read() close() unlink() open(“/tmp/foo”, O_RDWR | O_CREAT);

Basic Race Condition Exploit priv proc open(“/tmp/foo”, O_RDWR | O_CREAT); file /tmp/foo write() read() close() unlink() hostile proc open(...) read()

Basic Race Condition Exploit priv proc open(“/tmp/foo”, O_RDWR | O_CREAT); file /tmp/foo write() read() close() unlink() hostile proc chmod()

Basic Race Condition Exploit priv proc open(“/tmp/foo”, O_RDWR | O_CREAT); file /tmp/foo write() read() close() unlink() hostile proc chmod() open(...)

Basic Race Condition Exploit priv proc open(“/tmp/foo”, O_RDWR | O_CREAT); file /tmp/foo write() read() close() unlink() hostile proc umask()

Basic Race Condition Exploit priv proc open(“/tmp/foo”, O_RDWR | O_CREAT); file /tmp/foo write() read() close() unlink() hostile proc umask() open(...) read()

Basic Race Condition Exploit priv proc open(“/tmp/foo”, O_RDWR | O_CREAT); file /tmp/foo write() read() close() unlink() hostile proc umask() symlink(“/tmp/foo”, “/etc/passwd”)

Basic Race Condition Exploit priv proc stat(“/tmp/foo”); if (!exists) { open(“/tmp/foo”, O_RDWR | O_CREAT); } else { error(); } file /tmp/foo write() read() close() unlink() hostile proc umask()

Basic Race Condition Exploit priv proc stat(“/tmp/foo”); if (!exists) { open(“/tmp/foo”, O_RDWR | O_CREAT); } else { error(); } file /tmp/foo write() read() close() unlink() hostile proc umask() symlink(“/tmp/foo”, “/etc/passwd”)

Preventing Filesystem Race Conditions Could create “foo” in dir owned/writable only by owner of proc Can be hard to ensure this Still have to watch out for filename collisions Could make file names hard to predict (e.g., picked randomly) Exploit still possible; hard to make fnames really random Ultimate answer: use OS atomicity facilities open(“/tmp/foo”, O_RDWR | O_CREAT | O_EXCL) Always be on guard!

Building with Ant/Make

Automating the Repetitive Small software: Type “javac *.java; javadoc *.java” Maybe “cp *.java ~/distrib_dir; tar czf ~/distrib_dir.tar.gz ~/distrib_dir” Big software systems 10k+ Java (and other source lang) files Many images, data files, support code, etc. Many directories/subdirs/packages, etc. Specialized distribution/installation procedures Doing all of these by hand all the time is a pain in the a**. And error prone. And users won’t do it...

Non-Solution Shell scripts giving sequences of commands Doesn’t handle multiple build targets Doesn’t track dependencies #!/bin/sh cd package1 javac *.java cd.. javac *.java echo Manifest Main-Class: FooClass EOF jar cmf Manifest distro.jar *.class package1/*.class

Multiple Build Targets For single project may want to: Build main program Build support program Both of above in “debug” or “production” mode Build docs Run tests Export sources/docs for distribution Auto-create data files etc... May want to do any subset (all) of these

Dependencies Tasks are interdependent -- need to complete one before going on to another Compile *.java -> *.class before making jar Build debug version before running tests Compile code, make jar file, build javadocs, compile user docs, remove scratch files, etc. all before exporting for rollout... Even source files are interdependent Compile MondoHashtable.java before StatsTable.java before BSFTrain.java...

Make: the UNIX/C Style Build Tool In C/C++/FORTRAN/Pascal/Modula-3/etc. have to specify the source dependencies by hand “Do foo.c before bar.c; when you have foo.o and bar.o, make the executable gux” Know that if “foo.o” is newer than “foo.c”, you don’t have to rebuild it (redundant) Need support for many different compilers/languages Need support for arbitrary tools (create directories, move files, tar, cvs, etc.) Also multiple targets, conditional compilation, etc.

Example Makefile SRCDIR=${HOME}/sources/project4 INSTROOT=/usr/ INSTBIN=${INSTROOT}/bin INSTDOC=${INSTROOT}/doc DEBUG=-g INCLUDE=${SRCDIR}/includes CFLAGS=${DEBUG} -I ${INCLUDE} LIBDIR=${SRCDIR}/libs all: myApplication foo.o: foo.c gcc ${CFLAGS} -o foo.o foo.c bar.o: bar.c foo.c gux.o: gux.c foo.c myApplication: foo.o bar.o gux.o gcc -o myApplication foo.o bar.o gux.o

Make and the Dependency Graph myApplication foo.o bar.o gux.o foo.c bar.c gux.c Must be a DAG Can be arbitrarily hairy In large projects, thousands of nodes...

Make and the Dependency Graph % make gcc -g -I./includes -c -o foo.o foo.c gcc -g -I./includes -c -o bar.o bar.c gcc -g -I./includes -c -o gux.o gux.c gcc -o myApplication foo.o bar.o gux.o % make make: Nothing to be done for `all'. % touch gux.c % make gcc -g -I./includes -c -o gux.o gux.c gcc -o myApplication foo.o bar.o gux.o % make make: Nothing to be done for `all'. % touch foo.c % make gcc -g -I./includes -c -o foo.o foo.c gcc -g -I./includes -c -o bar.o bar.c gcc -g -I./includes -c -o gux.o gux.c gcc -o myApplication foo.o bar.o gux.o

Coolness of Make Auto-tracks dependencies ~Simple support for conditional compilation Variables for repeatedly used constructs (CFLAGS, LIBDIR, CLASSPATH, etc.) Can write arbitrary commands for any rule Extensibility==write command lines/shell script Supports rule patterns (.o:.c) Universal -- available on any *nix, DOS/Win, etc.

Bogusness of Make Antiquated syntax hard to read/maintain Tracks, but doesn’t auto-detect source file dependencies Dependency model radically different than Java dependencies javac wants to figure them out itself Multiple re-compilation of the same file Every invocation of javac==new JVM (slow)

Ant: Java’s Answer to Make New entry into the build tool arena Freeware project available from apache.org Runs in Java itself Only creates one JVM, regardless of # of compilations Has direct access to javac’s dependency engine Extensible via new Java modules/subclassing

Parts of an Ant Buildfile One Project Just a name for the whole file, place to put comments, specify top-level dirs & vars, etc. One or more Targets for that project Target==named build goal Executable Documentation Tests Export One or more Tasks for each Target Task specifies how to achieve that target

A “Conceptual” Ant File project: CS351 { BASEDIR=${HOME}/projects/p3 MOD1=${BASEDIR}/src/module1 MOD2=${BASEDIR}/src/module2 DOCDIR=${BASEDIR}/documentation Target: buildExecutable { Task: compileAllFiles { cd ${MOD1} javac *.java cd ${MOD2} javac *.java } Task: makeJarFile {... } } Target: buildDocs { Task: mkDocDir { if (!exists(${DOCDIR}) { mkdir ${DOCDIR} } } Task: buildJavaDocs {... }

Coolness of Ant Already knows about most standard Java things that you want to do Understands Java’s dependency model, etc. Built-in recursive behavior for Java packages Don’t have to enumerate all sourcefiles Extensible Fast (mostly) (many) IDEs understand it natively

Bogusness of Ant Modern, cutting edge syntax (XML) Hard to read/maintain Built-in recursive behavior for Java packages Hard to track, easy to get wrong, hard to override Tightly fitted to Java Extension==write new Java class to do new task (ick)