This is a patch file for "xsane" 0.998. This file makes a distro-specific change. Most sysadmins won't want to use this change. However, it's required by the local distro. If "root" tries to use the standard version of "xsane" 0.998, the pro- gram displays a warning message at startup time. This change reverses things. After the change is made, "xsane" 0.998 will refuse to run un- less the user is "root". Rationale: We haven't been able to get "xsane" working for non-root users (even though we've tried the recom- mended "udev" change). This patch file should be compatible with all distros that support the original program. This patch file may include trailing empty lines and/or trailing lines that consist solely of whitespace. If you edit this file, use software that preserves lines of this type, or you may break the patch. --- xsane-0.998.old/src/xsane-text.h +++ xsane-0.998/src/xsane-text.h @@ -789,10 +789,9 @@ #define WARN_COUNTER_UNDERRUN _("Filename counter underrun") #define WARN_NO_VALUE_CONSTRAINT _("warning: option has no value constraint") -#define WARN_XSANE_AS_ROOT _("You try to run XSane as ROOT, that really is DANGEROUS!\n\n\ -Do not send any bug reports when you\n\ -have any problems while running XSane as root:\n\ -YOU ARE ALONE!\ + +#define WARN_XSANE_AS_ROOT _("This version of XSane requires root privileges.\n\n\ +This may be corrected in the future.\ ") #define ERR_HEADER_ERROR _("Error") --- xsane-0.998.old/src/xsane.c +++ xsane-0.998/src/xsane.c @@ -5831,16 +5831,13 @@ xsane_pref_restore_media(); -#ifndef HAVE_OS2_H - if (!getuid()) /* root ? */ + if (getuid()) /* root ? */ { - if (xsane_back_gtk_decision(ERR_HEADER_WARNING, (gchar **) warning_xpm, WARN_XSANE_AS_ROOT, - BUTTON_CANCEL, BUTTON_CONT_AT_OWN_RISK, TRUE /* wait */) == TRUE) - { - return 2; /* User selected CANCEL */ - } + xsane_back_gtk_decision (ERR_HEADER_WARNING, + (gchar **) warning_xpm, WARN_XSANE_AS_ROOT, + BUTTON_CLOSE, NULL, TRUE); + return 2; } -#endif sane_init(&xsane.sane_backend_versioncode, (void *) xsane_authorization_callback);