lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 18 Mar 2024 08:51:40 +0000
From: Ratheesh Kannoth <rkannoth@...vell.com>
To: Max Gautier <mg@....gautier.name>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [EXTERNAL] Re: [PATCH iproute2-next v2] arpd: create
 /var/lib/arpd on first use

> From: Max Gautier <mg@....gautier.name>
> Sent: Monday, March 18, 2024 2:07 PM
> To: Ratheesh Kannoth <rkannoth@...vell.com>
> Cc: netdev@...r.kernel.org
> Subject: [EXTERNAL] Re: [PATCH iproute2-next v2] arpd: create /var/lib/arpd
> on first use

> > > +	if (strcmp(default_dbname, dbname) == 0
> > > +			&& mkdir(ARPDDIR, 0755) != 0
> > > +			&& errno != EEXIST
> > why do you need errno != EEXIST case ? mkdir() will return error in this case
> as well.
> 
> EEXIST is not an error in this case: if the default location already exist, all is
> good. mkdir would still return -1 in this case, so we need to exclude it
> manually.

ACK. IMO, it would make a more readable code if you consider splitting the "if" loop. 


  
> 
> > > +			) {
> > > +		perror("create_db_dir");
> > > +		exit(-1);
> > > +	}
> > > +
> > >  	dbase = dbopen(dbname, O_CREAT|O_RDWR, 0644, DB_HASH,
> NULL);
> > >  	if (dbase == NULL) {
> > >  		perror("db_open");
> > > --
> > > 2.44.0
> > >
> 
> --
> Max Gautier

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ