Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 256955

Summary: net-wireless/aircrack-ng-1.0_rc1 O_CREAT in second argument needs 3 arguments
Product: Gentoo Linux Reporter: Christohper Harrington <ironiridis>
Component: New packagesAssignee: Gentoo Netmon project <netmon>
Status: RESOLVED FIXED    
Severity: normal CC: crypto+disabled, gibgibon, johannes
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 259417    
Attachments: fix typo in wesside-ng.c

Description Christohper Harrington 2009-01-30 16:15:57 UTC
A fair amount of googling reveals that this error is the result of failing to pass a mode to open when specifying O_CREAT as a parameter:
  error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments

As described, compiling with optimizations inhibits this error:
# CFLAGS="-O0" emerge aircrack-ng
But even -O1 causes the compile to fail:
# CFLAGS="-O1" emerge aircrack-ng

This seems fairly common, actually... see bug 232079, bug 232081, bug 232084, bug 232100, bug 232102, and bug 256638.

I'm not sure what is unique about me; this clearly hasn't affected anyone else. I'll post additional information if/when needed. I'll also dick around with figuring out how to patch the problem, and if I get it, I'll attach it.

Reproducible: Always

Steps to Reproduce:
1. # CFLAGS="-O1" emerge "=net-wireless/aircrack-ng-1.0_rc1"


Actual Results:  
Compilation fails.

Expected Results:  
Compilation succeeds, I obtain free internet access, eventually I turn my life around and learn a lesson about the immorality of wifi theft.

# emerge --info
Portage 2.2_rc23 (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.9_p20081201-r1, 2.6.28-gentoo-r1 i686)
=================================================================
System uname: Linux-2.6.28-gentoo-r1-i686-Intel-R-_Core-TM-2_Duo_CPU_E8200_@_2.66GHz-with-glibc2.0
Timestamp of tree: Fri, 30 Jan 2009 14:45:01 +0000
app-shells/bash:     3.2_p48
dev-lang/python:     2.5.4-r2
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.2
sys-apps/sandbox:    1.3.3
sys-devel/autoconf:  2.63
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=core2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://lug.mtu.edu/gentoo/"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="apache2 bzip2 cli crypt ctype curl ftp gd gnutls jpeg ldap mysql mysqli pcre php png posix samba session socks5 sse sse2 sse3 ssl syslog truetype unicode urandom x86 zip zlib" APACHE2_MODULES="authz_host dir mime" ELIBC="glibc" INPUT_DEVICES="keyboard" KERNEL="linux" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

# fgrep error /var/tmp/portage/net-wireless/aircrack-ng-1.0_rc1/temp/build.log 
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
Comment 1 Christohper Harrington 2009-01-30 16:34:44 UTC
Even as I was tasked with the simple job of distinguishing -O0 and -O1 in my description, I wasn't clear. Let's try this again:

Compiling with optimizations DISABLED inhibits this error:
# CFLAGS="-O0" emerge aircrack-ng
But even -O1 causes the compile to fail:
# CFLAGS="-O1" emerge aircrack-ng
Comment 2 Christohper Harrington 2009-01-30 16:47:31 UTC
Created attachment 180296 [details, diff]
fix typo in wesside-ng.c

wesside-ng.c contains this line:
fd = open(KEY_FILE, O_WRONLY | O_CREAT | 0644);

This is clearly a typo, when the author meant the second pipe to be a comma. This patch uses the S_I[RWX](USR|GRP|OTH) convention, along with a comma, to be consistent with the rest of the source.
Comment 3 Felipe Lessa 2009-02-07 20:11:15 UTC
This seems to have been fixed on rc2, see http://trac.aircrack-ng.org/ticket/454 .
Comment 4 Patrick Lauer gentoo-dev 2009-03-01 19:18:33 UTC
Since _rc2 is in tree and fixed this bug can be closed.