1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-sysdeps-util.c Would be in dbus-sysdeps.c, but not used in libdbus
4 * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc.
5 * Copyright (C) 2003 CodeFactory AB
7 * Licensed under the Academic Free License version 2.1
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 #define STRSAFE_NO_DEPRECATE
27 #include "dbus-sysdeps.h"
28 #include "dbus-internals.h"
29 #include "dbus-protocol.h"
30 #include "dbus-string.h"
31 #include "dbus-sysdeps.h"
32 #include "dbus-sysdeps-win.h"
33 #include "dbus-sockets-win.h"
34 #include "dbus-memory.h"
45 #include <winsock2.h> // WSA error codes
48 * Does the chdir, fork, setsid, etc. to become a daemon process.
50 * @param pidfile #NULL, or pidfile to create
51 * @param print_pid_fd file descriptor to print daemon's pid to, or -1 for none
52 * @param error return location for errors
53 * @param keep_umask #TRUE to keep the original umask
54 * @returns #FALSE on failure
57 _dbus_become_daemon (const DBusString *pidfile,
58 DBusPipe *print_pid_pipe,
60 dbus_bool_t keep_umask)
66 * Creates a file containing the process ID.
68 * @param filename the filename to write to
69 * @param pid our process ID
70 * @param error return location for errors
71 * @returns #FALSE on failure
74 _dbus_write_pid_file (const DBusString *filename,
78 const char *cfilename;
82 cfilename = _dbus_string_get_const_data (filename);
84 fd = _open (cfilename, O_WRONLY|O_CREAT|O_EXCL|O_BINARY, 0644);
88 dbus_set_error (error, _dbus_error_from_errno (errno),
89 "Failed to open \"%s\": %s", cfilename,
94 if ((f = fdopen (fd, "w")) == NULL)
96 dbus_set_error (error, _dbus_error_from_errno (errno),
97 "Failed to fdopen fd %d: %s", fd, strerror (errno));
102 if (fprintf (f, "%lu\n", pid) < 0)
104 dbus_set_error (error, _dbus_error_from_errno (errno),
105 "Failed to write to \"%s\": %s", cfilename,
112 if (fclose (f) == EOF)
114 dbus_set_error (error, _dbus_error_from_errno (errno),
115 "Failed to close \"%s\": %s", cfilename,
124 * Writes the given pid_to_write to a pidfile (if non-NULL) and/or to a
125 * pipe (if non-NULL). Does nothing if pidfile and print_pid_pipe are both
128 * @param pidfile the file to write to or #NULL
129 * @param print_pid_pipe the pipe to write to or #NULL
130 * @param pid_to_write the pid to write out
131 * @param error error on failure
132 * @returns FALSE if error is set
135 _dbus_write_pid_to_file_and_pipe (const DBusString *pidfile,
136 DBusPipe *print_pid_pipe,
137 dbus_pid_t pid_to_write,
142 _dbus_verbose ("writing pid file %s\n", _dbus_string_get_const_data (pidfile));
143 if (!_dbus_write_pid_file (pidfile,
147 _dbus_verbose ("pid file write failed\n");
148 _DBUS_ASSERT_ERROR_IS_SET(error);
154 _dbus_verbose ("No pid file requested\n");
157 if (print_pid_pipe != NULL && _dbus_pipe_is_valid (print_pid_pipe))
162 _dbus_verbose ("writing our pid to pipe %d\n", print_pid_pipe->fd_or_handle);
164 if (!_dbus_string_init (&pid))
166 _DBUS_SET_OOM (error);
170 if (!_dbus_string_append_int (&pid, pid_to_write) ||
171 !_dbus_string_append (&pid, "\n"))
173 _dbus_string_free (&pid);
174 _DBUS_SET_OOM (error);
178 bytes = _dbus_string_get_length (&pid);
179 if (_dbus_pipe_write (print_pid_pipe, &pid, 0, bytes, error) != bytes)
181 /* _dbus_pipe_write sets error only on failure, not short write */
182 if (error != NULL && !dbus_error_is_set(error))
184 dbus_set_error (error, DBUS_ERROR_FAILED,
185 "Printing message bus PID: did not write enough bytes\n");
187 _dbus_string_free (&pid);
191 _dbus_string_free (&pid);
195 _dbus_verbose ("No pid pipe to write to\n");
202 * Verify that after the fork we can successfully change to this user.
204 * @param user the username given in the daemon configuration
205 * @returns #TRUE if username is valid
208 _dbus_verify_daemon_user (const char *user)
214 * Changes the user and group the bus is running as.
216 * @param user the user to become
217 * @param error return location for errors
218 * @returns #FALSE on failure
221 _dbus_change_to_daemon_user (const char *user,
228 * Changes the user and group the bus is running as.
230 * @param uid the new user ID
231 * @param gid the new group ID
232 * @param error return location for errors
233 * @returns #FALSE on failure
236 _dbus_change_identity (dbus_uid_t uid,
243 /** Checks if user is at the console
245 * @param username user to check
246 * @param error return location for errors
247 * @returns #TRUE is the user is at the consolei and there are no errors
250 _dbus_user_at_console(const char *username,
256 dbus_bool_t retval = FALSE;
259 PSID user_sid, console_user_sid;
262 wusername = _dbus_win_utf8_to_utf16 (username, error);
267 if (!_dbus_win_account_to_sid (wusername, &user_sid, error))
270 /* Now we have the SID for username. Get the SID of the
271 * user at the "console" (window station WinSta0)
273 if (!(winsta = OpenWindowStation ("WinSta0", FALSE, READ_CONTROL)))
275 _dbus_win_set_error_from_win_error (error, GetLastError ());
280 GetUserObjectInformation (winsta, UOI_USER_SID,
281 NULL, 0, &sid_length);
284 /* Nobody is logged on */
288 if (sid_length < 0 || sid_length > 1000)
290 dbus_set_error_const (error, DBUS_ERROR_FAILED, "Invalid SID length");
294 console_user_sid = dbus_malloc (sid_length);
295 if (!console_user_sid)
297 _DBUS_SET_OOM (error);
301 if (!GetUserObjectInformation (winsta, UOI_USER_SID,
302 console_user_sid, sid_length, &sid_length))
304 _dbus_win_set_error_from_win_error (error, GetLastError ());
308 if (!IsValidSid (console_user_sid))
310 dbus_set_error_const (error, DBUS_ERROR_FAILED, "Invalid SID");
314 retval = EqualSid (user_sid, console_user_sid);
317 dbus_free (console_user_sid);
319 CloseWindowStation (winsta);
321 dbus_free (user_sid);
323 dbus_free (wusername);
330 * Removes a directory; Directory must be empty
332 * @param filename directory filename
333 * @param error initialized error object
334 * @returns #TRUE on success
337 _dbus_delete_directory (const DBusString *filename,
340 const char *filename_c;
342 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
344 filename_c = _dbus_string_get_const_data (filename);
346 if (_rmdir (filename_c) != 0)
348 dbus_set_error (error, DBUS_ERROR_FAILED,
349 "Failed to remove directory %s: %s\n",
350 filename_c, strerror (errno));
358 _dbus_init_system_log (void)
364 * Log an informative message. Intended for use primarily by
367 * @param msg a printf-style format string
368 * @param args arguments for the format string
371 _dbus_log_info (const char *msg, va_list args)
377 * Log a security-related message. Intended for use primarily by
380 * @param msg a printf-style format string
381 * @param args arguments for the format string
384 _dbus_log_security (const char *msg, va_list args)
389 /** Installs a signal handler
391 * @param sig the signal to handle
392 * @param handler the handler
395 _dbus_set_signal_handler (int sig,
396 DBusSignalHandler handler)
398 _dbus_verbose ("_dbus_set_signal_handler() has to be implemented\n");
401 /** Checks if a file exists
403 * @param file full path to the file
404 * @returns #TRUE if file exists
407 _dbus_file_exists (const char *file)
409 DWORD attributes = GetFileAttributes (file);
411 if (attributes != INVALID_FILE_ATTRIBUTES && GetLastError() != ERROR_PATH_NOT_FOUND)
420 * @param filename the filename to stat
421 * @param statbuf the stat info to fill in
422 * @param error return location for error
423 * @returns #FALSE if error was set
426 _dbus_stat(const DBusString *filename,
434 const char *filename_c;
435 WIN32_FILE_ATTRIBUTE_DATA wfad;
438 PSID owner_sid, group_sid;
439 PSECURITY_DESCRIPTOR sd;
441 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
443 filename_c = _dbus_string_get_const_data (filename);
445 if (!GetFileAttributesEx (filename_c, GetFileExInfoStandard, &wfad))
447 _dbus_win_set_error_from_win_error (error, GetLastError ());
451 if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
452 statbuf->mode = _S_IFDIR;
454 statbuf->mode = _S_IFREG;
456 statbuf->mode |= _S_IREAD;
457 if (wfad.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
458 statbuf->mode |= _S_IWRITE;
460 lastdot = strrchr (filename_c, '.');
461 if (lastdot && stricmp (lastdot, ".exe") == 0)
462 statbuf->mode |= _S_IEXEC;
464 statbuf->mode |= (statbuf->mode & 0700) >> 3;
465 statbuf->mode |= (statbuf->mode & 0700) >> 6;
470 rc = GetNamedSecurityInfo ((char *) filename_c, SE_FILE_OBJECT,
471 OWNER_SECURITY_INFORMATION |
472 GROUP_SECURITY_INFORMATION,
473 &owner_sid, &group_sid,
476 if (rc != ERROR_SUCCESS)
478 _dbus_win_set_error_from_win_error (error, rc);
484 #ifdef ENABLE_UID_TO_SID
486 statbuf->uid = _dbus_win_sid_to_uid_t (owner_sid);
487 statbuf->gid = _dbus_win_sid_to_uid_t (group_sid);
492 statbuf->size = ((dbus_int64_t) wfad.nFileSizeHigh << 32) + wfad.nFileSizeLow;
495 (((dbus_int64_t) wfad.ftLastAccessTime.dwHighDateTime << 32) +
496 wfad.ftLastAccessTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
499 (((dbus_int64_t) wfad.ftLastWriteTime.dwHighDateTime << 32) +
500 wfad.ftLastWriteTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
503 (((dbus_int64_t) wfad.ftCreationTime.dwHighDateTime << 32) +
504 wfad.ftCreationTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
513 // mingw ships with dirent.h
515 #define _dbus_opendir opendir
516 #define _dbus_readdir readdir
517 #define _dbus_closedir closedir
522 #include <io.h> // win32 file functions
525 #include <sys/types.h>
528 /* This file is part of the KDE project
529 Copyright (C) 2000 Werner Almesberger
531 libc/sys/linux/sys/dirent.h - Directory entry as returned by readdir
533 This program is free software; you can redistribute it and/or
534 modify it under the terms of the GNU Library General Public
535 License as published by the Free Software Foundation; either
536 version 2 of the License, or (at your option) any later version.
538 This program is distributed in the hope that it will be useful,
539 but WITHOUT ANY WARRANTY; without even the implied warranty of
540 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
541 Library General Public License for more details.
543 You should have received a copy of the GNU Library General Public License
544 along with this program; see the file COPYING. If not, write to
545 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
546 Boston, MA 02110-1301, USA.
548 #define HAVE_NO_D_NAMLEN /* no struct dirent->d_namlen */
549 #define HAVE_DD_LOCK /* have locking mechanism */
551 #define MAXNAMLEN 255 /* sizeof(struct dirent.d_name)-1 */
553 #define __dirfd(dir) (dir)->dd_fd
555 /* struct dirent - same as Unix */
558 long d_ino; /* inode (always 1 in WIN32) */
559 off_t d_off; /* offset to this dirent */
560 unsigned short d_reclen; /* length of d_name */
561 char d_name[_MAX_FNAME+1]; /* filename (null terminated) */
564 /* typedef DIR - not the same as Unix */
567 long handle; /* _findfirst/_findnext handle */
568 short offset; /* offset into directory */
569 short finished; /* 1 if there are not more files */
570 struct _finddata_t fileinfo; /* from _findfirst/_findnext */
571 char *dir; /* the dir we are reading */
572 struct dirent dent; /* the dirent to return */
576 /**********************************************************************
577 * Implement dirent-style opendir/readdir/closedir on Window 95/NT
579 * Functions defined are opendir(), readdir() and closedir() with the
580 * same prototypes as the normal dirent.h implementation.
582 * Does not implement telldir(), seekdir(), rewinddir() or scandir().
583 * The dirent struct is compatible with Unix, except that d_ino is
584 * always 1 and d_off is made up as we go along.
586 * The DIR typedef is not compatible with Unix.
587 **********************************************************************/
589 DIR * _dbus_opendir(const char *dir)
596 filespec = malloc(strlen(dir) + 2 + 1);
597 strcpy(filespec, dir);
598 index = strlen(filespec) - 1;
599 if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\'))
600 filespec[index] = '\0';
601 strcat(filespec, "\\*");
603 dp = (DIR *)malloc(sizeof(DIR));
606 dp->dir = strdup(dir);
608 if ((handle = _findfirst(filespec, &(dp->fileinfo))) < 0)
622 struct dirent * _dbus_readdir(DIR *dp)
624 if (!dp || dp->finished)
629 if (_findnext(dp->handle, &(dp->fileinfo)) < 0)
638 strncpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME);
640 dp->dent.d_reclen = strlen(dp->dent.d_name);
641 dp->dent.d_off = dp->offset;
647 int _dbus_closedir(DIR *dp)
651 _findclose(dp->handle);
660 #endif //#ifdef HAVE_DIRENT_H
663 * Internals of directory iterator
667 DIR *d; /**< The DIR* from opendir() */
672 * Open a directory to iterate over.
674 * @param filename the directory name
675 * @param error exception return object or #NULL
676 * @returns new iterator, or #NULL on error
679 _dbus_directory_open (const DBusString *filename,
684 const char *filename_c;
686 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
688 filename_c = _dbus_string_get_const_data (filename);
690 d = _dbus_opendir (filename_c);
693 dbus_set_error (error, _dbus_error_from_errno (errno),
694 "Failed to read directory \"%s\": %s",
696 _dbus_strerror (errno));
699 iter = dbus_new0 (DBusDirIter, 1);
703 dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
704 "Could not allocate memory for directory iterator");
714 * Get next file in the directory. Will not return "." or ".." on
715 * UNIX. If an error occurs, the contents of "filename" are
716 * undefined. The error is never set if the function succeeds.
718 * @todo for thread safety, I think we have to use
719 * readdir_r(). (GLib has the same issue, should file a bug.)
721 * @param iter the iterator
722 * @param filename string to be set to the next file in the dir
723 * @param error return location for error
724 * @returns #TRUE if filename was filled in with a new filename
727 _dbus_directory_get_next_file (DBusDirIter *iter,
728 DBusString *filename,
733 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
737 ent = _dbus_readdir (iter->d);
741 dbus_set_error (error,
742 _dbus_error_from_errno (errno),
743 "%s", _dbus_strerror (errno));
746 else if (ent->d_name[0] == '.' &&
747 (ent->d_name[1] == '\0' ||
748 (ent->d_name[1] == '.' && ent->d_name[2] == '\0')))
752 _dbus_string_set_length (filename, 0);
753 if (!_dbus_string_append (filename, ent->d_name))
755 dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
756 "No memory to read directory entry");
765 * Closes a directory iteration.
768 _dbus_directory_close (DBusDirIter *iter)
770 _dbus_closedir (iter->d);
775 * Checks whether the filename is an absolute path
777 * @param filename the filename
778 * @returns #TRUE if an absolute path
781 _dbus_path_is_absolute (const DBusString *filename)
783 if (_dbus_string_get_length (filename) > 0)
784 return _dbus_string_get_byte (filename, 1) == ':'
785 || _dbus_string_get_byte (filename, 0) == '\\'
786 || _dbus_string_get_byte (filename, 0) == '/';
791 /** @} */ /* End of DBusInternalsUtils functions */
794 * @addtogroup DBusString
799 * Get the directory name from a complete filename
800 * @param filename the filename
801 * @param dirname string to append directory name to
802 * @returns #FALSE if no memory
805 _dbus_string_get_dirname(const DBusString *filename,
810 _dbus_assert (filename != dirname);
811 _dbus_assert (filename != NULL);
812 _dbus_assert (dirname != NULL);
814 /* Ignore any separators on the end */
815 sep = _dbus_string_get_length (filename);
817 return _dbus_string_append (dirname, "."); /* empty string passed in */
820 (_dbus_string_get_byte (filename, sep - 1) == '/' ||
821 _dbus_string_get_byte (filename, sep - 1) == '\\'))
824 _dbus_assert (sep >= 0);
828 _dbus_string_get_byte (filename, 1) == ':' &&
829 isalpha (_dbus_string_get_byte (filename, 0))))
830 return _dbus_string_copy_len (filename, 0, sep + 1,
831 dirname, _dbus_string_get_length (dirname));
835 _dbus_string_find_byte_backward (filename, sep, '/', &sep1);
836 _dbus_string_find_byte_backward (filename, sep, '\\', &sep2);
838 sep = MAX (sep1, sep2);
841 return _dbus_string_append (dirname, ".");
844 (_dbus_string_get_byte (filename, sep - 1) == '/' ||
845 _dbus_string_get_byte (filename, sep - 1) == '\\'))
848 _dbus_assert (sep >= 0);
852 _dbus_string_get_byte (filename, 1) == ':' &&
853 isalpha (_dbus_string_get_byte (filename, 0))))
855 (_dbus_string_get_byte (filename, sep) == '/' ||
856 _dbus_string_get_byte (filename, sep) == '\\'))
857 return _dbus_string_copy_len (filename, 0, sep + 1,
858 dirname, _dbus_string_get_length (dirname));
860 return _dbus_string_copy_len (filename, 0, sep - 0,
861 dirname, _dbus_string_get_length (dirname));
866 * Checks to see if the UNIX user ID matches the UID of
867 * the process. Should always return #FALSE on Windows.
869 * @param uid the UNIX user ID
870 * @returns #TRUE if this uid owns the process.
873 _dbus_unix_user_is_process_owner (dbus_uid_t uid)
878 /*=====================================================================
879 unix emulation functions - should be removed sometime in the future
880 =====================================================================*/
883 * Checks to see if the UNIX user ID is at the console.
884 * Should always fail on Windows (set the error to
885 * #DBUS_ERROR_NOT_SUPPORTED).
887 * @param uid UID of person to check
888 * @param error return location for errors
889 * @returns #TRUE if the UID is the same as the console user and there are no errors
892 _dbus_unix_user_is_at_console (dbus_uid_t uid,
900 * Parse a UNIX group from the bus config file. On Windows, this should
901 * simply always fail (just return #FALSE).
903 * @param groupname the groupname text
904 * @param gid_p place to return the gid
905 * @returns #TRUE on success
908 _dbus_parse_unix_group_from_config (const DBusString *groupname,
915 * Parse a UNIX user from the bus config file. On Windows, this should
916 * simply always fail (just return #FALSE).
918 * @param username the username text
919 * @param uid_p place to return the uid
920 * @returns #TRUE on success
923 _dbus_parse_unix_user_from_config (const DBusString *username,
931 * Gets all groups corresponding to the given UNIX user ID. On UNIX,
932 * just calls _dbus_groups_from_uid(). On Windows, should always
933 * fail since we don't know any UNIX groups.
936 * @param group_ids return location for array of group IDs
937 * @param n_group_ids return location for length of returned array
938 * @returns #TRUE if the UID existed and we got some credentials
941 _dbus_unix_groups_from_uid (dbus_uid_t uid,
942 dbus_gid_t **group_ids,
950 /** @} */ /* DBusString stuff */
952 /************************************************************************
956 ************************************************************************/
960 * Assigns an error name and message corresponding to a Win32 error
961 * code to a DBusError. Does nothing if error is #NULL.
963 * @param error the error.
964 * @param code the Win32 error code
967 _dbus_win_set_error_from_win_error (DBusError *error,
972 /* As we want the English message, use the A API */
973 FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER |
974 FORMAT_MESSAGE_IGNORE_INSERTS |
975 FORMAT_MESSAGE_FROM_SYSTEM,
976 NULL, code, MAKELANGID (LANG_ENGLISH, SUBLANG_ENGLISH_US),
977 (LPTSTR) &msg, 0, NULL);
982 msg_copy = dbus_malloc (strlen (msg));
983 strcpy (msg_copy, msg);
986 dbus_set_error (error, "win32.error", "%s", msg_copy);
989 dbus_set_error (error, "win32.error", "Unknown error code %d or FormatMessage failed", code);
993 _dbus_win_warn_win_error (const char *message,
998 dbus_error_init (&error);
999 _dbus_win_set_error_from_win_error (&error, code);
1000 _dbus_warn ("%s: %s\n", message, error.message);
1001 dbus_error_free (&error);
1005 * A wrapper around strerror() because some platforms
1006 * may be lame and not have strerror().
1008 * @param error_number errno.
1009 * @returns error description.
1012 _dbus_strerror (int error_number)
1020 switch (error_number)
1023 return "Interrupted function call";
1025 return "Permission denied";
1027 return "Bad address";
1029 return "Invalid argument";
1031 return "Too many open files";
1032 case WSAEWOULDBLOCK:
1033 return "Resource temporarily unavailable";
1034 case WSAEINPROGRESS:
1035 return "Operation now in progress";
1037 return "Operation already in progress";
1039 return "Socket operation on nonsocket";
1040 case WSAEDESTADDRREQ:
1041 return "Destination address required";
1043 return "Message too long";
1045 return "Protocol wrong type for socket";
1046 case WSAENOPROTOOPT:
1047 return "Bad protocol option";
1048 case WSAEPROTONOSUPPORT:
1049 return "Protocol not supported";
1050 case WSAESOCKTNOSUPPORT:
1051 return "Socket type not supported";
1053 return "Operation not supported";
1054 case WSAEPFNOSUPPORT:
1055 return "Protocol family not supported";
1056 case WSAEAFNOSUPPORT:
1057 return "Address family not supported by protocol family";
1059 return "Address already in use";
1060 case WSAEADDRNOTAVAIL:
1061 return "Cannot assign requested address";
1063 return "Network is down";
1064 case WSAENETUNREACH:
1065 return "Network is unreachable";
1067 return "Network dropped connection on reset";
1068 case WSAECONNABORTED:
1069 return "Software caused connection abort";
1071 return "Connection reset by peer";
1073 return "No buffer space available";
1075 return "Socket is already connected";
1077 return "Socket is not connected";
1079 return "Cannot send after socket shutdown";
1081 return "Connection timed out";
1082 case WSAECONNREFUSED:
1083 return "Connection refused";
1085 return "Host is down";
1086 case WSAEHOSTUNREACH:
1087 return "No route to host";
1089 return "Too many processes";
1091 return "Graceful shutdown in progress";
1092 case WSATYPE_NOT_FOUND:
1093 return "Class type not found";
1094 case WSAHOST_NOT_FOUND:
1095 return "Host not found";
1097 return "Nonauthoritative host not found";
1098 case WSANO_RECOVERY:
1099 return "This is a nonrecoverable error";
1101 return "Valid name, no data record of requested type";
1102 case WSA_INVALID_HANDLE:
1103 return "Specified event object handle is invalid";
1104 case WSA_INVALID_PARAMETER:
1105 return "One or more parameters are invalid";
1106 case WSA_IO_INCOMPLETE:
1107 return "Overlapped I/O event object not in signaled state";
1108 case WSA_IO_PENDING:
1109 return "Overlapped operations will complete later";
1110 case WSA_NOT_ENOUGH_MEMORY:
1111 return "Insufficient memory available";
1112 case WSA_OPERATION_ABORTED:
1113 return "Overlapped operation aborted";
1114 #ifdef WSAINVALIDPROCTABLE
1116 case WSAINVALIDPROCTABLE:
1117 return "Invalid procedure table from service provider";
1119 #ifdef WSAINVALIDPROVIDER
1121 case WSAINVALIDPROVIDER:
1122 return "Invalid service provider version number";
1124 #ifdef WSAPROVIDERFAILEDINIT
1126 case WSAPROVIDERFAILEDINIT:
1127 return "Unable to initialize a service provider";
1130 case WSASYSCALLFAILURE:
1131 return "System call failure";
1133 msg = strerror (error_number);
1143 /* lan manager error codes */
1145 _dbus_lm_strerror(int error_number)
1152 switch (error_number)
1154 case NERR_NetNotStarted:
1155 return "The workstation driver is not installed.";
1156 case NERR_UnknownServer:
1157 return "The server could not be located.";
1159 return "An internal error occurred. The network cannot access a shared memory segment.";
1160 case NERR_NoNetworkResource:
1161 return "A network resource shortage occurred.";
1162 case NERR_RemoteOnly:
1163 return "This operation is not supported on workstations.";
1164 case NERR_DevNotRedirected:
1165 return "The device is not connected.";
1166 case NERR_ServerNotStarted:
1167 return "The Server service is not started.";
1168 case NERR_ItemNotFound:
1169 return "The queue is empty.";
1170 case NERR_UnknownDevDir:
1171 return "The device or directory does not exist.";
1172 case NERR_RedirectedPath:
1173 return "The operation is invalid on a redirected resource.";
1174 case NERR_DuplicateShare:
1175 return "The name has already been shared.";
1177 return "The server is currently out of the requested resource.";
1178 case NERR_TooManyItems:
1179 return "Requested addition of items exceeds the maximum allowed.";
1180 case NERR_InvalidMaxUsers:
1181 return "The Peer service supports only two simultaneous users.";
1182 case NERR_BufTooSmall:
1183 return "The API return buffer is too small.";
1184 case NERR_RemoteErr:
1185 return "A remote API error occurred.";
1186 case NERR_LanmanIniError:
1187 return "An error occurred when opening or reading the configuration file.";
1188 case NERR_NetworkError:
1189 return "A general network error occurred.";
1190 case NERR_WkstaInconsistentState:
1191 return "The Workstation service is in an inconsistent state. Restart the computer before restarting the Workstation service.";
1192 case NERR_WkstaNotStarted:
1193 return "The Workstation service has not been started.";
1194 case NERR_BrowserNotStarted:
1195 return "The requested information is not available.";
1196 case NERR_InternalError:
1197 return "An internal error occurred.";
1198 case NERR_BadTransactConfig:
1199 return "The server is not configured for transactions.";
1200 case NERR_InvalidAPI:
1201 return "The requested API is not supported on the remote server.";
1202 case NERR_BadEventName:
1203 return "The event name is invalid.";
1204 case NERR_DupNameReboot:
1205 return "The computer name already exists on the network. Change it and restart the computer.";
1206 case NERR_CfgCompNotFound:
1207 return "The specified component could not be found in the configuration information.";
1208 case NERR_CfgParamNotFound:
1209 return "The specified parameter could not be found in the configuration information.";
1210 case NERR_LineTooLong:
1211 return "A line in the configuration file is too long.";
1212 case NERR_QNotFound:
1213 return "The printer does not exist.";
1214 case NERR_JobNotFound:
1215 return "The print job does not exist.";
1216 case NERR_DestNotFound:
1217 return "The printer destination cannot be found.";
1218 case NERR_DestExists:
1219 return "The printer destination already exists.";
1221 return "The printer queue already exists.";
1223 return "No more printers can be added.";
1224 case NERR_JobNoRoom:
1225 return "No more print jobs can be added.";
1226 case NERR_DestNoRoom:
1227 return "No more printer destinations can be added.";
1229 return "This printer destination is idle and cannot accept control operations.";
1230 case NERR_DestInvalidOp:
1231 return "This printer destination request contains an invalid control function.";
1232 case NERR_ProcNoRespond:
1233 return "The print processor is not responding.";
1234 case NERR_SpoolerNotLoaded:
1235 return "The spooler is not running.";
1236 case NERR_DestInvalidState:
1237 return "This operation cannot be performed on the print destination in its current state.";
1238 case NERR_QInvalidState:
1239 return "This operation cannot be performed on the printer queue in its current state.";
1240 case NERR_JobInvalidState:
1241 return "This operation cannot be performed on the print job in its current state.";
1242 case NERR_SpoolNoMemory:
1243 return "A spooler memory allocation failure occurred.";
1244 case NERR_DriverNotFound:
1245 return "The device driver does not exist.";
1246 case NERR_DataTypeInvalid:
1247 return "The data type is not supported by the print processor.";
1248 case NERR_ProcNotFound:
1249 return "The print processor is not installed.";
1250 case NERR_ServiceTableLocked:
1251 return "The service database is locked.";
1252 case NERR_ServiceTableFull:
1253 return "The service table is full.";
1254 case NERR_ServiceInstalled:
1255 return "The requested service has already been started.";
1256 case NERR_ServiceEntryLocked:
1257 return "The service does not respond to control actions.";
1258 case NERR_ServiceNotInstalled:
1259 return "The service has not been started.";
1260 case NERR_BadServiceName:
1261 return "The service name is invalid.";
1262 case NERR_ServiceCtlTimeout:
1263 return "The service is not responding to the control function.";
1264 case NERR_ServiceCtlBusy:
1265 return "The service control is busy.";
1266 case NERR_BadServiceProgName:
1267 return "The configuration file contains an invalid service program name.";
1268 case NERR_ServiceNotCtrl:
1269 return "The service could not be controlled in its present state.";
1270 case NERR_ServiceKillProc:
1271 return "The service ended abnormally.";
1272 case NERR_ServiceCtlNotValid:
1273 return "The requested pause or stop is not valid for this service.";
1274 case NERR_NotInDispatchTbl:
1275 return "The service control dispatcher could not find the service name in the dispatch table.";
1276 case NERR_BadControlRecv:
1277 return "The service control dispatcher pipe read failed.";
1278 case NERR_ServiceNotStarting:
1279 return "A thread for the new service could not be created.";
1280 case NERR_AlreadyLoggedOn:
1281 return "This workstation is already logged on to the local-area network.";
1282 case NERR_NotLoggedOn:
1283 return "The workstation is not logged on to the local-area network.";
1284 case NERR_BadUsername:
1285 return "The user name or group name parameter is invalid.";
1286 case NERR_BadPassword:
1287 return "The password parameter is invalid.";
1288 case NERR_UnableToAddName_W:
1289 return "@W The logon processor did not add the message alias.";
1290 case NERR_UnableToAddName_F:
1291 return "The logon processor did not add the message alias.";
1292 case NERR_UnableToDelName_W:
1293 return "@W The logoff processor did not delete the message alias.";
1294 case NERR_UnableToDelName_F:
1295 return "The logoff processor did not delete the message alias.";
1296 case NERR_LogonsPaused:
1297 return "Network logons are paused.";
1298 case NERR_LogonServerConflict:
1299 return "A centralized logon-server conflict occurred.";
1300 case NERR_LogonNoUserPath:
1301 return "The server is configured without a valid user path.";
1302 case NERR_LogonScriptError:
1303 return "An error occurred while loading or running the logon script.";
1304 case NERR_StandaloneLogon:
1305 return "The logon server was not specified. Your computer will be logged on as STANDALONE.";
1306 case NERR_LogonServerNotFound:
1307 return "The logon server could not be found.";
1308 case NERR_LogonDomainExists:
1309 return "There is already a logon domain for this computer.";
1310 case NERR_NonValidatedLogon:
1311 return "The logon server could not validate the logon.";
1312 case NERR_ACFNotFound:
1313 return "The security database could not be found.";
1314 case NERR_GroupNotFound:
1315 return "The group name could not be found.";
1316 case NERR_UserNotFound:
1317 return "The user name could not be found.";
1318 case NERR_ResourceNotFound:
1319 return "The resource name could not be found.";
1320 case NERR_GroupExists:
1321 return "The group already exists.";
1322 case NERR_UserExists:
1323 return "The user account already exists.";
1324 case NERR_ResourceExists:
1325 return "The resource permission list already exists.";
1326 case NERR_NotPrimary:
1327 return "This operation is only allowed on the primary domain controller of the domain.";
1328 case NERR_ACFNotLoaded:
1329 return "The security database has not been started.";
1330 case NERR_ACFNoRoom:
1331 return "There are too many names in the user accounts database.";
1332 case NERR_ACFFileIOFail:
1333 return "A disk I/O failure occurred.";
1334 case NERR_ACFTooManyLists:
1335 return "The limit of 64 entries per resource was exceeded.";
1336 case NERR_UserLogon:
1337 return "Deleting a user with a session is not allowed.";
1338 case NERR_ACFNoParent:
1339 return "The parent directory could not be located.";
1340 case NERR_CanNotGrowSegment:
1341 return "Unable to add to the security database session cache segment.";
1342 case NERR_SpeGroupOp:
1343 return "This operation is not allowed on this special group.";
1344 case NERR_NotInCache:
1345 return "This user is not cached in user accounts database session cache.";
1346 case NERR_UserInGroup:
1347 return "The user already belongs to this group.";
1348 case NERR_UserNotInGroup:
1349 return "The user does not belong to this group.";
1350 case NERR_AccountUndefined:
1351 return "This user account is undefined.";
1352 case NERR_AccountExpired:
1353 return "This user account has expired.";
1354 case NERR_InvalidWorkstation:
1355 return "The user is not allowed to log on from this workstation.";
1356 case NERR_InvalidLogonHours:
1357 return "The user is not allowed to log on at this time.";
1358 case NERR_PasswordExpired:
1359 return "The password of this user has expired.";
1360 case NERR_PasswordCantChange:
1361 return "The password of this user cannot change.";
1362 case NERR_PasswordHistConflict:
1363 return "This password cannot be used now.";
1364 case NERR_PasswordTooShort:
1365 return "The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.";
1366 case NERR_PasswordTooRecent:
1367 return "The password of this user is too recent to change.";
1368 case NERR_InvalidDatabase:
1369 return "The security database is corrupted.";
1370 case NERR_DatabaseUpToDate:
1371 return "No updates are necessary to this replicant network/local security database.";
1372 case NERR_SyncRequired:
1373 return "This replicant database is outdated; synchronization is required.";
1374 case NERR_UseNotFound:
1375 return "The network connection could not be found.";
1376 case NERR_BadAsgType:
1377 return "This asg_type is invalid.";
1378 case NERR_DeviceIsShared:
1379 return "This device is currently being shared.";
1380 case NERR_NoComputerName:
1381 return "The computer name could not be added as a message alias. The name may already exist on the network.";
1382 case NERR_MsgAlreadyStarted:
1383 return "The Messenger service is already started.";
1384 case NERR_MsgInitFailed:
1385 return "The Messenger service failed to start.";
1386 case NERR_NameNotFound:
1387 return "The message alias could not be found on the network.";
1388 case NERR_AlreadyForwarded:
1389 return "This message alias has already been forwarded.";
1390 case NERR_AddForwarded:
1391 return "This message alias has been added but is still forwarded.";
1392 case NERR_AlreadyExists:
1393 return "This message alias already exists locally.";
1394 case NERR_TooManyNames:
1395 return "The maximum number of added message aliases has been exceeded.";
1396 case NERR_DelComputerName:
1397 return "The computer name could not be deleted.";
1398 case NERR_LocalForward:
1399 return "Messages cannot be forwarded back to the same workstation.";
1400 case NERR_GrpMsgProcessor:
1401 return "An error occurred in the domain message processor.";
1402 case NERR_PausedRemote:
1403 return "The message was sent, but the recipient has paused the Messenger service.";
1404 case NERR_BadReceive:
1405 return "The message was sent but not received.";
1406 case NERR_NameInUse:
1407 return "The message alias is currently in use. Try again later.";
1408 case NERR_MsgNotStarted:
1409 return "The Messenger service has not been started.";
1410 case NERR_NotLocalName:
1411 return "The name is not on the local computer.";
1412 case NERR_NoForwardName:
1413 return "The forwarded message alias could not be found on the network.";
1414 case NERR_RemoteFull:
1415 return "The message alias table on the remote station is full.";
1416 case NERR_NameNotForwarded:
1417 return "Messages for this alias are not currently being forwarded.";
1418 case NERR_TruncatedBroadcast:
1419 return "The broadcast message was truncated.";
1420 case NERR_InvalidDevice:
1421 return "This is an invalid device name.";
1422 case NERR_WriteFault:
1423 return "A write fault occurred.";
1424 case NERR_DuplicateName:
1425 return "A duplicate message alias exists on the network.";
1426 case NERR_DeleteLater:
1427 return "@W This message alias will be deleted later.";
1428 case NERR_IncompleteDel:
1429 return "The message alias was not successfully deleted from all networks.";
1430 case NERR_MultipleNets:
1431 return "This operation is not supported on computers with multiple networks.";
1432 case NERR_NetNameNotFound:
1433 return "This shared resource does not exist.";
1434 case NERR_DeviceNotShared:
1435 return "This device is not shared.";
1436 case NERR_ClientNameNotFound:
1437 return "A session does not exist with that computer name.";
1438 case NERR_FileIdNotFound:
1439 return "There is not an open file with that identification number.";
1440 case NERR_ExecFailure:
1441 return "A failure occurred when executing a remote administration command.";
1443 return "A failure occurred when opening a remote temporary file.";
1444 case NERR_TooMuchData:
1445 return "The data returned from a remote administration command has been truncated to 64K.";
1446 case NERR_DeviceShareConflict:
1447 return "This device cannot be shared as both a spooled and a non-spooled resource.";
1448 case NERR_BrowserTableIncomplete:
1449 return "The information in the list of servers may be incorrect.";
1450 case NERR_NotLocalDomain:
1451 return "The computer is not active in this domain.";
1452 #ifdef NERR_IsDfsShare
1454 case NERR_IsDfsShare:
1455 return "The share must be removed from the Distributed File System before it can be deleted.";
1458 case NERR_DevInvalidOpCode:
1459 return "The operation is invalid for this device.";
1460 case NERR_DevNotFound:
1461 return "This device cannot be shared.";
1462 case NERR_DevNotOpen:
1463 return "This device was not open.";
1464 case NERR_BadQueueDevString:
1465 return "This device name list is invalid.";
1466 case NERR_BadQueuePriority:
1467 return "The queue priority is invalid.";
1468 case NERR_NoCommDevs:
1469 return "There are no shared communication devices.";
1470 case NERR_QueueNotFound:
1471 return "The queue you specified does not exist.";
1472 case NERR_BadDevString:
1473 return "This list of devices is invalid.";
1475 return "The requested device is invalid.";
1476 case NERR_InUseBySpooler:
1477 return "This device is already in use by the spooler.";
1478 case NERR_CommDevInUse:
1479 return "This device is already in use as a communication device.";
1480 case NERR_InvalidComputer:
1481 return "This computer name is invalid.";
1482 case NERR_MaxLenExceeded:
1483 return "The string and prefix specified are too long.";
1484 case NERR_BadComponent:
1485 return "This path component is invalid.";
1487 return "Could not determine the type of input.";
1488 case NERR_TooManyEntries:
1489 return "The buffer for types is not big enough.";
1490 case NERR_ProfileFileTooBig:
1491 return "Profile files cannot exceed 64K.";
1492 case NERR_ProfileOffset:
1493 return "The start offset is out of range.";
1494 case NERR_ProfileCleanup:
1495 return "The system cannot delete current connections to network resources.";
1496 case NERR_ProfileUnknownCmd:
1497 return "The system was unable to parse the command line in this file.";
1498 case NERR_ProfileLoadErr:
1499 return "An error occurred while loading the profile file.";
1500 case NERR_ProfileSaveErr:
1501 return "@W Errors occurred while saving the profile file. The profile was partially saved.";
1502 case NERR_LogOverflow:
1503 return "Log file %1 is full.";
1504 case NERR_LogFileChanged:
1505 return "This log file has changed between reads.";
1506 case NERR_LogFileCorrupt:
1507 return "Log file %1 is corrupt.";
1508 case NERR_SourceIsDir:
1509 return "The source path cannot be a directory.";
1510 case NERR_BadSource:
1511 return "The source path is illegal.";
1513 return "The destination path is illegal.";
1514 case NERR_DifferentServers:
1515 return "The source and destination paths are on different servers.";
1516 case NERR_RunSrvPaused:
1517 return "The Run server you requested is paused.";
1518 case NERR_ErrCommRunSrv:
1519 return "An error occurred when communicating with a Run server.";
1520 case NERR_ErrorExecingGhost:
1521 return "An error occurred when starting a background process.";
1522 case NERR_ShareNotFound:
1523 return "The shared resource you are connected to could not be found.";
1524 case NERR_InvalidLana:
1525 return "The LAN adapter number is invalid.";
1526 case NERR_OpenFiles:
1527 return "There are open files on the connection.";
1528 case NERR_ActiveConns:
1529 return "Active connections still exist.";
1530 case NERR_BadPasswordCore:
1531 return "This share name or password is invalid.";
1533 return "The device is being accessed by an active process.";
1534 case NERR_LocalDrive:
1535 return "The drive letter is in use locally.";
1536 case NERR_AlertExists:
1537 return "The specified client is already registered for the specified event.";
1538 case NERR_TooManyAlerts:
1539 return "The alert table is full.";
1540 case NERR_NoSuchAlert:
1541 return "An invalid or nonexistent alert name was raised.";
1542 case NERR_BadRecipient:
1543 return "The alert recipient is invalid.";
1544 case NERR_AcctLimitExceeded:
1545 return "A user's session with this server has been deleted.";
1546 case NERR_InvalidLogSeek:
1547 return "The log file does not contain the requested record number.";
1548 case NERR_BadUasConfig:
1549 return "The user accounts database is not configured correctly.";
1550 case NERR_InvalidUASOp:
1551 return "This operation is not permitted when the Netlogon service is running.";
1552 case NERR_LastAdmin:
1553 return "This operation is not allowed on the last administrative account.";
1554 case NERR_DCNotFound:
1555 return "Could not find domain controller for this domain.";
1556 case NERR_LogonTrackingError:
1557 return "Could not set logon information for this user.";
1558 case NERR_NetlogonNotStarted:
1559 return "The Netlogon service has not been started.";
1560 case NERR_CanNotGrowUASFile:
1561 return "Unable to add to the user accounts database.";
1562 case NERR_TimeDiffAtDC:
1563 return "This server's clock is not synchronized with the primary domain controller's clock.";
1564 case NERR_PasswordMismatch:
1565 return "A password mismatch has been detected.";
1566 case NERR_NoSuchServer:
1567 return "The server identification does not specify a valid server.";
1568 case NERR_NoSuchSession:
1569 return "The session identification does not specify a valid session.";
1570 case NERR_NoSuchConnection:
1571 return "The connection identification does not specify a valid connection.";
1572 case NERR_TooManyServers:
1573 return "There is no space for another entry in the table of available servers.";
1574 case NERR_TooManySessions:
1575 return "The server has reached the maximum number of sessions it supports.";
1576 case NERR_TooManyConnections:
1577 return "The server has reached the maximum number of connections it supports.";
1578 case NERR_TooManyFiles:
1579 return "The server cannot open more files because it has reached its maximum number.";
1580 case NERR_NoAlternateServers:
1581 return "There are no alternate servers registered on this server.";
1582 case NERR_TryDownLevel:
1583 return "Try down-level (remote admin protocol) version of API instead.";
1584 case NERR_UPSDriverNotStarted:
1585 return "The UPS driver could not be accessed by the UPS service.";
1586 case NERR_UPSInvalidConfig:
1587 return "The UPS service is not configured correctly.";
1588 case NERR_UPSInvalidCommPort:
1589 return "The UPS service could not access the specified Comm Port.";
1590 case NERR_UPSSignalAsserted:
1591 return "The UPS indicated a line fail or low battery situation. Service not started.";
1592 case NERR_UPSShutdownFailed:
1593 return "The UPS service failed to perform a system shut down.";
1594 case NERR_BadDosRetCode:
1595 return "The program below returned an MS-DOS error code:";
1596 case NERR_ProgNeedsExtraMem:
1597 return "The program below needs more memory:";
1598 case NERR_BadDosFunction:
1599 return "The program below called an unsupported MS-DOS function:";
1600 case NERR_RemoteBootFailed:
1601 return "The workstation failed to boot.";
1602 case NERR_BadFileCheckSum:
1603 return "The file below is corrupt.";
1604 case NERR_NoRplBootSystem:
1605 return "No loader is specified in the boot-block definition file.";
1606 case NERR_RplLoadrNetBiosErr:
1607 return "NetBIOS returned an error: The NCB and SMB are dumped above.";
1608 case NERR_RplLoadrDiskErr:
1609 return "A disk I/O error occurred.";
1610 case NERR_ImageParamErr:
1611 return "Image parameter substitution failed.";
1612 case NERR_TooManyImageParams:
1613 return "Too many image parameters cross disk sector boundaries.";
1614 case NERR_NonDosFloppyUsed:
1615 return "The image was not generated from an MS-DOS diskette formatted with /S.";
1616 case NERR_RplBootRestart:
1617 return "Remote boot will be restarted later.";
1618 case NERR_RplSrvrCallFailed:
1619 return "The call to the Remoteboot server failed.";
1620 case NERR_CantConnectRplSrvr:
1621 return "Cannot connect to the Remoteboot server.";
1622 case NERR_CantOpenImageFile:
1623 return "Cannot open image file on the Remoteboot server.";
1624 case NERR_CallingRplSrvr:
1625 return "Connecting to the Remoteboot server...";
1626 case NERR_StartingRplBoot:
1627 return "Connecting to the Remoteboot server...";
1628 case NERR_RplBootServiceTerm:
1629 return "Remote boot service was stopped; check the error log for the cause of the problem.";
1630 case NERR_RplBootStartFailed:
1631 return "Remote boot startup failed; check the error log for the cause of the problem.";
1632 case NERR_RPL_CONNECTED:
1633 return "A second connection to a Remoteboot resource is not allowed.";
1634 case NERR_BrowserConfiguredToNotRun:
1635 return "The browser service was configured with MaintainServerList=No.";
1636 case NERR_RplNoAdaptersStarted:
1637 return "Service failed to start since none of the network adapters started with this service.";
1638 case NERR_RplBadRegistry:
1639 return "Service failed to start due to bad startup information in the registry.";
1640 case NERR_RplBadDatabase:
1641 return "Service failed to start because its database is absent or corrupt.";
1642 case NERR_RplRplfilesShare:
1643 return "Service failed to start because RPLFILES share is absent.";
1644 case NERR_RplNotRplServer:
1645 return "Service failed to start because RPLUSER group is absent.";
1646 case NERR_RplCannotEnum:
1647 return "Cannot enumerate service records.";
1648 case NERR_RplWkstaInfoCorrupted:
1649 return "Workstation record information has been corrupted.";
1650 case NERR_RplWkstaNotFound:
1651 return "Workstation record was not found.";
1652 case NERR_RplWkstaNameUnavailable:
1653 return "Workstation name is in use by some other workstation.";
1654 case NERR_RplProfileInfoCorrupted:
1655 return "Profile record information has been corrupted.";
1656 case NERR_RplProfileNotFound:
1657 return "Profile record was not found.";
1658 case NERR_RplProfileNameUnavailable:
1659 return "Profile name is in use by some other profile.";
1660 case NERR_RplProfileNotEmpty:
1661 return "There are workstations using this profile.";
1662 case NERR_RplConfigInfoCorrupted:
1663 return "Configuration record information has been corrupted.";
1664 case NERR_RplConfigNotFound:
1665 return "Configuration record was not found.";
1666 case NERR_RplAdapterInfoCorrupted:
1667 return "Adapter ID record information has been corrupted.";
1668 case NERR_RplInternal:
1669 return "An internal service error has occurred.";
1670 case NERR_RplVendorInfoCorrupted:
1671 return "Vendor ID record information has been corrupted.";
1672 case NERR_RplBootInfoCorrupted:
1673 return "Boot block record information has been corrupted.";
1674 case NERR_RplWkstaNeedsUserAcct:
1675 return "The user account for this workstation record is missing.";
1676 case NERR_RplNeedsRPLUSERAcct:
1677 return "The RPLUSER local group could not be found.";
1678 case NERR_RplBootNotFound:
1679 return "Boot block record was not found.";
1680 case NERR_RplIncompatibleProfile:
1681 return "Chosen profile is incompatible with this workstation.";
1682 case NERR_RplAdapterNameUnavailable:
1683 return "Chosen network adapter ID is in use by some other workstation.";
1684 case NERR_RplConfigNotEmpty:
1685 return "There are profiles using this configuration.";
1686 case NERR_RplBootInUse:
1687 return "There are workstations, profiles, or configurations using this boot block.";
1688 case NERR_RplBackupDatabase:
1689 return "Service failed to backup Remoteboot database.";
1690 case NERR_RplAdapterNotFound:
1691 return "Adapter record was not found.";
1692 case NERR_RplVendorNotFound:
1693 return "Vendor record was not found.";
1694 case NERR_RplVendorNameUnavailable:
1695 return "Vendor name is in use by some other vendor record.";
1696 case NERR_RplBootNameUnavailable:
1697 return "(boot name, vendor ID) is in use by some other boot block record.";
1698 case NERR_RplConfigNameUnavailable:
1699 return "Configuration name is in use by some other configuration.";
1700 case NERR_DfsInternalCorruption:
1701 return "The internal database maintained by the Dfs service is corrupt.";
1702 case NERR_DfsVolumeDataCorrupt:
1703 return "One of the records in the internal Dfs database is corrupt.";
1704 case NERR_DfsNoSuchVolume:
1705 return "There is no DFS name whose entry path matches the input Entry Path.";
1706 case NERR_DfsVolumeAlreadyExists:
1707 return "A root or link with the given name already exists.";
1708 case NERR_DfsAlreadyShared:
1709 return "The server share specified is already shared in the Dfs.";
1710 case NERR_DfsNoSuchShare:
1711 return "The indicated server share does not support the indicated DFS namespace.";
1712 case NERR_DfsNotALeafVolume:
1713 return "The operation is not valid on this portion of the namespace.";
1714 case NERR_DfsLeafVolume:
1715 return "The operation is not valid on this portion of the namespace.";
1716 case NERR_DfsVolumeHasMultipleServers:
1717 return "The operation is ambiguous because the link has multiple servers.";
1718 case NERR_DfsCantCreateJunctionPoint:
1719 return "Unable to create a link.";
1720 case NERR_DfsServerNotDfsAware:
1721 return "The server is not Dfs Aware.";
1722 case NERR_DfsBadRenamePath:
1723 return "The specified rename target path is invalid.";
1724 case NERR_DfsVolumeIsOffline:
1725 return "The specified DFS link is offline.";
1726 case NERR_DfsNoSuchServer:
1727 return "The specified server is not a server for this link.";
1728 case NERR_DfsCyclicalName:
1729 return "A cycle in the Dfs name was detected.";
1730 case NERR_DfsNotSupportedInServerDfs:
1731 return "The operation is not supported on a server-based Dfs.";
1732 case NERR_DfsDuplicateService:
1733 return "This link is already supported by the specified server-share.";
1734 case NERR_DfsCantRemoveLastServerShare:
1735 return "Can't remove the last server-share supporting this root or link.";
1736 case NERR_DfsVolumeIsInterDfs:
1737 return "The operation is not supported for an Inter-DFS link.";
1738 case NERR_DfsInconsistent:
1739 return "The internal state of the Dfs Service has become inconsistent.";
1740 case NERR_DfsServerUpgraded:
1741 return "The Dfs Service has been installed on the specified server.";
1742 case NERR_DfsDataIsIdentical:
1743 return "The Dfs data being reconciled is identical.";
1744 case NERR_DfsCantRemoveDfsRoot:
1745 return "The DFS root cannot be deleted. Uninstall DFS if required.";
1746 case NERR_DfsChildOrParentInDfs:
1747 return "A child or parent directory of the share is already in a Dfs.";
1748 case NERR_DfsInternalError:
1749 return "Dfs internal error.";
1750 /* the following are not defined in mingw */
1753 case NERR_SetupAlreadyJoined:
1754 return "This machine is already joined to a domain.";
1755 case NERR_SetupNotJoined:
1756 return "This machine is not currently joined to a domain.";
1757 case NERR_SetupDomainController:
1758 return "This machine is a domain controller and cannot be unjoined from a domain.";
1759 case NERR_DefaultJoinRequired:
1760 return "The destination domain controller does not support creating machine accounts in OUs.";
1761 case NERR_InvalidWorkgroupName:
1762 return "The specified workgroup name is invalid.";
1763 case NERR_NameUsesIncompatibleCodePage:
1764 return "The specified computer name is incompatible with the default language used on the domain controller.";
1765 case NERR_ComputerAccountNotFound:
1766 return "The specified computer account could not be found.";
1767 case NERR_PersonalSku:
1768 return "This version of Windows cannot be joined to a domain.";
1769 case NERR_PasswordMustChange:
1770 return "The password must change at the next logon.";
1771 case NERR_AccountLockedOut:
1772 return "The account is locked out.";
1773 case NERR_PasswordTooLong:
1774 return "The password is too long.";
1775 case NERR_PasswordNotComplexEnough:
1776 return "The password does not meet the complexity policy.";
1777 case NERR_PasswordFilterError:
1778 return "The password does not meet the requirements of the password filter DLLs.";
1782 msg = strerror (error_number);
1791 * Get a printable string describing the command used to execute
1792 * the process with pid. This string should only be used for
1793 * informative purposes such as logging; it may not be trusted.
1795 * The command is guaranteed to be printable ASCII and no longer
1798 * @param pid Process id
1799 * @param str Append command to this string
1800 * @param max_len Maximum length of returned command
1801 * @param error return location for errors
1802 * @returns #FALSE on error
1805 _dbus_command_for_pid (unsigned long pid,