Changeset 989 for vendor/current/source3/utils/smbget.c
- Timestamp:
- Nov 25, 2016, 8:04:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/utils/smbget.c
r988 r989 106 106 static char *savedun; 107 107 static char *savedpw; 108 char tmp[128];109 108 110 109 if (hasasked) { … … 116 115 hasasked = true; 117 116 118 if (!opt.nonprompt && !opt.username_specified) { 119 printf("Username for %s at %s [guest] ", shr, srv); 120 if (fgets(tmp, sizeof(tmp), stdin) == NULL) { 121 return; 122 } 123 if ((strlen(tmp) > 0) && (tmp[strlen(tmp) - 1] == '\n')) { 124 tmp[strlen(tmp) - 1] = '\0'; 125 } 126 strncpy(un, tmp, unlen - 1); 127 } else if (opt.username != NULL) { 117 /* 118 * If no user has been specified un is initialized with the current 119 * username of the user who started smbget. 120 */ 121 if (opt.username_specified) { 128 122 strncpy(un, opt.username, unlen - 1); 129 123 } 130 124 131 if (!opt.nonprompt && !opt.password_specified ) {125 if (!opt.nonprompt && !opt.password_specified && pw[0] == '\0') { 132 126 char *prompt; 133 if (asprintf(&prompt, "Password for %s at %s: ", shr, srv) == 134 -1) { 127 int rc; 128 129 rc = asprintf(&prompt, 130 "Password for [%s] connecting to //%s/%s: ", 131 un, shr, srv); 132 if (rc == -1) { 135 133 return; 136 134 }
Note:
See TracChangeset
for help on using the changeset viewer.