How to inspect AUR package PKBUILD and .install files

Hi,
Linux and arch newbie here. I was reading the wiki article about the AUR and noticed this bit:
Warning: Carefully check all files. cd to the newly created directory and carefully check the PKGBUILD and any .install file for malicious commands. PKGBUILDs are bash scripts containing functions to be executed by makepkg: these functions can contain any valid commands or Bash syntax, so it is totally possible for a PKGBUILD to contain dangerous commands through malice or ignorance on the part of the author. Since makepkg uses fakeroot (and should never be run as root), there is some level of protection but you should never count on it. If in doubt, do not build the package and seek advice on the forums or mailing list.
This is something that have not been doing at all in the past, but I am trying to improve my practices managing my system.
The problem is, I do not know what exactly I am looking at or for in these files. If I give these files a look over before installing the package, can I honestly expect to spot something malicious? What would I need to learn to notice if something was fishy?
Anyway, I am not to worried about this practically, because I only use a handful of AUR packages and I usually install ones based on recommendations, not just at random. But it still seemed interesting for the wiki to stress this so strongly. How important is this guidline anyway?
Thanks!
[EDIT: spelling]
Last edited by supernerd (2014-06-25 10:41:13)

I scan the whole PKGBUILD. I start by ensuring that the source link to the original source looks accurate. For example, take the source line for gmusicbrowser-git:
source=("${pkgname}::git+http://github.com/squentin/gmusicbrowser.git")
I know this is the correct link to the source, and so it passes my check. But suppose it had said:
source=("${pkgname}::git+http://youvebeenhackedhub.com/1337haxorz/gmusicbrowser.git")
I would become suspicious. Of course this is an exaggeration, but common sense goes a long ways here. At least check the first time..
With the source verified, I ensure that the md5sum or sha256sum block has a sum. This way, if a download is compromised at the source, the sha256 or md5sum can catch it before you installed (this assumes that the PKGBUILD is not "bad" and has the sum number of a package that wasnt compromised). Note that with git this isnt necessary (the git process protects against such problems). Anytime a tarball is downloaded and extracted however, the sums should be present in the PKGBUILD. If I go to install an AUR package that has 'SKIP' for the md5sum/sha256sum block, I will double or triple check the source of the tarball (or of the patch files enclosed in the build directory, etc..)
I also look for any "dangerous" commands in the build and install sections. For example, if I see "rm -rf" I had better see something like $pkgdir to start the directory path or be VERY sure the path is "safe". Since makepkg is not run as root this should theoretically not be a problem, but imagine if someone put "rm -rf /home/*" (warning: do not run that command on your system!) in there! This is mostly common sense; in time as you get more comfortable with bash and various linux commands it will make more and more sense and you will be able to spot mistakes.
Also, consider the user posting the pkgbuild. "Trusted Users" are selected as trustworthy members of the community, so obviously you can feel much more comfortable with PKGBUILDS they have made (Xyne comes to mind..). For people you may not know, check what other PKGBUILDs they have available. After awhile, you develop a trust for certain people whos PKGBUILDs or software you have used. For example, I wouldnt hesitate to build/install using a PKGBUILD put up by BurntSushi since I use some of his software, have personally corresponded with him, and find him to be responsible. You might "develop" such rapport with other AUR users I dont even know about.
Consider the vote count of a package as an approximate metric. Dont discount a package because it has 0 votes- it may just be that not many people have use for that particular software. Ive considered hosting a PKGBUILD for "xfce4-terminal-nowindowhints"; consider that tilers generally ignore them anyway, and that my package would only be useful for someone literally using xfce4-terminal with pytyle. How high do you think the vote count would be (even if the PKGBUILD had 0 errors)? On the other hand, you at least have a good chance the PKGBUILD is solid if the package has 354 people voting for it.. That said, the package could have been well-maintained before (when it received a ton of votes), and the quality has dropped since- just be mindful of these trends.
Finally, adding all of these things together will leave the odds of a malicious PKGBUILD affecting your system pretty slim, though its certainly not impossible. I have never (to my knowledge to be fair) encountered a malicious PKGBUILD, though I have found a few that had errors or outdated sources, etc.
Last edited by GSF1200S (2014-06-29 10:13:50)

Similar Messages

  • How to completely remove mac os and install windows 7 on macbook pro with retina display 15 inch

    how to completely remove mac os and install windows 7 on macbook pro with retina display 15 inch

    There's not much sense in purchasing a Mac to run only Windows on it.  Keep in mind that drivers for Windows are a secondary concern for Apple.  While Windows will typicall run fine, things like power managment are not optimized under Windows (you'll get less time on battery while running Windows).  You will also not be able to install firmware updates.  Firmware updates might be necessary whether you run Windows or OS X as they are updates to the code in your hardware and are not OS-specific.  You must be running OS X in order to install a firmware update.  You can do this even if you boot off of an external drive with OS X installed on it.  At the very least, you should keep just a small partition for OS X on your internal drive. 

  • How can I uninstall iDVD '08 and install iDVD '06?

    There's a reported bug among iDVD '08 users where burning
    large projects are resulting in audio synch problems near the
    end of the burned DVD.
    In other words, the audio slowly goes out of synch towards the
    end of burned projects.
    This is a problem inherent with 'DVD '08.
    I tried uninstalling iDVD '08 and replacing with '06 but it doesn't
    work. You try that and iDVD will not launch at all.
    Even tried to partition my drive and install iLife '06 to the partition
    but the system will not let me.
    Anyone have a solution how to completely uninstall iLife '08
    components and install iLife '06?
    Thanks

    I upgraded to iLife 08 from 06 (bad move). I couldn't install iMovie because my Mac is too old (must be Intel-based or comparable). iDVD didn't work--the document window was always black, even with a theme selected. The Virtual Band function in GarageBand did nothing whatsoever. I trashed the '08 applications, moved all Preferences files to my desktop, reinstalled iLife '06. Now, iDVD won't launch--just flashes the menu bar and exits back to the Finder. So, I have several DVD projects on my system that I cannot finish because I cannot reinstall iLife '06 (like the originator of this problem, "How can I uninstall iDVD '08 and install iDVD '06?") I hope someone has an answer as this is frustrating and costly to my small business.

  • How can I get Flash Player and install it?

    I29/Aug/2010 17:37
    TO: Adobe Forum
    I am running Windows XP Home, and using Mozilla Firefox 3.6.8 as my browser.
    When I go to download and install the latest version of Flash Player, the ONLY option I get is to quit. In other words, I cannot download and install Flash Player. This even occurs at Adobe's own website.
    How can I get Flash Player and install it?
    Thank you in advance.
    Sincerely,
    Barry Karas

    First, you can manually download the installer here: http://get.adobe.com/flashplayer/otherversions/
    Second. On both my Mac (OS 10.6.4) and My PC (Vista Home Premium) I have had nothing but trouble with Firefox 3.6.8 and Flash player, Flash apps and Flash sites that require access to web cam or microphone or both.
    The last time Flash Player worked well with Firefox was 3.6.4, but I uninstalled 3.6.8 and went all the way back to 3.0 on both systems.
    Just a heads up. If you download the manual installer, and it still doesn't work, it ISN'T the Flash Player. It's Firefox. IE, Opera and Safari all work with it.
    Go to oldversion.com and get an older build of Firefox, uninstall 3.6.8, install the older one, go to Tools, and Options and turn off automatic checking for updates, so it doesn't try to take you back the the 3.6.8 "busted @$$ joint" that doesn't work worth poo.
    Maybe when they release 3.7, Firefox will have their act together with Adobe and Flash Player.

  • How can i do to get and install whatsapp messenger on my iPhone 4s updated with iOS 6?

    How can i do to get and install whatsapp messenger on my iPhone 4s updated with iOS 6?

    Make sure you have the Latest Version of iTunes (v11.1.5) Installed on your computer
    iTunes free download from www.itunes.com/download
    Then... See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...  Be sure to Follow ALL the Steps...
    Take your time... Pay particular attention to Steps 3 and 4.
    After you have Recovered your Device...
    Re-Sync your Content or Restore from the most recent Backup...
    Restore from Backup  >  http://support.apple.com/kb/ht1766
    Note:
    Once the Device is asking to be Restored with iTunes... it is too late to save anything... and you must continue with the Recovery...

  • How to delete ios 5.1 and install the older version

    how to delete ios 5.1 and install the older version????

    apple stopped signing 5.0.1 and 5.0 fw.
    but to answer your question, you can still download old firmwares and then press shift while clicking on the restore button in itunes, point it to the fw and there you (should) go.

  • How do I remove server os and install normal os?  The computer has never been used as a server.  I only purchased the server version because of two internal hard drives.

    How do I remove server os and install normal os?  The computer has never been used as a server.  I only purchased the server version because of two internal hard drives.

    If you want to just disable the Server aspect, this should work for both Lion and Mountain Lion...
    http://support.apple.com/kb/HT4827
    If you want to completely start over, backup your /Users and /Applications directories and re-install the client OS.

  • I am the account owner in charge of purchases but the software will be used by different people - how should I do the download and install for them?

    I am the account owner in charge of purchases but the software will be used by different people - how should I go about downloading and installing on people's computers?

    If you need several copies of Acrobat (the license is per user), then you should talk to Adobe Sales about a volume purchase. I am not sure of the details, but probably the best way to go. In that case, I think all are on the same S/N and you pay according to the number of activations or such. Again, I am not sure and you need to talk to Adobe. Adobe is currently pushing the cloud and subscription versions and you might want to discuss the various options with them.

  • How can I do an archive and install

    I have just put my new 1TB HDD in my macbook pro and I cannot enable FV2, something to do with a recovery partition. I have heard that a reinstall will work, so how can I do an archive and install on my MacBook pro?
    Mid-2012, Mountain Lion.
    Thank you.

    A&I went away with Snow Leopard. Reinstalling it or later OSs overwrites all OS components and basic Apple apps. Updating or upgrading to solve problems is the wrong approach, You need to fix the current issues before embarking on that path. As for speeding up things, see:
    Mac Maintenance Quick Assist,
    Mac OS X speed FAQ,
    Speeding up Macs,
    Macintosh OS X Routine Maintenance,
    Essential Mac Maintenance: Get set up,
    Essential Mac Maintenance: Rev up your routines,
    Maintaining OS X, 
    Five Mac maintenance myths
    How to Speed up Macs, and
    Myths of required versus not required maintenance for Mac OS X for information.

  • How can i re-link .mpkg and .pkg files to hidden Installer?

    I am near the end of the process of setting up my new Mac Pro (early 2009) eight core. Quite the wonderful difference from my "Mirror Drive Door" dual 1.25 GHz machine!
    The Mac Pro came with Mac OS X 10.6.2 installed. I updated this to 10.6.6 via Software Update along with a slew of other updates presented there. I downloaded and installed a bunch of software. Finally, I was ready to install iLife 11 from the "CPU Drop-in" DVD that was on top of the box when the computer was originally unpacked.
    Unfortunately, it wouldn't even begin the install. The "iLife.mpkg" file, when double-clicked, returned the error message "no application associated with this document". Hours of investigation reveals that NO .mpkg or .pkg file will open; doing a "get info" on the files reveals that those files have lost their link to the Installer app.
    AND since the only installer I can find is hidden in /usr/sbin, there is no way I can re-link .mpkg and .pkg files to it via "get info".
    I downloaded Pacifist and used it to open the "Mac OS X 10.6.6 Combo" package and re-installed the Combo updater. Much to my surprise, that didn't fix the linking issue.
    I've logged in as root, but still can't re-link the package files to the Installer as /usr/ is still hidden. Is there a way I can temporarily "un-hide" the /usr directory so that "get info; open with" can see it?
    I've started from the Mac OS X installer DVD and repaired permissions on the hard disk and "repaired" the hard disk. No luck there either.
    I did a clean install of Mac OS X 10.6.2 to a different hard drive and applied the combo updater and the packages worked as expected there. So some software I installed or by running a slew of updaters via Software Update broke the link between packages and the Installer.
    I'm sure that re-linking to packages to the hidden installer app can be done via Terminal and possible other ways, but I don't know how to do it.
    Short of doing a complete Mac OS X 10.6 re-installation and update and having to re-do several days of other software installations and data transfers, I'm hoping someone will offer some solutions or tips on how to solve my problem.
    How do I re-link .mpkg and .pkg files to the Installer?

    Thanks for the reply. I know I had previously checked for the missing installer in /System/Library/CoreServices/ and I rechecked and it's still not there. But your tip spurred me to check the test 10.6.6 installation on the other hard disk and yes! It's there!
    A quick copy from the second hard disk to my current hard disk and doing the "get info" trick and everything now works wonderfully. Only one day lost to trying to figure this out. Now that the problem is fixed, quite the relief.

  • How do I recover a .app and its file contents after osx "click and hold" "hit x button" delete

    How do I recover a .app and its file contents after osx "click and hold" "hit x button" delete.
    Accidently deleted rapidweaver and all of its content and paid plugins with it. all contain in its package contents. how do i restore.  I tried using recovery software.

    It is possible that you inadvertently corrupted the file while doing the edit.
    But it could also be possible that you moved the file? For iMovie to see it, it should be in the Movies/iMovie Projects folder.

  • How do i "show package contents" on .webtemplate files that have arrow

    Hi,
    Quick question:
    How do i "show package contents" on .webtemplate files that have a small arrow attached on the file icon. Its a template a downloaded from 11mystics.com (free). When i right click the icon there is no "show package contents" available on the drop down menu....
    Thanx!

    When you bring up the contextual menu for the icon, choose "Show Original". This will take you to where the original file is and you should be able to "Show Package Contents" on it.

  • Makepkg -p and install files

    Hi,
    i have a local, personal repository with following structure
    ├── abs
    │ ├── ...
    │ └── <reponame>
    │ ├── ...
    │ └── <pkgname>
    │ ├── PKGBUILD
    │ └── ...
    ├── build
    │ ├── ...
    │ └── <reponame>
    │ ├── ...
    │ └── <pkgname>
    │ ├── src
    │ ├── pkg
    │ └── ...
    └── pkg
    ├── ...
    └── <reponame>
    ├── *.pkg.{xz,gz,...}
    └── <reponame>.db.tar.gz
    I'm building packages by executing this single command within the build/<reponame>/<pkgname> directory:
    export PKGDEST=<path-to-'pkg'>/<reponame> && makepkg -p <path-to-'abs'>/<path-to-'buildscript'>
    This doesn't clutter my abs directory where the build instruction files are located, the build process itself is done in its own directory, and the output package is stored in a directory known by pacman. Everything without the need of manually copying any files as opposed to the ABS wiki page.
    The Problem:
    If the PKGBUILD file contains an option about an install script which is located in the same directory as the PKGBUILD, makepkg complains about missing install files. I've already tried to add the install script in the source option array, but this doesn't work too. Does the -p option only observe the buildscript?
    Is there a better way to do a three step 'build instruction'-'build'-'package destination' process, without manually copying PKGBUILD and install files?

    Ok, i'll stick with rsyncing the 'abs' tree to the 'build' tree so far. The BUILDDIR environment variable sounds quite useful. If i undestand this variable correctly by its name, i could make a
    export PKGDEST=<path-to-'pkg'>/<reponame> && export BUILDDIR=<path-to-'build'>/<reponame>/<pkgname> && makepkg
    inside the 'abs' tree. To ease the command i could also make a special makepkg.conf for this repository, so i don't have to export these environment variables every time.

  • How do I load microsoft office and pdf files onto an Ipad

    How do I load microsoft office and pdf files onto an Ipad?

    You can email them, you can use DropBox, SugarSync or another cloud service or you can use iOS file sharing.
    But in all cases you need an app on the iPad that will open and save those types of files. iBooks, Adobe Readers, Good Reader and Save 2 PDF will all save PDF files.
    Documents to Go, Quick Office Pro and the Apple iWorks apps will open and save the MS office files. You can Google - "iPad apps that are compatible with Microsoft Office files" and you will find other alternatives - or search the app store for more.
    You can read this as well for some instruction on getting those files onto an iPad.
    http://online.wsj.com/article/SB10001424052748703899704576204564046912604.html

  • How to embed the Word Document and PDF file into Crystal report?

    How to embed the Word Document and PDF file into Crystal report?
    I have word doc which having 10 pages. I need to show all of the 10 pages at a time. I tried OLE object but problem is it shows only one page.
    Is there any solution to show word doc / PDF file in CR?

    Symptom :
    When embedding a pdf document into a Crystal Report, only the one page shows.
    Reproducing the Issue
    Environment:
    Crystal Reports OLE object
    Cause
    An OLE object only displays the first page.
    Resolution
    Embed multiple objects, one for each page
    Or
    Use a hyperlink to the object instead
    Hope this helps!
    Regards,
    Vinay

Maybe you are looking for

  • Gx 740 not working - but don't know why!

    Hi everyone, this is my first post and I apologise if I've put this in the wrong forum. If so, please feel free to move it. I have an MSI GX740 and recently it stopped working and I have no idea why and was hoping someone here could help me try and d

  • Message Mapping unavailable icons

    Hi I'm following a procedure to do a 1:n mapping without BPM http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/600b455f-01cd-2b10-0cab-a50e47a8f800?quicklink=index&overridelayout=true This requires that one a message mapping is compl

  • Socker Error using simple app

    Hello All I have a simple app that consists of a client and server. This works fine when both components are on the same network (either on the same machine or two different machines), however I get the following error when the client and server are

  • Minimum Value Sucharge not calculated

    Hi Gurus, I created condition record ZMIW for material 1234 1000 Euro but in the Salesorder Condion Tab SD Minimum Value Sucharge is same with Minumum Order Value Mat 1234 1 pc 200 Euro Minimum Order Value                            1000 Euro Minumum

  • How can I localize the text of process names, task names and user actions within a process?

    I'm very interested in using the capabilities of Adobe LiveCycle Process Management for my project, however I have one rather large concern...   I hope someone here can tell me whether there's a way to address it. Since I work for the Government of C