o Restore previous inconsistent style to login_fbtab.c, following its

modification to add glob support.  The submitted patch used a degraded
  form of KNF.

Reviewed by:	bde
This commit is contained in:
Robert Watson 2001-10-28 22:54:16 +00:00
parent 0e9fe2127c
commit 0cd9461353
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85645

View File

@ -122,27 +122,27 @@ gid_t gid;
void
login_protect(table, pattern, mask, uid, gid)
char *table;
char *pattern;
int mask;
uid_t uid;
gid_t gid;
char *table;
char *pattern;
int mask;
uid_t uid;
gid_t gid;
{
glob_t gl;
char *path;
int i;
glob_t gl;
char *path;
int i;
if (glob(pattern, GLOB_NOSORT, NULL, &gl) != 0)
return;
for (i = 0; i < gl.gl_pathc; i++) {
path = gl.gl_pathv[i];
/* clear flags of the device */
if (chflags(path, 0) && errno != ENOENT && errno != EOPNOTSUPP)
syslog(LOG_ERR, "%s: chflags(%s): %m", table, path);
if (chmod(path, mask) && errno != ENOENT)
syslog(LOG_ERR, "%s: chmod(%s): %m", table, path);
if (chown(path, uid, gid) && errno != ENOENT)
syslog(LOG_ERR, "%s: chown(%s): %m", table, path);
}
globfree(&gl);
if (glob(pattern, GLOB_NOSORT, NULL, &gl) != 0)
return;
for (i = 0; i < gl.gl_pathc; i++) {
path = gl.gl_pathv[i];
/* clear flags of the device */
if (chflags(path, 0) && errno != ENOENT && errno != EOPNOTSUPP)
syslog(LOG_ERR, "%s: chflags(%s): %m", table, path);
if (chmod(path, mask) && errno != ENOENT)
syslog(LOG_ERR, "%s: chmod(%s): %m", table, path);
if (chown(path, uid, gid) && errno != ENOENT)
syslog(LOG_ERR, "%s: chown(%s): %m", table, path);
}
globfree(&gl);
}