*** Released am-utils-6.1.1 ***
*******************************************************************
+ * libamu/xutil.c (xsnprintf): "unsafe" alternative to vsnprintf is
+ vsprintf, not sprintf.
+
+ * conf/umount/umount_osf.c (umount_fs): refer to proper formal
+ parameter name.
+ (umount2_fs): pass second arg to umount().
+
* ALL: remove CVS ID and put actual file name in source.
* conf/autofs/*.[hc]: proper copyright headers.
int
-umount_fs(char *fs_name, const char *mnttabname, u_int unmount_flags)
+umount_fs(char *mntdir, const char *mnttabname, u_int unmount_flags)
{
int error;
eintr:
- error = umount(fs_name, MNT_NOFORCE);
+ error = umount(mntdir, MNT_NOFORCE);
if (error < 0)
error = errno;
switch (error) {
case EINVAL:
case ENOTBLK:
- plog(XLOG_WARNING, "unmount: %s is not mounted", fs_name);
+ plog(XLOG_WARNING, "unmount: %s is not mounted", mntdir);
error = 0; /* Not really an error */
break;
case ENOENT:
- plog(XLOG_ERROR, "mount point %s: %m", fs_name);
+ plog(XLOG_ERROR, "mount point %s: %m", mntdir);
break;
case EINTR:
/* not sure why this happens, but it does. ask kirk one day... */
- dlog("%s: unmount: %m", fs_name);
+ dlog("%s: unmount: %m", mntdir);
goto eintr;
#ifdef MNT2_GEN_OPT_FORCE
/* caller determines if forced unmounts should be used */
if (unmount_flags & AMU_UMOUNT_FORCE) {
error = umount2_fs(mntdir, unmount_flags);
- if ((error = umount2_fs(mntdir)) < 0)
+ if ((error = umount2_fs(mntdir, unmount_flags)) < 0)
error = errno;
else
return error;
#endif /* MNT2_GEN_OPT_FORCE */
default:
- dlog("%s: unmount: %m", fs_name);
+ dlog("%s: unmount: %m", mntdir);
break;
}
int error = 0;
if (unmount_flags & AMU_UMOUNT_FORCE) {
plog(XLOG_INFO, "umount2_fs: trying unmount/forced on %s", mntdir);
- error = umount(mntdir, MNT2_GEN_OPT_FORCE);
+ error = umount((char *)mntdir, MNT2_GEN_OPT_FORCE);
if (error < 0 && (errno == EINVAL || errno == ENOENT))
error = 0; /* ignore EINVAL/ENOENT */
if (error < 0)
#ifdef HAVE_VSNPRINTF
ret = vsnprintf(str, size, format, ap);
#else /* not HAVE_VSNPRINTF */
- ret = sprintf(str, format, ap); /* less secure version */
+ ret = vsprintf(str, format, ap); /* less secure version */
#endif /* not HAVE_VSNPRINTF */
va_end(ap);
return ret;